Repository navigation
Conversation
…nstead of dropping it
…he backend report by its expenses
…ies, not only from its actions
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.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5ab214e55
ℹ️ 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".
|
@yusufdeveloper2903wWe have some comments from Melvin here; could you please take a look at them? Do you think these additional findings make sense?
Thanks a lot. |
…mistic-scan-failed-move
|
Thanks @brunovjk, these were good finds. Two of them were real and I fixed them. 1. The other order is worse, and it's the one that got #97084 reverted: if we removed the optimistic report first and moved the routes after, the user would be sitting on a report that no longer exists. 2. Moved transactions keeping the optimistic 3. I also fixed the Codex P1 (the chat's Added tests for all of it. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c52169f58f
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a75e9d3b1
ℹ️ 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".
| if (!full || shouldMoveScanFailedTransactions) { | ||
| const holdReportOnyxData = getReportFromHoldRequestsOnyxData({ |
There was a problem hiding this comment.
Wait for expense actions before creating the split
When the transaction collection is populated but this report's actions have not been loaded or were evicted, shouldMoveScanFailedTransactions is true, yet getHoldReportActionsAndTransactions() finds no actions and therefore no transactions. This branch still creates an optimistic report, points the workspace chat at it, and sends empty optimisticHoldReportExpenseActionIDs, leaving an offline user with an empty report while the scan-failed expense remains on the paid report. Only create the optimistic split when all moved transactions can be paired with their actions, or build the split from the known transactions. CLAUDE.mdL82-L86
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
What do you think of this comment, @yusufdeveloper2903? Thanks.
|
@brunovjk I don't think we should act on this one. The condition is new, but the behaviour isn't — |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62cdc50042
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@brunovjk conflicts are resolved and main is merged ready for review |
|
@yusufdeveloper2903 You've got failing Jest tests that appear to be unrelated. Can you pull |
…mistic-scan-failed-move
|
Hi @deetergp merged main in and the test failure is gone. Ready for review |
|
@deetergp Just merged |
|
Hi @deetergp 👋 — friendly bump on this one. |
…mistic-scan-failed-move
|
🚧 deetergp has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/deetergp in version: 9.4.73-0 🚀
|
|
🤖 Docs impact review: no help site changes required. I did not create a draft PR. Why: this PR is an internal state-reconciliation fix, not a behavior or copy change. It re-lands the optimistic move of scan-failed expenses off a report at payment time, and adds middleware that repoints routes from the optimistic report to the backend's real report so users no longer land on the "Hmm... it's not here" page after reconnecting. The user-facing outcome after this fix is the already expected behavior described in both linked issues (Expensify/App#96257, Expensify/App#98821) — the scan-failed expense moves to a new report, and that report keeps working. Before the fix, users saw a bug. Help articles document expected behavior, so there is nothing to update. What I checkedPR contents — all 13 changed files are middleware, IOU actions,
No Docs I reviewed for possible impact:
One adjacent gap, out of scope for this PR: the help site does not document the underlying behavior anywhere — that paying a report moves any scan-failed expense onto a new report so the rest can be paid. That behavior shipped earlier in #95682, not here, so I left it alone rather than widening this review. Say the word and I'll open a draft PR adding a short FAQ entry to @yusufdeveloper2903, since no docs changes are needed there is no help site PR to link or mark |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.4.73-3 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
Re-lands the optimistic scan-failed expense move from #97084, which was reverted in #98914 because it nulled the optimistic report in
successDatawhile the user could still be looking at it, leaving them on the "Hmm... it's not here" page.Instead of dropping that report blindly,
HandleMovedScanFailedExpensesreads the backend's report out of thePayMoneyRequestresponse and points every route showing the optimistic report at it — itsreportIDparam and any encodedbackTo— before removing it, re-parenting each moved expense's transaction thread on the way.The cleanup is appended to the request's
successDatarather than the response, so it lands after the pending-state cleanup already there instead of being merged back onto the actions it just removed. If the response does not name exactly one backend report, nothing happens at all — a guessed destination renders an expense report screen with no expenses.Fixed Issues
$ #96257
$ #98821
Tests
Precondition: a workspace chat where you can submit, approve and pay.
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
After fix:REC-20260824172438.mp4