You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rules - Deleted Rules reappears after go offline #96857
Version Number: 9.4.43-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#95312 Email or phone of affected tester (no customers):applausetester+ndk44@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Windows 11 Home/Chrome App Component: Workspace Settings
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
After bulk-deleting Field requirements rules (which disappear correctly while online), toggling offline makes the deleted rules reappear in the table. Introduced by #95312.
What is the root cause of that problem?
The table builder hides an optimistically-deleted rule row only while online, and shows it again while offline:
When you delete a rule, the category's pendingFields are optimistically marked DELETE, so getRequireFieldsPendingActionForCategory returns DELETE and the row is hidden online. But if you go offline while that optimistic DELETE state is still active (the delete write request hasn't been acknowledged yet), the !isOffline guard no longer applies — so the row is rendered again. Row visibility should never depend on connectivity, but here it does, producing the "reappear when going offline" glitch.
Investigation details / evidence
deleteRequireFieldsRule (RequireFieldsRulesUtils.ts:394) tears the rule down via per-field actions (setPolicyCategoryDescriptionRequired, setPolicyCategoryAttendeesRequired, removePolicyCategoryReceiptsRequired, removePolicyCategoryItemizedReceiptsRequired).
Each action's optimisticData sets pendingFields.<field> = DELETE while keeping the underlying value; its successData/failureData reset pendingFields.<field> back to null. So pendingAction === DELETE only lives for the in-flight duration of the delete request (verified in src/libs/actions/Policy/Category.ts).
While that DELETE window is open, RequireFieldsRulesUtils.ts:716-721 hides the row online but re-shows it offline — which is exactly the reported symptom. It is trivially reproducible because a user can go offline at any moment after tapping delete.
The !isOffline guard appears to have been added so full-rule deletes look "cleanly gone" online (see the comment at RequireFieldsRulesUtils.ts:495-499), but coupling visibility to network state is what regresses the offline case.
Confidence: Medium-High — the network-dependent visibility at line 719 is a direct, verified cause. The exact trigger window (delete request in flight when going offline) is timing-based, but the design flaw is unambiguous.
What changes do you think we should make in order to solve the problem?
Make optimistically-deleted rows render consistently regardless of connectivity — do not branch on isOffline. Minimal fix: drop the !isOffline condition so a full-rule DELETE row is hidden the moment it's optimistically deleted, matching the expected result "deleted rules will not reappear":
The reviewer should confirm the intended offline-delete feedback UX: if a pendingAction=delete row is meant to stay visible with a strikethrough (standard OfflineWithFeedback pattern) until sync, then it should do so in both online and offline states rather than flipping between hidden and visible.
What alternative solutions did you explore?
Show the pending-delete row with a strikethrough/greyed OfflineWithFeedback indicator in both states until the server confirms deletion, instead of hiding it. This preserves offline feedback but changes the current online "instantly gone" behavior.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/96857) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Since this is a deploy blocker tied to #95312, the fastest path may be for the PR author to push this one-line fix directly (or revert).
@JS00001@situchan, I can't reproduce this issue. If the category settings aren't fully deleted, the rule will reappear in offline mode when the delete is optimistic, which is expected.
Activity
applause-bot commentedon Jul 23, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/2428a5e6c0b8ab67abeb5ff926f528a9d7aa02af165a096bc7606b3fedb1dcd8
melvin-bot commentedon Jul 23, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #95312
melvin-bot commentedon Jul 23, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 23, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
jponikarchuk commentedon Jul 23, 2026
This issue is not reproducible when
Use Staging Serveris disabled[-]Rules- Deleted Rules reappears after go offline[/-][+]Rules - Deleted Rules reappears after go offline[/+]MelvinBot commentedon Jul 23, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After bulk-deleting Field requirements rules (which disappear correctly while online), toggling offline makes the deleted rules reappear in the table. Introduced by #95312.
What is the root cause of that problem?
The table builder hides an optimistically-deleted rule row only while online, and shows it again while offline:
src/libs/RequireFieldsRulesUtils.ts:719When you delete a rule, the category's
pendingFieldsare optimistically markedDELETE, sogetRequireFieldsPendingActionForCategoryreturnsDELETEand the row is hidden online. But if you go offline while that optimisticDELETEstate is still active (the deletewriterequest hasn't been acknowledged yet), the!isOfflineguard no longer applies — so the row is rendered again. Row visibility should never depend on connectivity, but here it does, producing the "reappear when going offline" glitch.Investigation details / evidence
deleteRequireFieldsRule(RequireFieldsRulesUtils.ts:394) tears the rule down via per-field actions (setPolicyCategoryDescriptionRequired,setPolicyCategoryAttendeesRequired,removePolicyCategoryReceiptsRequired,removePolicyCategoryItemizedReceiptsRequired).optimisticDatasetspendingFields.<field> = DELETEwhile keeping the underlying value; itssuccessData/failureDataresetpendingFields.<field>back tonull. SopendingAction === DELETEonly lives for the in-flight duration of the delete request (verified insrc/libs/actions/Policy/Category.ts).DELETEwindow is open,RequireFieldsRulesUtils.ts:716-721hides the row online but re-shows it offline — which is exactly the reported symptom. It is trivially reproducible because a user can go offline at any moment after tapping delete.!isOfflineguard appears to have been added so full-rule deletes look "cleanly gone" online (see the comment atRequireFieldsRulesUtils.ts:495-499), but coupling visibility to network state is what regresses the offline case.Confidence: Medium-High — the network-dependent visibility at line 719 is a direct, verified cause. The exact trigger window (delete request in flight when going offline) is timing-based, but the design flaw is unambiguous.
What changes do you think we should make in order to solve the problem?
Make optimistically-deleted rows render consistently regardless of connectivity — do not branch on
isOffline. Minimal fix: drop the!isOfflinecondition so a full-ruleDELETErow is hidden the moment it's optimistically deleted, matching the expected result "deleted rules will not reappear":The reviewer should confirm the intended offline-delete feedback UX: if a
pendingAction=deleterow is meant to stay visible with a strikethrough (standardOfflineWithFeedbackpattern) until sync, then it should do so in both online and offline states rather than flipping between hidden and visible.What alternative solutions did you explore?
Show the pending-delete row with a strikethrough/greyed
OfflineWithFeedbackindicator in both states until the server confirms deletion, instead of hiding it. This preserves offline feedback but changes the current online "instantly gone" behavior.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/96857)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
Since this is a deploy blocker tied to #95312, the fastest path may be for the PR author to push this one-line fix directly (or revert).
1 remaining item
JS00001 commentedon Jul 23, 2026
Behind a beta
melvin-bot commentedon Jul 28, 2026
@situchan Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Jul 30, 2026
@situchan 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Krishna2323 commentedon Aug 3, 2026
@JS00001 @situchan, I can't reproduce this issue. If the category settings aren't fully deleted, the rule will reappear in offline mode when the delete is optimistic, which is expected.
situchan commentedon Aug 3, 2026
I am not able to reproduce either. Maybe tester's device was on slow network connection so it's delete pending.
Screen.Recording.2026-08-03.at.3.56.41.PM.mov
JS00001 commentedon Aug 3, 2026
Requested a retest
m-natarajan commentedon Aug 3, 2026
Not repro, Windows 11 / Chrome, v9.4.48-2
04.08.2026_01.30.19_REC.mp4