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 - Edited rule is crossed out after changing category offline #96817
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+ssndjois2jd1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Log in with Expensifail account.
Enable Rules.
Go to staging.new.expensify.com
Go to workspace settings > Rules > Field requirements.
Click Create field requirement rule.
Select a category.
Select Require for Description, Receipt and Itemized receipt.
Click Save rule.
Go offline.
Open the created rule.
Change category and save it.
Expected Result:
The edited rule will be grayed out after changing category offline.
Actual Result:
The edited rule is crossed out after changing category offline.
A new rule is created instead.
👋 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.
When you edit a Field requirements rule offline and change its category, the original rule row is shown crossed out (pending delete) and a new rule appears, instead of the single rule simply being grayed out (pending update).
What is the root cause of that problem?
Field-requirement "rules" are not standalone records — they are flags stored directly on the PolicyCategory object, keyed by category name. The rule's identity is its category (RequireFieldsRulesUtils.ts:43-49), so there is no backend "move to another category" op.
When the category changes, the save handler intentionally does delete-old + create-new (RequireFieldsRulePageBase.tsx:348-352): deleteRequireFieldsRule stamps pendingFields.<field> = DELETE on the old category, which getRequireFieldsPendingActionForCategory collapses into a category-level DELETE (crossed-out row).
This is invisible online because pending-DELETE rows are filtered out of the table — but that filter is gated on !isOffline, so offline the crossed-out old row stays visible (RequireFieldsRulesUtils.ts:716-721):
if(!isOffline&&isPendingDelete){continue;}
Result: offline you see the original rule crossed out plus the new rule; online you only see the reassigned (grayed) rule.
Data flow
Edit rule offline, pick a new category → handleSave computes didChangeCategory = true.
deleteRequireFieldsRule(oldCategory) clears every field on the old category, each write stamping pendingFields.<field> = DELETE.
saveRequireFieldsRule(newCategory) stamps the new category's fields with pendingFields = UPDATE.
Table build: old category → DELETE (full delete, crossed out); new category → UPDATE (grayed).
Offline the !isOffline && isPendingDelete guard does not skip the old row, so both render.
Introduced by #95312 (rewrote RequireFieldsRulesUtils.ts, +717).
What changes do you think we should make in order to solve the problem?
The delete+create data operations are unavoidable (the model is per-category), so the fix is display-only: don't show the reassigned old-category row as a crossed-out standalone rule offline.
Smallest fix: drop the !isOffline condition at RequireFieldsRulesUtils.ts:718 so pending-DELETE rows are hidden offline too (if (isPendingDelete) continue;), matching online behavior. Trade-off: a genuine offline delete of a rule would then also disappear immediately rather than showing a crossed-out row.
More surgical (preserves offline delete UX): only when handleSave performs a category reassignment, avoid the full deleteRequireFieldsRule that yields a crossed-out full-delete row — clear only the moving fields / tag the old category so the table treats it as reassigned rather than deleted. Larger, needs old→new correlation.
The team should confirm the intended offline UX for a genuine rule deletion (crossed-out vs. immediate removal), which decides between the two.
⚠️ Deploy blocker: if a targeted fix can't land quickly, reverting #95312 is the fallback, though it removes a large feature.
What alternative solutions did you explore? (Optional)
N/A
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/96817) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Require-fields rules are stored per category, so changing the category offline is treated as delete on the old category + create on the new one. That’s why the original row is crossed out (pending delete) and a new row appears, instead of a single grayed-out update.
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/9d11315cfa9cd1ba717558b0d64330f7bdedd24df182473585d326d8e2bc3108
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:
MelvinBot commentedon Jul 23, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When you edit a Field requirements rule offline and change its category, the original rule row is shown crossed out (pending delete) and a new rule appears, instead of the single rule simply being grayed out (pending update).
What is the root cause of that problem?
Field-requirement "rules" are not standalone records — they are flags stored directly on the
PolicyCategoryobject, keyed by category name. The rule's identity is its category (RequireFieldsRulesUtils.ts:43-49), so there is no backend "move to another category" op.When the category changes, the save handler intentionally does delete-old + create-new (
RequireFieldsRulePageBase.tsx:348-352):deleteRequireFieldsRulestampspendingFields.<field> = DELETEon the old category, whichgetRequireFieldsPendingActionForCategorycollapses into a category-levelDELETE(crossed-out row).This is invisible online because pending-DELETE rows are filtered out of the table — but that filter is gated on
!isOffline, so offline the crossed-out old row stays visible (RequireFieldsRulesUtils.ts:716-721):Result: offline you see the original rule crossed out plus the new rule; online you only see the reassigned (grayed) rule.
Data flow
handleSavecomputesdidChangeCategory = true.deleteRequireFieldsRule(oldCategory)clears every field on the old category, each write stampingpendingFields.<field> = DELETE.saveRequireFieldsRule(newCategory)stamps the new category's fields withpendingFields = UPDATE.DELETE(full delete, crossed out); new category →UPDATE(grayed).!isOffline && isPendingDeleteguard does not skip the old row, so both render.Introduced by #95312 (rewrote
RequireFieldsRulesUtils.ts, +717).What changes do you think we should make in order to solve the problem?
The delete+create data operations are unavoidable (the model is per-category), so the fix is display-only: don't show the reassigned old-category row as a crossed-out standalone rule offline.
!isOfflinecondition atRequireFieldsRulesUtils.ts:718so pending-DELETE rows are hidden offline too (if (isPendingDelete) continue;), matching online behavior. Trade-off: a genuine offline delete of a rule would then also disappear immediately rather than showing a crossed-out row.handleSaveperforms a category reassignment, avoid the fulldeleteRequireFieldsRulethat yields a crossed-out full-delete row — clear only the moving fields / tag the old category so the table treats it as reassigned rather than deleted. Larger, needs old→new correlation.The team should confirm the intended offline UX for a genuine rule deletion (crossed-out vs. immediate removal), which decides between the two.
What alternative solutions did you explore? (Optional)
N/A
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/96817)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
situchan commentedon Jul 23, 2026
This is same bug as reported here
melvin-bot commentedon Jul 28, 2026
@Krishna2323 Eep! 4 days overdue now. Issues have feelings too...
JS00001 commentedon Jul 29, 2026
@Krishna2323 have you gotten to this one yet?
melvin-bot commentedon Jul 30, 2026
@Krishna2323 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Krishna2323 commentedon Aug 3, 2026
Working on the PR...
Krishna2323 commentedon Aug 3, 2026
@JS00001 this is expected:
Require-fields rules are stored per category, so changing the category offline is treated as delete on the old category + create on the new one. That’s why the original row is crossed out (pending delete) and a new row appears, instead of a single grayed-out update.
JS00001 commentedon Aug 3, 2026
Yeah i agree this looks expected