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
Spend - Report amount is not converted after changing default currency when merging reports #100599
Version Number: 9.4.73-3 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:#95658 Email or phone of affected tester (no customers):applausetester+sddd1jsods32@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.
Go to staging.new.expensify.com
Create a workspace.
Go to workspace chat and create an expense.
Go to workspace settings > Overview > Default currency.
Change the default currency to USD.
Go to workspace chat and create a new report with an expense.
Go to Spend > Reports.
Bulk select both reports.
Click dropdown button > Merge reports.
Expected Result:
The report amount from Step 3 (before currency change) will be converted to the correct amount.
Actual Result:
The report amount from Step 3 (before currency change) is not converted to the correct amount.
It shows the new currency with old amount.
👋 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 (new display surface) — but the incorrect number originates in backend report data, not in App conversion logic. See "Root Cause" for the honest split. Causing PR: #95658 - "feat: implement Merge Reports RHP and action menu" by @dmkt9 (Medium confidence) Related Issues: #98985, #98444 (same Onyx-vs-snapshot resolution class in other Search bulk actions), fixed by #99047 / #98760
Recommendation: DEMOTE
The affected flow is fully gated behind the reportMerge beta as of #100523 (CP'd to staging on 2026-09-07, before this was filed), so no production user can reach it, and the feature does not exist in production at all. Nothing in #95658 computes or converts amounts — the merge RHP renders the same pre-existing report-amount helper the Reports list already uses — so a revert would remove a beta feature without fixing whatever produced "new currency + old amount".
Assigned: @dmkt9 (PR author), @Gonals and @situchan (approving reviewers) from #95658 — already assigned by Melvin, left unchanged. Labels: No changes. DeployBlockerCash is kept (an App PR introduced the surface, and the issue is not reproducible in production, so removal is not warranted). DeployBlocker was never applied, so there is nothing to remove.
⚠️ One check flips this recommendation
Before merging on this, someone with the staging repro should answer a single question:
On Spend > Reports (the list itself, and the report page header), does that same pre-currency-change report already show the new currency with the old amount — before opening the Merge reports RHP?
Yes, it's wrong there too → this is not a feat: implement Merge Reports RHP and action menu #95658 regression at all. It is either pre-existing workspace-default-currency semantics or a backend report-total recomputation issue, and no App change should be made. Close as not-a-blocker and file it against the backend.
No, the list shows the correctly converted amount and only the RHP is wrong → it is the Onyx-vs-snapshot divergence described below, and the fix is the ~3-line targeted change in SearchReportsMergeReports.tsx (ROLL FORWARD, do not revert).
App never re-derives a report's currency or total when the workspace default currency changes.updateGeneralSettings writes only to the policy_ key — outputCurrency, name, and the distance-rate currencies. No report_ key is touched. So a report record that carries the new currency alongside the pre-change total can only have arrived from server data.
Reproducible on staging only; N/A on production because the feature isn't there.
Verification
Files that produce the amount shown in the RHP row, and who owns them:
useHydrateReportsFromSnapshot does not close that gap, because it continues on any key already in Onyx (L52-L54). In this repro both reports were just created in-session, so they are in Onyx and the snapshot value never wins.
For completeness, the post-merge total path is safe and pre-existing: when a moved transaction's currency doesn't match the destination report, Transaction.ts#L1457-L1494 calls markReportTotalAsStale and defers to the server rather than summing across currencies. So the merge action itself does not fabricate a bad total.
Root Cause
Two candidates, and I want to be explicit that I could not separate them without a live repro:
(a) Pre-existing workspace-currency semantics / backend report totals — the more likely one. The displayed value is just report.currency + report.total (via reimbursableTotal + nonReimbursableTotal), rendered as-is. App has no code that converts a report total when the policy outputCurrency changes, so a record holding the new currency with the pre-change amount must have come from server data. Note also that getReimbursableTotalprefersreport.reimbursableTotal over the stored total column: if a currency-change recomputes total but leaves the older reimbursableTotal untouched, the App will faithfully display the stale field next to the fresh currency — which is exactly the reported symptom. Whether that is a backend bug or intended behavior (existing transactions keep their original currency and amount; only the report's currency label follows the policy) is a backend question. If this is the cause, the fix is not in Expensify/App and no App code change should be proposed. I have no access to the backend repos, so I could not confirm it.
(b) Merge-reports display divergence — real, but unconfirmed as the cause of this symptom. Because the RHP reads Onyx-first while the list the user just looked at reads the snapshot, the RHP can show a stale or mixed report record that disagrees with the Reports list. This is a legitimate defect in #95658 regardless of this ticket, and worth fixing on its own merits.
Targeted fix for (b), if the check above shows the list is right and only the RHP is wrong — replace the Onyx-only lookup at SearchReportsMergeReports.tsx#L113 with the existing snapshot-first helper:
That is a ~3-line change with an established precedent (#99047), which is why ROLL FORWARD would beat REVERT if it comes to that. It also makes useHydrateReportsFromSnapshot redundant for this page's display path.
💡 Suggested AI code review rule
This bug class has now come up three times in the Search bulk-action area (#98444 → #98760, #98985 → #99047, and now this page), so it looks like a recurring, mechanically detectable pattern worth a coding-standards rule. Proposed for Expensify/App:
Rule:CONSISTENCY-18 Resolve Search-scoped reports and report actions snapshot-first
Condition: In Search-scoped code (src/pages/Search/**, src/hooks/useSearchBulkActions.ts, Search components and their actions), never index the Onyx report_ / reportActions_ collections directly to resolve a report the user selected in search results. Use getReportFromSearchSnapshot / getReportActionsFromSearchSnapshot so the values match the snapshot the user was actually looking at. The report_ collection is populated only for reports the user has already opened, and it can also hold a staler or partially-updated copy than the snapshot.
Search pattern:allReports\?\.\[\${ONYXKEYS.COLLECTION.REPORT}(and theREPORT_ACTIONSequivalent) in files undersrc/pages/Search/, src/components/Search/, or src/hooks/useSearchBulkActions.ts, with no getReportFromSearchSnapshot` in the same file.
The full rule file, with the ❌/✅ code inline in App's coding-standards format, would go in Expensify/App itself (.claude/skills/coding-standards/rules/consistency-18-*.md plus a SKILL.md index bullet). If it's worth adding, a maintainer can open it there as a draft PR.
This issue has not been updated in over 15 days. @Gonals, @situchan, @dmkt9 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.7-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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 Sep 8, 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/08ea42dea99d92eb4f47cb4a5ecab0017a4439f6511f519431dc138a0e9b202f
melvin-bot commentedon Sep 8, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #95658
github-actions commentedon Sep 8, 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 8, 2026
@Gonals @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #95658
melvin-bot commentedon Sep 8, 2026
@dmkt9 you have been assigned to this deploy blocker because you authored the offending PR: #95658
melvin-bot commentedon Sep 8, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 8, 2026
🔍 Investigation Summary
Classification: Frontend bug (new display surface) — but the incorrect number originates in backend report data, not in App conversion logic. See "Root Cause" for the honest split.
Causing PR: #95658 - "feat: implement Merge Reports RHP and action menu" by @dmkt9 (Medium confidence)
Related Issues: #98985, #98444 (same Onyx-vs-snapshot resolution class in other Search bulk actions), fixed by #99047 / #98760
Recommendation: DEMOTE
The affected flow is fully gated behind the
reportMergebeta as of #100523 (CP'd to staging on 2026-09-07, before this was filed), so no production user can reach it, and the feature does not exist in production at all. Nothing in #95658 computes or converts amounts — the merge RHP renders the same pre-existing report-amount helper the Reports list already uses — so a revert would remove a beta feature without fixing whatever produced "new currency + old amount".Assigned: @dmkt9 (PR author), @Gonals and @situchan (approving reviewers) from #95658 — already assigned by Melvin, left unchanged.
Labels: No changes.
DeployBlockerCashis kept (an App PR introduced the surface, and the issue is not reproducible in production, so removal is not warranted).DeployBlockerwas never applied, so there is nothing to remove.Before merging on this, someone with the staging repro should answer a single question:
SearchReportsMergeReports.tsx(ROLL FORWARD, do not revert).📋 Detailed Analysis
Evidence
ExpenseReportListItemRowNarrow.tsxgainedstyles.cursorPointerand nothing else. The amount itself comes fromgetExpenseReportRowDisplayValues.ts#L27, which predates it (July 2026, Use freshly computed report totals from backend instead of potentially stale stored total #91798 / Use freshly computed report totals from backend instead of potentially stale stored total #89047 era) and is shared verbatim with the existing Reports list.updateGeneralSettingswrites only to thepolicy_key —outputCurrency,name, and the distance-rate currencies. Noreport_key is touched. So a report record that carries the new currency alongside the pre-change total can only have arrived from server data.Verification
Files that produce the amount shown in the RHP row, and who owns them:
src/pages/Search/SearchReportsMergeReports.tsx#L111-L132src/hooks/useHydrateReportsFromSnapshot.ts#L52-L54getExpenseReportRowDisplayValues.ts#L27convertToDisplayString(totalDisplaySpend, currency)ReportUtils.ts#L4805-L4844getMoneyRequestSpendBreakdown— sums stored report totals, no conversionReportUtils.ts#L4779-L4784getReimbursableTotal— prefersreport.reimbursableTotal, falls back tototal - nonReimbursableTotalThe one genuine App-side defect #95658 did introduce is a data-source divergence, not bad math:
SearchUIUtils.ts#L3216(const reportItem = {...data[key]}) feeding#L3276.report_collection instead:SearchReportsMergeReports.tsx#L113.useHydrateReportsFromSnapshotdoes not close that gap, because itcontinues on any key already in Onyx (L52-L54). In this repro both reports were just created in-session, so they are in Onyx and the snapshot value never wins.getReportFromSearchSnapshot: "Prefer the search snapshot so payment targets match what the user selected on the search page." Every other Search bulk action was migrated to it in Do not block Search page payments on a missing chat report #98760 and Resolve reports snapshot-first in Search bulk Delete and Reject #99047 precisely because Onyx-only reads "degraded silently for reports visible in search results".For completeness, the post-merge total path is safe and pre-existing: when a moved transaction's currency doesn't match the destination report,
Transaction.ts#L1457-L1494callsmarkReportTotalAsStaleand defers to the server rather than summing across currencies. So the merge action itself does not fabricate a bad total.Root Cause
Two candidates, and I want to be explicit that I could not separate them without a live repro:
(a) Pre-existing workspace-currency semantics / backend report totals — the more likely one. The displayed value is just
report.currency+report.total(viareimbursableTotal + nonReimbursableTotal), rendered as-is. App has no code that converts a report total when the policyoutputCurrencychanges, so a record holding the new currency with the pre-change amount must have come from server data. Note also thatgetReimbursableTotalprefersreport.reimbursableTotalover the storedtotalcolumn: if a currency-change recomputestotalbut leaves the olderreimbursableTotaluntouched, the App will faithfully display the stale field next to the fresh currency — which is exactly the reported symptom. Whether that is a backend bug or intended behavior (existing transactions keep their original currency and amount; only the report's currency label follows the policy) is a backend question. If this is the cause, the fix is not inExpensify/Appand no App code change should be proposed. I have no access to the backend repos, so I could not confirm it.(b) Merge-reports display divergence — real, but unconfirmed as the cause of this symptom. Because the RHP reads Onyx-first while the list the user just looked at reads the snapshot, the RHP can show a stale or mixed report record that disagrees with the Reports list. This is a legitimate defect in #95658 regardless of this ticket, and worth fixing on its own merits.
Targeted fix for (b), if the check above shows the list is right and only the RHP is wrong — replace the Onyx-only lookup at
SearchReportsMergeReports.tsx#L113with the existing snapshot-first helper:That is a ~3-line change with an established precedent (#99047), which is why ROLL FORWARD would beat REVERT if it comes to that. It also makes
useHydrateReportsFromSnapshotredundant for this page's display path.💡 Suggested AI code review rule
This bug class has now come up three times in the Search bulk-action area (#98444 → #98760, #98985 → #99047, and now this page), so it looks like a recurring, mechanically detectable pattern worth a coding-standards rule. Proposed for
Expensify/App:CONSISTENCY-18Resolve Search-scoped reports and report actions snapshot-firstsrc/pages/Search/**,src/hooks/useSearchBulkActions.ts, Search components and their actions), never index the Onyxreport_/reportActions_collections directly to resolve a report the user selected in search results. UsegetReportFromSearchSnapshot/getReportActionsFromSearchSnapshotso the values match the snapshot the user was actually looking at. Thereport_collection is populated only for reports the user has already opened, and it can also hold a staler or partially-updated copy than the snapshot.allReports\?\.\[\${ONYXKEYS.COLLECTION.REPORT}(and theREPORT_ACTIONSequivalent) in files undersrc/pages/Search/,src/components/Search/, orsrc/hooks/useSearchBulkActions.ts, with nogetReportFromSearchSnapshot` in the same file.SearchReportsMergeReports.tsx#L111-L132getReportFromSearchSnapshot, applied as in #99047The full rule file, with the ❌/✅ code inline in App's coding-standards format, would go in
Expensify/Appitself (.claude/skills/coding-standards/rules/consistency-18-*.mdplus aSKILL.mdindex bullet). If it's worth adding, a maintainer can open it there as a draft PR.9 remaining items
melvin-bot commentedon Oct 7, 2026
This issue has not been updated in over 15 days. @Gonals, @situchan, @dmkt9 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
melvin-bot commentedon Oct 12, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon Oct 13, 2026
@situchan / @dmkt9
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.7-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
Gonals commentedon Oct 15, 2026
Should be done. Closing