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-05-18] [$250] Receipt Disappears on Confirm Page After Refresh While “Create Expense” Remains Enabled #88975
Version Number: 9.3.62-6 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@FitseTLT Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Navigate to workspace chat or Click global +
Choose Scan
Upload a receipt to create an expense
Refresh the page
Observe the receipt preview and button state
Expected Result:
Receipt should:
Remain visible after refresh, OR
If receipt data is lost:
The Create Expense flow starts
Actual Result:
Receipt preview disappears
Create Expense button remains enabled
User can proceed without confirming receipt
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
👋 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.
On web, receipt images are stored as blob:// URLs via URL.createObjectURL(). The URL string is persisted in the Onyx TRANSACTION_DRAFT, but the actual blob data lives only in browser memory and is lost on page refresh.
ReceiptFileValidator is supposed to detect expired blob URLs and redirect the user back to the scan step. Here's why it fails:
On refresh, the effect tries to fetch() the stale blob:// URL — this fails as expected.
The onFailure callback calls setMoneyRequestReceipt(transactionID, '', '', true, ''), which updates Onyx and triggers a re-render.
The re-render runs the effect's cleanup function, setting ignore = true.
When Promise.all(...).then() finally executes, it checks ignore and bails — the navigation to restart the scan flow never happens.
receiptFiles becomes non-empty → loading indicator hides, button enables. But the receipt source is empty → nothing renders.
What changes do you think we should make in order to solve the problem?
In ReceiptFileValidator.tsx, the non-local file branch (line 64) should also verify the receipt source is truthy before treating it as valid. An empty-source receipt should not be added to receiptFiles:
This prevents the second effect run (after onFailure clears the source to '') from populating receiptFiles with an invalid receipt, so the loading state persists and the button stays disabled. Meanwhile, a subsequent effect re-run with requestType defined will correctly hit the navigation path since isScanFilesCanBeRead will be false (no local files succeed) and the ignore flag won't be set.
What alternative solutions did you explore? (Optional)
An alternative would be to avoid calling setMoneyRequestReceipt inside the Promise callback (which triggers the re-render/ignore race). Instead, the cleanup and navigation could be deferred to the .then() handler. However, the simpler itemReceiptPath guard is a more targeted fix that also protects against other scenarios where a receipt might have an empty source.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Classification: Frontend bug Causing PR: #86023 - "[Odometer] Blob URL loss detection" by @jakubkalinski0 (Medium confidence) Related Issues: None found
Recommendation: NEEDS INVESTIGATION
While PR #86023 is the most direct candidate — it modified ReceiptFileValidator.tsx and the receipt validation flow that runs on page refresh — I could not definitively confirm it introduced the regression without being able to run the code. The author and reviewers should verify the failure scenario.
Assigned: @jakubkalinski0 (PR author), @DylanDylann, @Julesssss (approving reviewers) from highest-confidence causing PR only Labels: No label changes made. DeployBlockerCash is appropriate because the fix requires an App change.
Detailed Analysis
Evidence
The bug: After uploading a receipt via the Scan flow and refreshing the page on the confirmation screen, the receipt preview disappears but the "Create Expense" button remains enabled. The expected behavior is either that the receipt remains visible OR the flow restarts from the beginning.
The mechanism: When a browser page refreshes, blob:// URLs stored in the transaction draft (persisted in Onyx via localStorage) become invalid — the binary data in browser memory is gone. The ReceiptFileValidator component is responsible for detecting this and navigating the user back to the start of the scan flow.
Why PR 86023 is the candidate: It directly modifies ReceiptFileValidator.tsx (src/pages/iou/request/step/confirmation/ReceiptFileValidator.tsx) to add the backToReport parameter and pass action and backToReport to navigateToStartMoneyRequestStep. Before this PR, those arguments were omitted.
Possible failure path: A race condition exists in ReceiptFileValidator's useEffect:
On refresh, ReceiptFileValidator runs: detects the blob URL is expired, calls onFailure.
onFailure calls setMoneyRequestReceipt(id, '', '', true, '') which immediately triggers an async Onyx merge on the transaction draft.
The Onyx update changes the transactions prop (which is a dependency of the useEffect), triggering a cleanup — setting ignore = true.
The Promise.all().then() callback runs and finds ignore === true, so it returns early — navigation is skipped.
The receipt is now cleared (blank preview) but the user is left on the confirmation page with the Create Expense button still active.
This race condition would have existed before PR 86023 too, but the addition of backToReport could have changed the async timing. Additionally, if ReceiptFileValidator.tsx was first introduced or substantially changed in this staging cycle (as suggested by the confirmation/ directory decomposition pattern), the bug may be entirely new to this release.
Why staging-only: The ReceiptFileValidator changes in PR 86023 are new in the staging cycle (merged 2026-04-23). Production (9.3.61-x) would not have these changes.
Bug only on web platforms: Confirmed — blob:// URL expiry only affects web (Chrome, Safari) where page refresh destroys in-memory blobs. Mobile native apps and native platforms are not affected, matching the platforms checked in the issue.
Root Cause
The ReceiptFileValidator component's useEffect has transactions as a dependency. When onFailure is called, it triggers setMoneyRequestReceipt which writes to ONYXKEYS.COLLECTION.TRANSACTION_DRAFT. This Onyx write causes a re-render, which re-evaluates the transactions dependency, which triggers the useEffect cleanup (setting ignore = true). The cleanup runs before the Promise.all().then() callback completes, so ignore === true when the callback runs, and the navigation back to the scan step is silently skipped. The user is left on the confirmation page with no receipt displayed but the Create Expense button still enabled.
The fix should either:
Move the navigation call out of the Promise.all().then() to prevent the ignore flag from blocking it, or
Avoid calling setMoneyRequestReceipt inside onFailure before the navigation (or call it after navigation), or
Use a separate useRef to track whether navigation has been triggered to prevent re-running on the re-render caused by the Onyx update.
@FitseTLT 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:
[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:
[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
Test:
Navigate to workspace chat or Click global +
Choose Scan
Upload a receipt to create an expense
Refresh the page
Verify the user is redirected to Create Expense flow
Activity
melvin-bot commentedon Apr 27, 2026
Triggered auto assignment to @deetergp (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Apr 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 27, 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 Apr 27, 2026
Proposal
What is the root cause of that problem?
There's a race condition in
ReceiptFileValidator.tsx.On web, receipt images are stored as
blob://URLs viaURL.createObjectURL(). The URL string is persisted in the OnyxTRANSACTION_DRAFT, but the actual blob data lives only in browser memory and is lost on page refresh.ReceiptFileValidatoris supposed to detect expired blob URLs and redirect the user back to the scan step. Here's why it fails:fetch()the staleblob://URL — this fails as expected.onFailurecallback callssetMoneyRequestReceipt(transactionID, '', '', true, ''), which updates Onyx and triggers a re-render.ignore = true.Promise.all(...).then()finally executes, it checksignoreand bails — the navigation to restart the scan flow never happens.receipt.source = ''.isLocalFile('')returnsfalsebecause empty string is falsy, so the validator treats it as a valid non-local (remote) file and adds it toreceiptFiles.receiptFilesbecomes non-empty → loading indicator hides, button enables. But the receipt source is empty → nothing renders.What changes do you think we should make in order to solve the problem?
In
ReceiptFileValidator.tsx, the non-local file branch (line 64) should also verify the receipt source is truthy before treating it as valid. An empty-source receipt should not be added toreceiptFiles:This prevents the second effect run (after
onFailureclears the source to'') from populatingreceiptFileswith an invalid receipt, so the loading state persists and the button stays disabled. Meanwhile, a subsequent effect re-run withrequestTypedefined will correctly hit the navigation path sinceisScanFilesCanBeReadwill befalse(no local files succeed) and theignoreflag won't be set.What alternative solutions did you explore? (Optional)
An alternative would be to avoid calling
setMoneyRequestReceiptinside the Promise callback (which triggers the re-render/ignore race). Instead, the cleanup and navigation could be deferred to the.then()handler. However, the simpleritemReceiptPathguard is a more targeted fix that also protects against other scenarios where a receipt might have an empty source.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.FitseTLT commentedon Apr 27, 2026
@MelvinBot what's the offending pr as it is a deploy blocker
OSBotify commentedon Apr 27, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #86023 - "[Odometer] Blob URL loss detection" by @jakubkalinski0 (Medium confidence)
Related Issues: None found
Recommendation: NEEDS INVESTIGATION
While PR #86023 is the most direct candidate — it modified
ReceiptFileValidator.tsxand the receipt validation flow that runs on page refresh — I could not definitively confirm it introduced the regression without being able to run the code. The author and reviewers should verify the failure scenario.Assigned: @jakubkalinski0 (PR author), @DylanDylann, @Julesssss (approving reviewers) from highest-confidence causing PR only
Labels: No label changes made.
DeployBlockerCashis appropriate because the fix requires an App change.Detailed Analysis
Evidence
The bug: After uploading a receipt via the Scan flow and refreshing the page on the confirmation screen, the receipt preview disappears but the "Create Expense" button remains enabled. The expected behavior is either that the receipt remains visible OR the flow restarts from the beginning.
The mechanism: When a browser page refreshes, blob:// URLs stored in the transaction draft (persisted in Onyx via localStorage) become invalid — the binary data in browser memory is gone. The
ReceiptFileValidatorcomponent is responsible for detecting this and navigating the user back to the start of the scan flow.Why PR 86023 is the candidate: It directly modifies
ReceiptFileValidator.tsx(src/pages/iou/request/step/confirmation/ReceiptFileValidator.tsx) to add thebackToReportparameter and passactionandbackToReporttonavigateToStartMoneyRequestStep. Before this PR, those arguments were omitted.Possible failure path: A race condition exists in
ReceiptFileValidator'suseEffect:ReceiptFileValidatorruns: detects the blob URL is expired, callsonFailure.onFailurecallssetMoneyRequestReceipt(id, '', '', true, '')which immediately triggers an async Onyx merge on the transaction draft.transactionsprop (which is a dependency of theuseEffect), triggering a cleanup — settingignore = true.Promise.all().then()callback runs and findsignore === true, so it returns early — navigation is skipped.This race condition would have existed before PR 86023 too, but the addition of
backToReportcould have changed the async timing. Additionally, ifReceiptFileValidator.tsxwas first introduced or substantially changed in this staging cycle (as suggested by theconfirmation/directory decomposition pattern), the bug may be entirely new to this release.Why staging-only: The
ReceiptFileValidatorchanges in PR 86023 are new in the staging cycle (merged 2026-04-23). Production (9.3.61-x) would not have these changes.Verification
src/pages/iou/request/step/confirmation/ReceiptFileValidator.tsxbackToReportprop and passesaction, backToReporttonavigateToStartMoneyRequestStep.Root Cause
The
ReceiptFileValidatorcomponent'suseEffecthastransactionsas a dependency. WhenonFailureis called, it triggerssetMoneyRequestReceiptwhich writes toONYXKEYS.COLLECTION.TRANSACTION_DRAFT. This Onyx write causes a re-render, which re-evaluates thetransactionsdependency, which triggers theuseEffectcleanup (settingignore = true). The cleanup runs before thePromise.all().then()callback completes, soignore === truewhen the callback runs, and the navigation back to the scan step is silently skipped. The user is left on the confirmation page with no receipt displayed but the Create Expense button still enabled.The fix should either:
Promise.all().then()to prevent theignoreflag from blocking it, orsetMoneyRequestReceiptinsideonFailurebefore the navigation (or call it after navigation), oruseRefto track whether navigation has been triggered to prevent re-running on the re-render caused by the Onyx update.37 remaining items
melvin-bot commentedon May 11, 2026
@FitseTLT 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]
FitseTLT commentedon May 12, 2026
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:
[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:
[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
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-5ffe-a6b2-0028-7c0c6af0c194melvin-bot commentedon May 17, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon May 19, 2026
From PR, I'm assuming this should be reduced cuz it wasn't addressed here. Is that correct @FitseTLT ?
FitseTLT commentedon May 19, 2026
No it is a false alarm. @mallenexpensify
mallenexpensify commentedon May 19, 2026
Payment Summary
Contributor+: @FitseTLT paid $250 via Upwork
Thanks @FitseTLT please address on the issue due payment so I don't have to go dig around, it helps me pay folks promptly.
^ Test case created. Thx