-
Notifications
You must be signed in to change notification settings - Fork 179
Fix empty or null DSN not disabling Sentry #454
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
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.
Is there any way to test this?
Technically speaking yes, we could add a test that assert that given a certain value of the DSN option it is kept, practically I don't see any value in doing it because there is no code to test |
That's still a regression test. It's a test of a functionality, the fact that you had to delete code to make it work doesn't make the bug disappear out of thin air. |
The point is that as I already said there is nothing to test: the fact that a value (regardless of what is it) set for the DSN option is passed down to the |
That's not the full picture. Here you have a side effect from the client hijacking the bundle's configuration. I would imagine a test where I set the |
Once we test that whatever value is set in the bundle's config is also set in the options of the client, we test everything we should in this package. In turn, it's the job of the tests in the |
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.
Ok I'm fine with it, let's ship it
Fixes #453. During the refactoring of the
Configuration
class of the bundle, for some reason I thought that when the DSN value is an empty string or anull
value it should have been removed from the options array, probably because I forgot that the default value in the base SDK is theSENTRY_SDK
environment variable and not anull
value. This causes a big problem when you explicitly set the option to one of those values (for example in the test or development environment) and the environment variable is also set because the option is not passed to the core SDK and Sentry remains enabled.