Skip to content

🐛 fix(slack): Don't escape string during assignee dropdown search#85803

Merged
iamrajjoshi merged 1 commit into
masterfrom
raj/fix-assignee-dropdown
Feb 24, 2025
Merged

🐛 fix(slack): Don't escape string during assignee dropdown search#85803
iamrajjoshi merged 1 commit into
masterfrom
raj/fix-assignee-dropdown

Conversation

@iamrajjoshi

Copy link
Copy Markdown
Collaborator

closes #85530

the bug was that we were regex escaping string which 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.com to aaa@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.

@iamrajjoshi iamrajjoshi self-assigned this Feb 24, 2025
@iamrajjoshi iamrajjoshi requested review from a team as code owners February 24, 2025 22:19
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 24, 2025
@iamrajjoshi iamrajjoshi merged commit 7eb0584 into master Feb 24, 2025
@iamrajjoshi iamrajjoshi deleted the raj/fix-assignee-dropdown branch February 24, 2025 22:50
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamrajjoshi Do you know what was the reason behind initially doing this? This comment make me 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack assignment not finding users.

3 participants