-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: removing extra pair of quotes in keyword filter #53158
Conversation
@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
I noticed a regression with my proposal when entering keywords which are already wrapped in double quotation marks. Hence, I deviated from the original proposal and found a better solution. Should I update my proposal for clafications? |
Yes, please. If you decided to update the regex, What makes your regex better than the first contributor's proposal? Which regression did you find? |
little bump @Tony-MK |
Just updated my proposal and it changes the regex to consider the colon as not a special character.
I found a regression when you enter a keyword with quotation marks the app would not allow me to save the search and on pressing view results, the app shows the not found page. Regression.mov |
How about the second part here? |
Oh, both of the regexes are wrong because they will cause a regression where the keywords don't give search results when known results are present. This is because the keyword is already wrapped and the colon is a special character used to split the search type and value. E.g. So, the regex we currently use is correct and should not be changed. However, after investigating the regressions, I noticed that we should remove only one pair of quotes, the first and last quotation marks, from
Do you have any thoughts about the explanation? |
Thanks, can you also add unit tests for this case so we won't face it again? |
Little bump on the comment above @Tony-MK |
I have added more tests, kindly check. Thanks |
Thanks for your update. I'll check it today! |
I think it failed the first testcase, please check the video below: Screen.Recording.2024-12-04.at.10.32.58.mov |
You included the single quotation marks (') wrapping the query. If you remove them, |
If you see in the video, the search query in the first tab is different with other tabs |
I tried testing some queries wrapped in single quotes. I noticed it removes the inner double quotation marks for double-quoted whitespaces in queries that are wrapped in single quotes into a one-space character wrapped in single quotations, a) One whitespace : It is similar to how queries with empty whitespaces wrapped in single quotes are handled, Eg: This doesn't affect queries with characters and if you replace the whitespaces with characters, Eg: Well, let me know if this is an edge case worth fixing since it only involves searching a precise pattern of empty whitespaces. |
The problem here is the inconsistency when switching between the filter tab |
I updated the regex. Check if the problem persists. |
I retested the changes and updated the videos.
I am not sure what you meant. Can you explain further? |
@Tony-MK I think we're still facing the same issue. Please look at the video below: Screen.Recording.2024-12-09.at.13.47.47.movI'm still seeing extra |
Can you give the steps to replicate this issue? I tried to replicate it but failed. Screen.Recording.2024-12-10.at.10.08.16.mov |
I think in the above video that you posted when you enter |
Yeah, but it only adds double quotes, not more than that. That's by design. The App/src/libs/SearchQueryUtils.ts Lines 39 to 42 in 7be9987
It's like how Therefore, |
Hmm, I'm afraid I have to disagree with you at this point, if our keyword's already wrapped inside |
That's okay, I understand. However, I am a bit scared that search regressions will arise like getting unexpected or no search results, since the double quote is specifically used in the regex in WDYT? Nevertheless, before I push the new changes, I would like to ensure that this is an issue I need to correct. After saving or viewing the results, if you entered a link that is already wrapped once, Hence, a user can not search for the exact keyword if it has a single pair of double quotes wrapping it such as Screen.Recording.2024-12-16.at.13.55.30.mov |
Thanks for your update. I'll take a look today! |
Look like serrver is down, I can't test it atm |
After taking tests, I agree with you at this point |
@Tony-MK Can you merge main please? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-12-25.at.13.52.19.movAndroid: mWeb Chromeandroidmandroid.moviOS: NativeScreen.Recording.2024-12-25.at.13.44.11.moviOS: mWeb SafariScreen.Recording.2024-12-25.at.13.46.29.movMacOS: Chrome / SafariChrome.movMacOS: DesktopDesk.mov |
Hey, I'll take a look at this tomorrow |
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.
lgtm thanks for the tests :)
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.80-1 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.80-6 🚀
|
just realized we shouldn't update |
@hungvu193, What about the keyword tests? They will fail so where should move them? |
You will need to regenerate searchParser.js file if you changed peggy file. So our tests wont be failed |
We have the command to generate searchParser.js in our package.json |
Thanks |
I opened the PR. |
Explanation of Change
This PR removes the extra pair of double quotation marks wrapped around keywords that contain special characters to prevent the keywords from being wrapped continuously after every search.
Fixed Issues
$ #52923
PROPOSAL: #52923 (comment)
Tests
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android.-.Native.webm
Android: mWeb Chrome
Android.-.mWeb.webm
iOS: Native
iOS.-.Native.mp4
iOS: mWeb Safari
iOS.-.mWeb.mp4
MacOS: Chrome / Safari
MacOS.-.Chrome.mov
MacOS: Desktop
MacOS.-.Desktop.mov