-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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(slack): Escape assignee dropdown input #71105
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #71105 +/- ##
==========================================
- Coverage 77.90% 77.90% -0.01%
==========================================
Files 6552 6552
Lines 291463 291465 +2
Branches 50419 50419
==========================================
- Hits 227072 227071 -1
- Misses 58132 58135 +3
Partials 6259 6259
|
self.store_event(data=self.event_data, project_id=self.project.id) | ||
|
||
# shouldn't fail | ||
resp = self.post_webhook(substring="Al[", original_message=self.original_message) |
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.
why [? 🤔
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 guess my question is what was the problem for it not working before? Trying to learn 😅
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.
on the user's side nothing seems wrong! but on our side when a user inputs special regex characters like \
or unterminated [
we get an error in sentry because the input is not escaped properly. this pr escapes the input so that when we process the input we don't interpret those characters as special regex and instead just interpret them as is. so Al[
would become Al\\[
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 SO post describes what Isabella is trying to fix: https://stackoverflow.com/questions/54135606/python-re-error-unterminated-character-set-at-position
However, it looks like for [
and {
we only need to escape the opening, and not the closing. But for (
we also need to do it for ending )
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.
The docs mention this situation with re.match
method: https://docs.python.org/3/library/re.html#raw-string-notation
Fixes SENTRY-2MBQ