Repository navigation
Preserve tag filters cache offline - #102350
Conversation
Do not wipe cached tag filter results on unmount so they remain available offline when reopening the filter.
|
@Krishna2323 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] |
Unify pagination state updates across ref and Onyx to satisfy CONSISTENCY-3.
Reset active search term on unmount and scope pagination cache by policyIDs so stale terms and wrong workspace tags do not suppress offline fallback.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Searching online overwrote cached results with partial matches, leaving too few tags to enable the search box offline. Cache base tags separately in pagination state so unmount or offline mode restores the full tag list.
|
@MelvinBot review |
Code reviewThe approach works for the reported case, but I found two bugs to fix before merge. CI is green except the approval check. 1. Offline search shows another workspace's tags. Repro: cache tags for workspace A, go offline, and scope the filter to workspace B. The list is empty at first, which is correct. Type one letter, and Fix: scope the base values to the current workspace, for example 2. Online reopen no longer re-fetches a complete tag list. The old unmount cleanup cleared the cache, so every reopen fetched fresh tags. Now, after a full load ( Fix: make the mount and reconnect fetch always call the server for the first page. The cached Minor cleanups (non-blocking)
|
|
@ShridharGoel pelase check the bugs found by melvin, I confirmed both are real |
…tag-filters # Conflicts: # src/ONYXKEYS.ts
|
@MelvinBot review |
Code review (re-review of
|
|
Agreed |
|
@ShridharGoel but it works for P-1 and not P-2. In online mode, I loaded all the tags from both policies, but after going offline and filtering by P-1, the P-1 tags are shown while the same doesn't happen for P-2. Am I missing something? |
|
@Krishna2323 Can you try after clearing the cache? Maybe P-1's tags were already cached under P-1's specific key if you filtered by that earlier? |
|
@ShridharGoel same results even after clearing cache: Monosnap.screencast.2026-10-06.01-14-06.mp4 |
|
@Krishna2323 Is P-1 your default workspace? I was able to repro, and it was happening since just after resetting the cache |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMonosnap.screencast.2026-10-06.16-15-31.mp4 |
@ShridharGoel Yes. P-1 is my default workspace, so |
JS00001
left a comment
There was a problem hiding this comment.
Couple of small comments. Also, why were the github action js files updated? This shouldnt have affected those, right?
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Seems like they got added by mistake |
|
is this ready again @ShridharGoel |
|
@JS00001 Yes |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 JS00001 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.4-0 🚀
|
|
No help site update is needed. This PR is a bug fix: previously loaded tags now stay available when you reopen the Tag filter offline. It doesn't add a feature, rename anything, or make any sentence in |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.4-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Preserves cached tag filter results in Onyx when
useSearchTagFiltersunmounts so previously loaded tags remain accessible when reopening the filter offline. When online, reopening with incomplete pagination continues to re-fetch from the first page as intended. Also removes the unusedclearSearchTagFiltersStateaction.Fixed Issues
$ #102049
Tests
Offline tests
QA Steps
Same as tests.
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
MacOS: Chrome / Safari
Screen.Recording.2026-09-26.at.7.46.57.PM.mov