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 - Disabled tax rate is not shown in the list when it is selected #100504
Version Number: 9.4.73-0 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:#99420 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 Taxes and Rules.
Go to staging.new.expensify.com
Go to workspace settings > Rules.
Click Add rule > Apply expense defaults.
Click Category.
Select a category and tax rate.
Click Save rule.
Go to workspace settings > Taxes.
Disable the tax rate used in Step 5.
Go to workspace settings > Rules > Expense defaults.
Open the rule created in Step 6.
Click Tax field.
Expected Result:
The disabled tax rate will be shown in the list because it is selected.
Actual Result:
The disabled tax rate is not shown in the list when it is selected.
👋 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: #99420 - "Add category tax defaults to Expense defaults" by @Krishna2323 (Medium confidence — it created the repro's entry point, but it did not author the offending line; see Evidence) Related Issues: none found
Recommendation: ROLL FORWARD
The offending !tax.isDisabled filter pre-dates#99420 (it shipped with the original merchant-rules tax picker), so reverting #99420 would only hide the reported entry point while leaving the identical defect in the merchant-rule tax picker. The fix is a 2-line change in one file, versus reverting a 43-file feature PR that has follow-up commits stacked on it.
Assigned: @Krishna2323 (PR author), @situchan and @JS00001 (approving reviewers) from #99420 — all already auto-assigned, no change needed Labels: No changes. DeployBlockerCash is correctly applied and kept (App-side fix). DeployBlocker was not present, so nothing to remove.
📋 Detailed Analysis
Evidence
The repro path (Rules > Add rule > Apply expense defaults > Category > Tax) is the flow #99420 introduced: it added the RULES_CATEGORY_TAX_EDIT route, the categoryName route param, and EditCategoryTaxRulePage, and reused the existing AddTaxPage as the picker for category tax defaults. That is consistent with "Reproducible in production?: N/A - new feature".
Important nuance for the revert decision: the !tax.isDisabled filter that actually causes this bug was not added by #99420. The PR diff shows it only threading taxKey into the existing predicate to add the separate shouldHideTax (workspace-default) exclusion:
So #99420exposed a latent defect in a new flow rather than writing it. The same bug is reachable through the merchant-rule tax picker, which a revert would not fix.
L45 then resolves the current selection from that already-filtered list: taxItems.find(({value}) => value === form.tax).
Confirmed #99420 modifies this exact file (gh pr view 99420 --json files lists src/pages/workspace/rules/MerchantRules/AddTaxPage.tsx), and #99420 is on the current deploy checklist #100479.
Root Cause
Once the rate is disabled in step 8, it is dropped from taxItems at L39, so the .find() at L45 returns undefined and selectedTaxItem becomes undefined.
That matters because SearchSingleSelectionPicker renders initiallySelectedItem in its own section, independent of items. It is already capable of displaying a selected-but-filtered-out option; it just never receives one here. The rule's saved tax therefore vanishes from the picker entirely.
Established precedent — this is the odd one out of three sibling pickers in the same feature:
AddTagPage.tsx#L39-L44 — exempts the selected tag from the enabled filter: if (tag.name !== formTag && !tag.enabled) { continue; }
AddCategoryPage.tsx#L27 — builds the selected item straight from the form, never from the filtered list
Resolve the selection from the unfiltered rates, mirroring AddCategoryPage. Replace L45:
// A rate can be disabled after the rule was saved. SearchSingleSelectionPicker renders initiallySelectedItem in// its own section, so resolve the selection from the unfiltered rates to keep the rule's current value visible.constselectedTax=form?.tax ? taxes[form.tax] : undefined;constselectedTaxItem=form?.tax&&selectedTax&&!shouldHideTax(form.tax) ? {name: `${selectedTax.name} (${selectedTax.value})`,value: form.tax} : undefined;
No new imports, and taxItems (L38-43) stays untouched so disabled rates remain unselectable for new rules. shouldHideTax is still honoured so the workspace-default rate is not surfaced in a category rule. remainingItemsSection already de-dupes on item.value !== initialSelectedItem?.value, so the row will not render twice.
💡 Suggested AI code review rule
This bug looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for Expensify/App:
Rule:UI-4 Keep the selected option visible even when it is disabled
Condition: Flag when the currently-selected picker option is resolved by .find() over a list that was itself built with a .filter() on isDisabled / .enabled / pendingAction. Resolve the selection from the unfiltered source instead, so a value disabled after it was saved still renders as the current selection.
Search pattern: a selected*Item/selected* assignment of the form <list>.find( where <list> is produced by .filter( whose predicate mentions isDisabled, .enabled, or pendingAction — e.g. rg -U 'const \w+ = Object\.(values|entries)\([\s\S]{0,200}?\.filter\([^)]*(isDisabled|\.enabled|pendingAction)[\s\S]{0,400}?\.find\(' over src/
Three independent call sites already implement this correctly in three different ways, which is the "codebase is riddled with this pattern" signal. The full rule file, with the ❌/✅ code inline in Expensify/App's coding-standards format, would go in Expensify/App itself. If it's worth adding, a maintainer can open it there as a draft PR.
Activity
applause-bot commentedon Sep 7, 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/d8cb8b3f8d2b619cd926e03cdea6457a27909b4bbd22b76b158117491204584e
melvin-bot commentedon Sep 7, 2026
@JS00001 recently merged #99420, but they are OOO right now, so I'll auto-assign someone else.
github-actions commentedon Sep 7, 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:
melvin-bot commentedon Sep 7, 2026
Triggered auto assignment to @Julesssss (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Sep 7, 2026
@JS00001 @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #99420
melvin-bot commentedon Sep 7, 2026
@Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #99420
melvin-bot commentedon Sep 7, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 7, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #99420 - "Add category tax defaults to Expense defaults" by @Krishna2323 (Medium confidence — it created the repro's entry point, but it did not author the offending line; see Evidence)
Related Issues: none found
Recommendation: ROLL FORWARD
The offending
!tax.isDisabledfilter pre-dates #99420 (it shipped with the original merchant-rules tax picker), so reverting #99420 would only hide the reported entry point while leaving the identical defect in the merchant-rule tax picker. The fix is a 2-line change in one file, versus reverting a 43-file feature PR that has follow-up commits stacked on it.Assigned: @Krishna2323 (PR author), @situchan and @JS00001 (approving reviewers) from #99420 — all already auto-assigned, no change needed
Labels: No changes.
DeployBlockerCashis correctly applied and kept (App-side fix).DeployBlockerwas not present, so nothing to remove.📋 Detailed Analysis
Evidence
The repro path (Rules > Add rule > Apply expense defaults > Category > Tax) is the flow #99420 introduced: it added the
RULES_CATEGORY_TAX_EDITroute, thecategoryNameroute param, andEditCategoryTaxRulePage, and reused the existingAddTaxPageas the picker for category tax defaults. That is consistent with "Reproducible in production?: N/A - new feature".Important nuance for the revert decision: the
!tax.isDisabledfilter that actually causes this bug was not added by #99420. The PR diff shows it only threadingtaxKeyinto the existing predicate to add the separateshouldHideTax(workspace-default) exclusion:So #99420 exposed a latent defect in a new flow rather than writing it. The same bug is reachable through the merchant-rule tax picker, which a revert would not fix.
Verification
Affected file —
src/pages/workspace/rules/MerchantRules/AddTaxPage.tsx#L38-L45:taxItems.taxItems.find(({value}) => value === form.tax).Confirmed #99420 modifies this exact file (
gh pr view 99420 --json fileslistssrc/pages/workspace/rules/MerchantRules/AddTaxPage.tsx), and #99420 is on the current deploy checklist #100479.Root Cause
Once the rate is disabled in step 8, it is dropped from
taxItemsat L39, so the.find()at L45 returnsundefinedandselectedTaxItembecomesundefined.That matters because
SearchSingleSelectionPickerrendersinitiallySelectedItemin its own section, independent ofitems. It is already capable of displaying a selected-but-filtered-out option; it just never receives one here. The rule's saved tax therefore vanishes from the picker entirely.Established precedent — this is the odd one out of three sibling pickers in the same feature:
AddTagPage.tsx#L39-L44— exempts the selected tag from the enabled filter:if (tag.name !== formTag && !tag.enabled) { continue; }AddCategoryPage.tsx#L27— builds the selected item straight from the form, never from the filtered listTaxOptionsListUtils.getTaxRatesSection#L83-L104— the IOU/workspace tax picker deliberately re-adds a selected rate as{isDisabled: true, isSelected: true}so it stays visibleSuggested minimal fix
Resolve the selection from the unfiltered rates, mirroring
AddCategoryPage. Replace L45:No new imports, and
taxItems(L38-43) stays untouched so disabled rates remain unselectable for new rules.shouldHideTaxis still honoured so the workspace-default rate is not surfaced in a category rule.remainingItemsSectionalready de-dupes onitem.value !== initialSelectedItem?.value, so the row will not render twice.💡 Suggested AI code review rule
This bug looks like a recurring, mechanically detectable pattern, so it may be worth a coding-standards rule so the AI reviewer catches the next one. Proposed for
Expensify/App:UI-4Keep the selected option visible even when it is disabled.find()over a list that was itself built with a.filter()onisDisabled/.enabled/pendingAction. Resolve the selection from the unfiltered source instead, so a value disabled after it was saved still renders as the current selection.selected*Item/selected*assignment of the form<list>.find(where<list>is produced by.filter(whose predicate mentionsisDisabled,.enabled, orpendingAction— e.g.rg -U 'const \w+ = Object\.(values|entries)\([\s\S]{0,200}?\.filter\([^)]*(isDisabled|\.enabled|pendingAction)[\s\S]{0,400}?\.find\('oversrc/AddTaxPage.tsx#L38-L45AddTagPage.tsx#L39-L44,AddCategoryPage.tsx#L27, andTaxOptionsListUtils.ts#L83-L104Three independent call sites already implement this correctly in three different ways, which is the "codebase is riddled with this pattern" signal. The full rule file, with the ❌/✅ code inline in
Expensify/App's coding-standards format, would go inExpensify/Appitself. If it's worth adding, a maintainer can open it there as a draft PR.Julesssss commentedon Sep 7, 2026
Not a blocker, demoting. Authors are assigned.
situchan commentedon Sep 7, 2026
yup not blocker. The feature is behind beta.
fix: agree on how a category tax rule's rate is displayed