-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Change parameter name to give more useful TypeScript error on SDK version mismatch #584
fix: Change parameter name to give more useful TypeScript error on SDK version mismatch #584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it!
In this case, wouldn't it also give a margin of error to the user where the user installs |
Yes correct, this doesn't check the versions at all, it just means that if the types don't match, the error displayed by TypeScript is more helpful. We no doubt go through quite a few patch releases before the types become incompatible so this is not foolproof. We could add version specific properties to some key types that cause the types to break immediately if versions don't match like: interface ClientOptions {
_sdk_version_v7_16_0?: bool
} |
yeah but this could possibly be a breaking change. could we just update the injected type for |
This would only break the TypeScript builds of those using mismatched versions of SDKs and that is neither tested nor supported. If any customers have mismatched versions that are currently working, this is purely luck, even with only patch version differences.
I don't think we can do anything from the top-level types since we need there to be a mismatch between the common types in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can do anything from the top-level types since we need there to be a mismatch between the common types in @sentry/electron and whichever front-end SDK is being passed in (ie. @sentry/core).
This is a good point. Given that I'd be fine with updating the types this way and merging this in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good small improvement for this context!
Closes #583
The error reported in the above issue would now read: