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-Merchant Rule created in offline is not greyed out & strikethrough when deleted #81138
Version Number: V9.3.11-17 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80853 Email or phone of affected tester (no customers):dreamnitethedragon+yydyd373@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redminote 10S Android 13 App Component: Workspace Settings
Action Performed:
Launch app
Create a workspace
Tap more features - Enable Rules
Tap Rules
Go offline
Create a rule and save
Note Rule is not greyed out
Edit the rule and save
Note Rule is not greyed out
Open the rule and delete it
Note Rule is not strikethrough
Expected Result:
Merchant Rule created in offline must be greyed out & strikethrough when deleted to be consistent with other features in app.
Actual Result:
Merchant Rule created in offline is not greyed out & strikethrough when deleted.
👋 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.
Classification: Frontend bug Causing PR: #80853 - "Remove dev lock from merchant rules" by @luacmartins (High confidence) Related Issues: #80855
Recommendation: ROLL FORWARD
PR #80853 enabled the merchant rules feature in staging by removing the dev lock. However, it did not implement the offline feedback functionality required for proper offline behavior. The fix is straightforward and should be rolled forward rather than reverted.
Labels: DeployBlocker label should remain, DeployBlockerCash label should remain (App changes needed)
📋 Detailed Analysis
Evidence
The issue reports that merchant rules created/edited/deleted in offline mode do not show the grey-out and strikethrough visual indicators that are standard for offline operations in the app.
PR #80853 changed only 2 lines in src/pages/workspace/rules/MerchantRulesSection.tsx:
Changed from checking isDevelopment to isProduction to enable the feature in staging
Verification
I examined the affected file and compared it with other rules sections:
MerchantRulesSection.tsx (lines 127-146):
Directly renders MenuItemWithTopDescription components for each rule
Does NOT use the OfflineWithFeedback wrapper component
Does NOT pass any pendingAction prop
IndividualExpenseRulesSection.tsx (lines 236-248) - Working correctly:
ExpenseReportRulesSection.tsx also uses OfflineWithFeedback wrappers with pendingAction props.
Root Cause
The merchant rules feature was developed behind a dev lock and never had offline feedback implemented. When PR #80853 enabled it in staging, the missing offline functionality became visible.
The backend actions (src/libs/actions/Policy/Rules.ts) properly set pendingAction on policy.pendingFields.rules for add/update/delete operations (lines 169, 271), but the UI component doesn't consume this data.
Fix Required
The fix needs to happen in MerchantRulesSection.tsx:
Wrap each rule menu item with OfflineWithFeedback
Pass the appropriate pendingAction (from policy?.pendingFields?.rules)
Filter out null rules (deleted rules are set to null in the store)
Handle the strikethrough styling for delete operations
This is a simple UI fix that can be implemented quickly without reverting the feature.
Please re-state the problem that we are trying to solve in this issue.
When a merchant rule is created, edited, or deleted while offline, the rule list does not show the usual offline feedback (greyed out for pending changes and strikethrough for pending delete). This is inconsistent with other areas of the app that show offline feedback for pending actions.
What is the root cause of that problem?
Merchant rules do not store a per-rule pendingAction on the rule itself. Instead, the rules logic only sets a policy-level pendingFields.rules flag, and the rules list does not wrap rows with OfflineWithFeedback. Because of this, the list has no per-item signal to apply offline styles or strikethrough when a rule is pending deletion.
What changes do you think we should make in order to solve the problem?
Add a pendingAction field to the CodingRule type so each rule can carry its own offline status.
Update the optimistic rule writes:
For add/edit: set pendingAction on the rule while offline.
On success: clear pendingAction for that specific rule.
For delete: keep the rule in Onyx with pendingAction=DELETE instead of setting it to null immediately, so the UI can show strikethrough and dimmed styling.
On delete success: set the rule to null to remove it from the list.
Update the merchant rules list UI to wrap each row with OfflineWithFeedback, and disable navigation if a rule is pending delete to avoid editing a rule that is being removed.
--- a/src/libs/actions/Policy/Rules.ts+++ b/src/libs/actions/Policy/Rules.ts@@ -123,6 +123,7 @@ function setPolicyCodingRule(policyID: string, form: MerchantRuleForm, policy: P
const targetRuleID = ruleID ?? NumberUtils.rand64();
const operator = form.matchType ?? CONST.SEARCH.SYNTAX_OPERATORS.CONTAINS;
const created = existingRule?.created ?? new Date().toISOString();
+ const pendingAction = isEditing ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD;
// Rule for Onyx optimistic update (includes null values to remove cleared fields)
const ruleForOnyx = {
@@ -134,6 +135,7 @@ function setPolicyCodingRule(policyID: string, form: MerchantRuleForm, policy: P
},
...ruleFieldsForOnyx,
created,
+ pendingAction,
};
// Rule for API (excludes null values)
@@ -149,7 +151,6 @@ function setPolicyCodingRule(policyID: string, form: MerchantRuleForm, policy: P
};
const policyKey = `${ONYXKEYS.COLLECTION.POLICY}${policyID}` as const;
- const pendingAction = isEditing ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD;
// On failure: for new rules, remove the optimistic rule; for edits, restore the original rule
const failureRuleValue = isEditing ? existingRule : null;
@@ -176,6 +177,13 @@ function setPolicyCodingRule(policyID: string, form: MerchantRuleForm, policy: P
onyxMethod: Onyx.METHOD.MERGE,
key: policyKey,
value: {
+ rules: {+ codingRules: {+ [targetRuleID]: {+ pendingAction: null,+ },+ },+ },
pendingFields: {
rules: null,
},
@@ -264,7 +272,7 @@ function deletePolicyCodingRule(policy: Policy, ruleID: string) {
value: {
rules: {
codingRules: {
- [ruleID]: null,+ [ruleID]: existingRule ? {...existingRule, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE} : null,
},
},
pendingFields: {
@@ -278,6 +286,11 @@ function deletePolicyCodingRule(policy: Policy, ruleID: string) {
onyxMethod: Onyx.METHOD.MERGE,
key: policyKey,
value: {
+ rules: {+ codingRules: {+ [ruleID]: null,+ },+ },
pendingFields: {
rules: null,
},
--- a/src/types/onyx/Policy.ts+++ b/src/types/onyx/Policy.ts@@ -1744,6 +1744,9 @@ type CodingRule = {
/** When this rule was created */
created?: string;
++ /** The pending action for offline updates */+ pendingAction?: OnyxCommon.PendingAction;
};
What alternative solutions did you explore? (Optional)
Activity
melvin-bot commentedon Feb 2, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #80853
melvin-bot commentedon Feb 2, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 2, 2026
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.github-actions commentedon Feb 2, 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:
OSBotify commentedon Feb 2, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #80853 - "Remove dev lock from merchant rules" by @luacmartins (High confidence)
Related Issues: #80855
Recommendation: ROLL FORWARD
PR #80853 enabled the merchant rules feature in staging by removing the dev lock. However, it did not implement the offline feedback functionality required for proper offline behavior. The fix is straightforward and should be rolled forward rather than reverted.
Labels: DeployBlocker label should remain, DeployBlockerCash label should remain (App changes needed)
📋 Detailed Analysis
Evidence
The issue reports that merchant rules created/edited/deleted in offline mode do not show the grey-out and strikethrough visual indicators that are standard for offline operations in the app.
PR #80853 changed only 2 lines in
src/pages/workspace/rules/MerchantRulesSection.tsx:isDevelopmenttoisProductionto enable the feature in stagingVerification
I examined the affected file and compared it with other rules sections:
MerchantRulesSection.tsx (lines 127-146):
MenuItemWithTopDescriptioncomponents for each ruleOfflineWithFeedbackwrapper componentpendingActionpropIndividualExpenseRulesSection.tsx (lines 236-248) - Working correctly:
ExpenseReportRulesSection.tsx also uses
OfflineWithFeedbackwrappers withpendingActionprops.Root Cause
The merchant rules feature was developed behind a dev lock and never had offline feedback implemented. When PR #80853 enabled it in staging, the missing offline functionality became visible.
The backend actions (
src/libs/actions/Policy/Rules.ts) properly setpendingActiononpolicy.pendingFields.rulesfor add/update/delete operations (lines 169, 271), but the UI component doesn't consume this data.Fix Required
The fix needs to happen in
MerchantRulesSection.tsx:OfflineWithFeedbackpendingAction(frompolicy?.pendingFields?.rules)This is a simple UI fix that can be implemented quickly without reverting the feature.
marufsharifi commentedon Feb 2, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a merchant rule is created, edited, or deleted while offline, the rule list does not show the usual offline feedback (greyed out for pending changes and strikethrough for pending delete). This is inconsistent with other areas of the app that show offline feedback for pending actions.
What is the root cause of that problem?
Merchant rules do not store a per-rule pendingAction on the rule itself. Instead, the rules logic only sets a policy-level pendingFields.rules flag, and the rules list does not wrap rows with OfflineWithFeedback. Because of this, the list has no per-item signal to apply offline styles or strikethrough when a rule is pending deletion.
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
luacmartins commentedon Feb 2, 2026
NAB feature is not available in prod. The project team will address this.
luacmartins commentedon Feb 2, 2026
I'm working on this
luacmartins commentedon Feb 2, 2026
PR in review
JS00001 commentedon Feb 3, 2026
This is merged, closing it out