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 2025-11-04] [$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00" #72743
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Tap on the dropdown menu and select "Move Expenses"
Tap on "Create Report"
Once the expenses were moved, return to chat.
Note that total amount on preview of new created report, shows "0,00"
Open the report.
Note that total amount, also shows "0,00" inside report.
Return to chat and turn on internet connection again.
Note that total amount is now updated.
Expected Result:
When moving more than one expense to a new report while offline, total amount field displayed on new report preview, should display the correct expenses amount.
Actual Result:
When moving more than one expense to a new report while in offline mode, preview of new report shows "0,00" as total amount. When opening report, total amount inside report is also "0,00".
Total amount fields update after recovering internet connection.
Please re-state the problem that we are trying to solve in this issue.
Moving multiple expenses into a brand-new report while offline shows the new report total as 0.00 on the chat preview and inside the report itself. The total only updates after the device reconnects, which confuses the user about whether the move succeeded.
What is the root cause of that problem?
The optimistic move logic only subtracts amounts from the newReport object that exists in Onyx. When the report is freshly created offline, that entry is not yet stored, so we subtract from undefined, end up with zero totals, and pass the wrong report data into the next-step builder. The implementation can be seen in changeTransactionsReport, where totals for the destination report were read exclusively from newReport:
What changes do you think we should make in order to solve the problem?
When we update optimistic totals, resolve the destination report from any available source (existing Onyx data, the optimistic newReport, or the freshly created self-DM) and reuse whatever current totals are present before subtracting the moved amounts.
Build the next-step payload from that same resolved report object so we keep totals and metadata consistent.
Updated logic for computing report totals and next-step data:
Please re-state the problem that we are trying to solve in this issue.
When moving more than one expense to a new report while in offline mode, preview of new report shows "0,00" as total amount. When opening report, total amount inside report is also "0,00".
Total amount fields update after recovering internet connection.
What is the root cause of that problem?
We are not update the UI if options of list are equal based on shallowOptionsListCompare
What changes do you think we should make in order to solve the problem?
We should add logic to compare text or amount values as well here
What alternative solutions did you explore? (Optional)
We can use deep compare
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
When moving more than one expense to a new report while in offline mode, preview of new report shows "0,00" as total amount. When opening report, total amount inside report is also "0,00".
Total amount fields update after recovering internet connection.
What is the root cause of that problem?
Select Create report option will create an optimistic report
Optional: To avoid two APIs are called in this case, we can move the logic create new report to changeTransactionsReport as optimistic data and we need to define new parameter for this API to create new expense report, new report preview action, ...
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
@cristipaval@luacmartins I'd appreciate your eyes on this. I tried to compare with the Create report flow and the report total in the preview is accurately updated optimistically.
changed the title [-]Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/-][+][$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/+]on Oct 20, 2025
changed the title [-][$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/-][+][Due for payment 2025-11-04] [$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/+]on Oct 28, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.39-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ikevin127@trjExpensify The PR fixing this issue has been merged! 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]
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A - Mistake during implementation
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Prerequisite: Account has at least one workspace.
Open the Expensify app.
Open any workspace chat.
Create at least two manual expenses.
Turn off internet connection.
Open the report of the just created expenses.
Long tap and select all the expenses.
Tap on the dropdown menu and select "Move Expenses".
Tap on "Create Report".
Once the expenses were moved, return to chat.
Note that total amount on preview of new created report shows the correct amount.
Open the report.
Verify that the total amount, also shows shows the correct amount inside the report.
Return to chat and turn the internet connection back on.
Verify that the total amount remains the same as when offline.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Activity
melvin-bot commentedon Oct 16, 2025
Triggered auto assignment to @trjExpensify (
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.ShridharGoel commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Moving multiple expenses into a brand-new report while offline shows the new report total as 0.00 on the chat preview and inside the report itself. The total only updates after the device reconnects, which confuses the user about whether the move succeeded.
What is the root cause of that problem?
The optimistic move logic only subtracts amounts from the
newReportobject that exists in Onyx. When the report is freshly created offline, that entry is not yet stored, so we subtract fromundefined, end up with zero totals, and pass the wrong report data into the next-step builder. The implementation can be seen in changeTransactionsReport, where totals for the destination report were read exclusively fromnewReport:App/src/libs/actions/Transaction.ts
Lines 895 to 903 in f8e2af1
and
nextStepReportwas constructed from the same incomplete source:App/src/libs/actions/Transaction.ts
Lines 1193 to 1209 in f8e2af1
What changes do you think we should make in order to solve the problem?
newReport, or the freshly created self-DM) and reuse whatever current totals are present before subtracting the moved amounts.Updated logic for computing report totals and next-step data:
mkzie2 commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When moving more than one expense to a new report while in offline mode, preview of new report shows "0,00" as total amount. When opening report, total amount inside report is also "0,00".
Total amount fields update after recovering internet connection.
What is the root cause of that problem?
We are not update the UI if options of list are equal based on
shallowOptionsListCompareApp/src/components/OptionListContextProvider.tsx
Lines 283 to 287 in 5a54e9e
However, in
shallowOptionsListCompare, we only comparelength,reportId, andloginApp/src/libs/OptionsListUtils/index.ts
Lines 2557 to 2569 in 07e4bc5
What changes do you think we should make in order to solve the problem?
We should add logic to compare
textoramountvalues as well hereWhat alternative solutions did you explore? (Optional)
We can use deep compare
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
paulnjs commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When moving more than one expense to a new report while in offline mode, preview of new report shows "0,00" as total amount. When opening report, total amount inside report is also "0,00".
Total amount fields update after recovering internet connection.
What is the root cause of that problem?
Select
Create reportoption will create an optimistic reportApp/src/pages/iou/request/step/IOURequestEditReport.tsx
Line 92 in 825fb54
App/src/pages/iou/request/step/IOURequestEditReport.tsx
Line 53 in 825fb54
But it's not updated with the value from
Onyx.connecthere at the time we callchangeTransactionsReportApp/src/libs/actions/Transaction.ts
Line 653 in 825fb54
Which causes the total isn't updated here because
newReportisundefinedApp/src/libs/actions/Transaction.ts
Lines 886 to 899 in 825fb54
What changes do you think we should make in order to solve the problem?
We should pass
newReporttochangeTransactionsReportfunction hereoptimisticReportvalue increateNewReportApp/src/libs/actions/Report.ts
Line 2926 in 825fb54
App/src/libs/actions/Report.ts
Line 2969 in 825fb54
selectReportand pass the optimistic report tochangeTransactionsReportApp/src/pages/iou/request/step/IOURequestEditReport.tsx
Line 53 in 825fb54
Optional: To avoid two APIs are called in this case, we can move the logic create new report to
changeTransactionsReportas optimistic data and we need to define new parameter for this API to create new expense report, new report preview action, ...What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
trjExpensify commentedon Oct 20, 2025
@cristipaval @luacmartins I'd appreciate your eyes on this. I tried to compare with the
Create reportflow and the report total in the preview is accurately updated optimistically.2025-10-20_12-04-09.mp4
luacmartins commentedon Oct 20, 2025
Seems like an edge case when merging the optimistic update. I think we already have a few proposals that hint on the RCA. Gonna make this external.
[-]Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/-][+][$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/+]melvin-bot commentedon Oct 20, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021980306924002190932
16 remaining items
[-][$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/-][+][Due for payment 2025-11-04] [$250] Report - When moving several expenses to new report offline, amount on preview shows "0,00"[/+]melvin-bot commentedon Oct 28, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 28, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.39-3 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 2025-11-04. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 28, 2025
@ikevin127 @trjExpensify The PR fixing this issue has been merged! 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]
ikevin127 commentedon Nov 4, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A - Mistake during implementation
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Prerequisite: Account has at least one workspace.
Do we agree 👍 or 👎.
trjExpensify commentedon Nov 4, 2025
Thanks!
Payment summary as follows:
Both of you can go ahead and request. Closing!
garrettmknight commentedon Nov 7, 2025
$250 approved for @ikevin127
garrettmknight commentedon Nov 11, 2025
$250 approved for @ShridharGoel