Fix stale expense report totals after offline mixed-currency moves#89564
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@sobitneupane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1229798aef
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
trjExpensify
left a comment
There was a problem hiding this comment.
It makes sense, but shouldn't we also be kicking that$0 processing report back to open when it's empty? CC: @luacmartins
|
@trjExpensify it doesn't seem like we do that in OD, so that'd be inconsistent here. Up to changing that if you think we should, just noting the different behavior. |
|
I think Classic does something weird like hide $0 processing reports from view for some viewers, which is just masking the problem. So I think we should reopen in this case 👍 |
|
Hi @sobitneupane, I checked the synced Search response, and it looks like reopening the old empty expense report will require a backend change as well. While offline, the frontend can optimistically show the emptied source report as I attached the screenshot below for reference. So if we want the old report to remain reopened after sync, I think backend support will be needed.
|
|
@sobitneupane, friendly bump. thanks. |
|
I agree with @nabi-ebrahimi's analysis. It seems this will require backend changes as well. @trjExpensify Should we involve someone from backend team to handle this on the backend. |
|
@trjExpensify, could you please check this comment, when you get a chance. thanks. |
Yeah, and that should come first probably. @luacmartins is in this thread, what do you think Carlos? |
|
@trjExpensify what problem is solving putting the report back in open state exactly? I think we should leave it processing. |
|
I agree with Tom that those are real problems and not a great customer experience. I don't feel strongly on which solution we go with, but I do think we have to do something. |
|
Hmmm I see, if we go down that route, why would we even keep the report at all? Wouldn't it be better to delete it? Or do we want to keep it to conserve the conversation/history there? |
|
Yeah, convo/history and the employee might want to add different expenses to it. I don't think it matters, once it's a draft again - it's on them to do with it what they need to next. |
|
@sobitneupane, What's next here? Thanks. |
|
@sobitneupane, gentle bump. thanks. |
|
@nabi-ebrahimi If we decide to reopen the emptied report, we will likely need support from backend team. Let's wait for the decision before proceeding. |
|
I think we decided on that, yes. |
|
Sorry for the delay, submitted backend PR here https://github.com/Expensify/Auth/pull/21888
|


Explanation of Change
These changes improve how report totals behave when expenses are moved out of a report.
Previously, if the last expense was moved from a report, the old report could keep showing stale or incorrect totals, especially when currency handling was involved. Now, when all expenses are moved out, the old report total, non-reimbursable total, and unheld non-reimbursable total are reset to
0.Fixed Issues
$ #75091
PROPOSAL: #75091 (Comment)
Tests
Flow 1
Flow 2
Flow 3
Offline tests
Same as test.
QA Steps
Same as test.
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-05-05.at.7.34.14.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-05-05.at.7.31.05.PM.mp4
iOS: Native
Screen.Recording.2026-05-05.at.7.00.34.PM.mp4
iOS: mWeb Safari
Screen.Recording.2026-05-05.at.7.04.48.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-05.at.6.09.58.PM.mov