🐛 fix(slack): Don't escape string during assignee dropdown search#85803
Merged
Conversation
cathteng
approved these changes
Feb 24, 2025
Comment on lines
40
to
41
| # in case either have special characters, we want to preserve the strings | ||
| # as is, so we escape both before applying re.match |
Member
There was a problem hiding this comment.
@iamrajjoshi Do you know what was the reason behind initially doing this? This comment make me 🤔
Collaborator
Author
There was a problem hiding this comment.
yep, initially when a user inputs special regex characters like \ or unterminated [ we got an error because the input is not escaped properly.
this pr attempted to fix the problem by escaping 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. however, the extra escape on the comparison string shouldn't have been done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #85530
the bug was that we were regex escaping
stringwhich represents the actual string we are comparing against (the user's email for example).if we escape it, it goes from something like
aaa@b.comtoaaa@b\.com.Now, if we try to regex compare it with regex escaped
substring(user input), when the comparison gets to., it will see\in the original string and return False.by not escaping the original string, we allow for a natural comparison.
i also verified this locally.