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
[Due for payment 2026-08-21] Spend - Canadian multiple tax export is not shown if an expense was previously deleted. #98523
Version Number: 9.4.53-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:#97853 Email or phone of affected tester (no customers):ibellicotest+2766@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Money Requests
Action Performed:
Prerequisite: Account has at least one workspace with "CAD" as currency.
Open the staging.new.expensify.com website.
Navigate to workspace chat.
Create a manual expense with "CAD" as currency.
Navigate to "Spend" > "Expenses"
Select the just created expense > Click on dropdown menu > "Export"
Note that "Canadian multiple tax export" option is visible.
Select and delete the expense.
Navigate to workspace chat again.
Create a new manual expense.
Return to "Spend" > "Expenses"
Select the just created expense > dropdown menu > "Export"
Note that "Canadian multiple tax export" option is not visible.
Expected Result:
"Canadian multiple tax export" option should be visible for every expense displayed on a workspace with "CAD" as default currency.
Actual Result:
"Canadian multiple tax export" option is not visible on "Spend" for expenses that were created after deleting a previous one.
👋 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 (fix required in Expensify/App) Causing PR: #97853 - "Add Canadian Multiple Tax Export template to New Expensify for workspaces using CAD" by @dukenv0307 (High confidence) Related Issues: #97231 (the feature request this PR implements)
Recommendation: ROLL FORWARD
The Melvin auto-assignment is correct — this PR introduced both the feature and the buggy visibility gate, so no other staging PR is involved. I recommend a targeted fix rather than a revert: the option is a brand-new, staging-only, repeatedly-requested feature, the export itself still works via other entry points, and the defect is a small, localized logic error in one useMemo. Reverting would pull a wanted feature (and its interwoven SearchQueryUtils/AccountingUtils changes) for a narrow, non-prod edge case.
Assigned: @dukenv0307 (PR author), @NikkiWines, @thelullabyy, @trjExpensify (approving reviewers) — already assigned by Melvin. Labels: No changes. This is a Frontend bug with an App PR involved, so DeployBlockerCash must stay. DeployBlocker is not present. Issue is not reproducible on production (new feature), so removal is not warranted regardless.
doAllSelectedItemsBelongToCADPolicies has two branches:
Branch A (areAllMatchingItemsSelected === true, lines 579-586) derives CAD-eligibility only from an explicit policyID filter in the query:
constpolicyIDFilter=getFilterFromQuery(queryJSON,CONST.SEARCH.SYNTAX_FILTER_KEYS.POLICY_ID);if(!policyIDFilter.value?.length||policyIDFilter.isNegated){returnfalse;// <-- hides the option whenever no policyID filter is present}
The default "Spend > Expenses" view carries no policyID filter, so this branch returns false and the option is hidden — even though every selected item is CAD.
Branch B (areAllMatchingItemsSelected === false, lines 588-593) inspects the actual selected items'policyID (SelectedTransactionInfo.policyID / SelectedReports.policyID, both defined in src/components/Search/types.ts) and correctly returns true for a CAD workspace.
Why the delete → recreate sequence flips it: the two runs perform the identical action (select one CAD expense), so the only variable is the persisted selection state. The delete step leaves the selection context in the areAllMatchingItemsSelected = true state, and that flag survives a subsequent single-item selection — when the new selection covers every selectable item, SearchSelectionProvider.tsx#L96-L97preserves the previous areAllMatchingItemsSelected rather than resetting it:
So in the first run the flag is false → Branch B → option shown; after the delete the flag is stuck true → the new expense evaluates through Branch A → no policyID filter → return false → option hidden. The symptom is therefore a stale select-all flag routing evaluation through the fragile filter-only branch.
Suggested fix (targeted, low risk)
Make Branch A resilient to a missing policyID filter instead of returning false. Options:
When areAllMatchingItemsSelected is true but there is no policyID filter, fall back to evaluating the actual materialized selection (selectedReports + selectedTransactions, minus excludedTransactions) the same way Branch B does; or
Derive the candidate policies from the current search results' items rather than assuming a policyID filter is always present.
Either keeps the multi-workspace safety (only show when every item is CAD) while fixing the default-view case. A unit test covering "all-matching selected with no policyID filter, all items CAD" should be added.
changed the title [-]Spend - Canadian multiple tax export is not shown if an expense was previously deleted.[/-][+][Due for payment 2026-08-21] Spend - Canadian multiple tax export is not shown if an expense was previously deleted.[/+]on Aug 14, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.53-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-21. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Aug 13, 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/a6811177bad365b6f2612ddbd5a421fd37fc66cceb0aa5e3706e4873377147e4
melvin-bot commentedon Aug 13, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #97853
melvin-bot commentedon Aug 13, 2026
@trjExpensify @NikkiWines @thelullabyy you have been assigned to this deploy blocker because you reviewed the offending PR: #97853
melvin-bot commentedon Aug 13, 2026
@dukenv0307 you have been assigned to this deploy blocker because you authored the offending PR: #97853
melvin-bot commentedon Aug 13, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Aug 13, 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 Aug 13, 2026
🔍 Investigation Summary
Classification: Frontend bug (fix required in
Expensify/App)Causing PR: #97853 - "Add Canadian Multiple Tax Export template to New Expensify for workspaces using CAD" by @dukenv0307 (High confidence)
Related Issues: #97231 (the feature request this PR implements)
Recommendation: ROLL FORWARD
The Melvin auto-assignment is correct — this PR introduced both the feature and the buggy visibility gate, so no other staging PR is involved. I recommend a targeted fix rather than a revert: the option is a brand-new, staging-only, repeatedly-requested feature, the export itself still works via other entry points, and the defect is a small, localized logic error in one
useMemo. Reverting would pull a wanted feature (and its interwovenSearchQueryUtils/AccountingUtilschanges) for a narrow, non-prod edge case.Assigned: @dukenv0307 (PR author), @NikkiWines, @thelullabyy, @trjExpensify (approving reviewers) — already assigned by Melvin.
Labels: No changes. This is a Frontend bug with an App PR involved, so
DeployBlockerCashmust stay.DeployBlockeris not present. Issue is not reproducible on production (new feature), so removal is not warranted regardless.📋 Detailed Analysis
Evidence
CONST.REPORT.EXPORT_OPTIONS.MULTIPLE_TAX_EXPORT, theexport.multipleTaxExportcopy, and the visibility gating. Bug is9.4.53-0, reproducible in staging, N/A in prod, matching this PR's ship.Verification
Gating chain (all added/modified by #97853):
doAllSelectedItemsBelongToCADPolicies—src/hooks/useSearchBulkActions.ts#L578-L594includeMultipleTaxExportintogetExportTemplates—src/hooks/useSearchBulkActions.ts#L1705-L1714src/libs/actions/Search.ts#L1818-L1820Root Cause
doAllSelectedItemsBelongToCADPolicieshas two branches:Branch A (
areAllMatchingItemsSelected === true, lines 579-586) derives CAD-eligibility only from an explicitpolicyIDfilter in the query:The default "Spend > Expenses" view carries no
policyIDfilter, so this branch returnsfalseand the option is hidden — even though every selected item is CAD.Branch B (
areAllMatchingItemsSelected === false, lines 588-593) inspects the actual selected items'policyID(SelectedTransactionInfo.policyID/SelectedReports.policyID, both defined insrc/components/Search/types.ts) and correctly returnstruefor a CAD workspace.Why the delete → recreate sequence flips it: the two runs perform the identical action (select one CAD expense), so the only variable is the persisted selection state. The delete step leaves the selection context in the
areAllMatchingItemsSelected = truestate, and that flag survives a subsequent single-item selection — when the new selection covers every selectable item,SearchSelectionProvider.tsx#L96-L97preserves the previousareAllMatchingItemsSelectedrather than resetting it:So in the first run the flag is
false→ Branch B → option shown; after the delete the flag is stucktrue→ the new expense evaluates through Branch A → nopolicyIDfilter →return false→ option hidden. The symptom is therefore a stale select-all flag routing evaluation through the fragile filter-only branch.Suggested fix (targeted, low risk)
Make Branch A resilient to a missing
policyIDfilter instead of returningfalse. Options:areAllMatchingItemsSelectedis true but there is nopolicyIDfilter, fall back to evaluating the actual materialized selection (selectedReports+selectedTransactions, minusexcludedTransactions) the same way Branch B does; orpolicyIDfilter is always present.Either keeps the multi-workspace safety (only show when every item is CAD) while fixing the default-view case. A unit test covering "all-matching selected with no
policyIDfilter, all items CAD" should be added.m-natarajan commentedon Aug 13, 2026
Passed, Chrome / v9.4.53-6 (Android build N/A)
bandicam.2026-08-13.23-56-18-808.mp4
NikkiWines commentedon Aug 13, 2026
Great, thank you!
[-]Spend - Canadian multiple tax export is not shown if an expense was previously deleted.[/-][+][Due for payment 2026-08-21] Spend - Canadian multiple tax export is not shown if an expense was previously deleted.[/+]melvin-bot commentedon Aug 14, 2026
@thelullabyy
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.53-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-21. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]