-
-
Notifications
You must be signed in to change notification settings - Fork 452
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 the context_lines option not skipping reading the source code if its value is set to null #1003
Fix the context_lines option not skipping reading the source code if its value is set to null #1003
Conversation
…its value is set to 0
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.
Looking at the docs, this seems the wrong behavior: https://docs.sentry.io/platforms/php/#context_lines
If
null
is set as the value, no source code lines will be added to each stack trace frame. By default this option is set to 3.
I tend to agree with this, because it allows to have just the user to have only the offending rule; so, null
is "Do not upload my source code" where instead 0
is "upload only the offending line, no context lines".
While you are right that the documentation says a different thing, and from what I see the Go SDK follows the same reasoning, I don't think that it really makes sense that setting the option to |
It seems we're not agreeing on the meaning of "context". Context is the surrounding of the subject, so in this case the lines above and below the one in the stacktrace. That's why I consider that the correct approach. @HazAT can you weight in here? Is this interpretation the right and meant one? |
After reading the linked article I now think that you are proven right, but to be on the safe side let's wait anyway for a final word by @HazAT |
So 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.
Good change/fix 👍
I noticed that setting the
context_lines
option to0
null
does not prevent the source code from being read and attached to each frame of a stacktrace, but the documentation says it should work this way. In addition to this, the validation was missing leading to bad things when such option was set to a value lower than zero, so I took the time to fix this too.