Repository navigation
Always send shouldSaveRecentSearch in the Search payload - #102195
Conversation
Co-authored-by: dmkt9 <dmkt9@users.noreply.github.com>
|
To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot update your checklist:
|
|
Checklist updated — every box in the PR body is now checked (0 unchecked remaining), and Offline tests and QA Steps both read Three related edits I made so the checked boxes and
Two things to be aware of before you mark this ready for review:
|
|
@MelvinBot mark this PR as ready |
|
🤖 Marked this PR as ready for review. Two things still need a human before review can proceed:
For the Android platform row, the verification run and screenshots from the earlier comment on this PR can be reused as evidence — all documented steps passed there. |
Reviewer Checklist
Screenshots/Videosandroid.mp4 |
| filters: backendQueryJSON.filters ?? null, | ||
| shouldCalculateTotals, | ||
| ...(shouldSaveRecentSearch && {shouldSaveRecentSearch: true}), | ||
| // Always send the flag, including when it is false. The backend defaults a missing flag to true so that |
There was a problem hiding this comment.
lets remove this, this is a past-looking comment
There was a problem hiding this comment.
Done — removed in 78ac577. Agreed, the comment described the bug being fixed rather than the code, so it belongs in the PR description (where it already is), not inline.
Verified after the change: npm test -- tests/unit/Search (57 suites, 1773 tests passed), npm run lint-changed, npm run typecheck, and npm run spell-changed all pass. No behavior change — the payload still always carries shouldSaveRecentSearch.
Co-authored-by: dmkt9 <dmkt9@users.noreply.github.com>
|
Nothing is failing anymore — all 37 checks on the head commit The one check that did fail was Check independent approval (step The last check to settle was Reassure Performance Tests, which was still in progress when you asked. It has since finished: |
|
🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.4.94-0 🚀
|
|
No help site changes are needed for this PR, so I didn't create a docs PR. Why
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.94-0 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
search()only serializedshouldSaveRecentSearchinto the payload when it wastrue:The backend defaults a missing flag to
trueso that older clients keep saving recent searches. That means every programmatic search — the Home screen sections, post-action refreshes — arrived at the backend indistinguishable from a user-submitted search, and got written to thenvp_recentSearchesNVP.Those writes land asynchronously (via Pusher) after the Search router has already closed, so reopening the router shows the recent searches list reordered, or carrying Home-section queries the user never typed. That is the reported "Search list changing without doing any search".
This PR always sends the flag, including when it is
false, so the backend can tell a programmatic search from a user submit:The existing unit test that asserted the flag was omitted by default now asserts it is sent as
false. The rest of the flag wiring (the dedupe/upgrade path, and the static check that onlyuseSearchPageSetuppassestrue) is unchanged and still covered.Fixed Issues
$ #99531
PROPOSAL: #99531 (comment)
Tests
Searchrequests fired by Home carry"shouldSaveRecentSearch":falseinjsonQuery, and the user-submitted search carriestrue.Offline tests
Same as Tests
QA Steps
Same as Tests
AI Tests
Run locally on the changed files (
src/libs/actions/Search.ts,tests/unit/Search/searchSaveRecentSearchFlagTest.ts):npm test -- tests/unit/Searchnpm run lint-changednpm run typechecknpm run spell-changedNot run:
prettier(no prettier config or script in this repo — ESLint covers style),react-compiler-compliance-check(no components or hooks changed), and the platform-gated checks (no shell, translation, docs, action, or patch files changed).End-to-end verification of steps 1-4 was run on standalone Android NewDot and passed: the recent searches list did not reorder and gained only the query that was actually typed, with no JS console errors. Step 5 (network tab) is not observable on a native client; logcat showed the Home background search sending
"shouldSaveRecentSearch":falseand the user-submitted search sendingtrue, consistent with the fix. See the Android verification comment for per-step screenshots.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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