fix: [Insights] Prevent limit filter value from polluting keyword when query contains spaces#82059
Conversation
|
@ShridharGoel 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Let's add a unit test |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-02-12.at.11.49.47.AM.mov |
ShridharGoel
left a comment
There was a problem hiding this comment.
Just need to wait for a unit test
|
@TaduJR can you add that test today? |
|
Yea yea. Will handle it in 30 min |
…ts-Release-1-Top-Categories-Add-a-limit-filter-to-search
…amination prevention
It's done. Thanks! |
|
@ShridharGoel good with you? |
|
Yes |
|
🚧 @puneetlath has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ 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/puneetlath in version: 9.3.19-0 🚀
|
Explanation of Change
When a limit filter value containing spaces (e.g.,
"10 90") was saved, it was serialized into the query string without quotes (limit:10 90). The search parser splits on whitespace, so it parsedlimit:10as the limit and treated90as a free-text keyword. This caused the keyword field to show"hi 90"instead of"hi"when reopening filters.The fix wraps the limit value with the existing
sanitizeSearchValue()helper, which quotes values containing spaces (producinglimit:"10 90"). This is the same pattern used by all other filter values in the query string builder.Fixed Issues
$ #81166
PROPOSAL:
Tests
hiand save.10 90, and save.hi(nothi 90).10 90or is empty (since10 90is not a valid positive integer), but the keyword is not contaminated.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 Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Macbook-Chrome.mov