fix: Offline deleted rules reappear after reconnecting until cache is cleared v2#87737
fix: Offline deleted rules reappear after reconnecting until cache is cleared v2#87737nkdengineer wants to merge 5 commits intoExpensify:mainfrom
Conversation
…g until cache is cleared""
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.
|
|
@sobitneupane 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2da27fbc1b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (category.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { | ||
| return acc; |
There was a problem hiding this comment.
Filter success/failure category maps consistently
When a source category is pending delete, this new early return skips it only in optimisticCategoryMap, but successCategoryMap and failureCategoryMap still iterate over all categoriesValues. In the duplicate-workspace flow, that means the success/failure merge can re-create a placeholder entry for a deleted category ({errors: null, pendingAction: null}) even though it was intentionally excluded, causing deleted categories to reappear in the duplicated workspace state until a later sync. Apply the same pending-delete filter to the success/failure reducers (or derive them from the filtered set).
Useful? React with 👍 / 👎.
|
@nkdengineer I can still reproduce this issue offline. Screen.Recording.2026-04-22.at.19.57.26.mov |
|
@sobitneupane I fixed. |
Explanation of Change
fix: Offline deleted rules reappear after reconnecting until cache is cleared
Fixed Issues
$ #83130
#87683
#87674
PROPOSAL: #83130 (comment)
Tests
Precondition: Create a workspace with distance rates, merchant rules, taxes, categories, members, report fields data
Offline tests
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Screen.Recording.2026-03-19.at.15.27.02.mov
Android: mWeb Chrome
Screen.Recording.2026-03-19.at.15.25.27.mov
iOS: Native
Screen.Recording.2026-03-19.at.15.23.17.mov
iOS: mWeb Safari
Screen.Recording.2026-03-19.at.15.21.11.mov
MacOS: Chrome / Safari
Screen.Recording.2026-03-19.at.15.18.27.mp4
Screen.Recording.2026-04-13.at.14.48.08.mov
Screen.Recording.2026-04-13.at.14.50.57.mov