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
[$250] [Exploratory] Add receipt - "Receipt upload failed" error after adding a receipt to a manual expense #90871
Version Number: 9.3.75-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176933/test-cases/41237723 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: MacBook Air 15.7.4 Chrome, iPhone 15 iOS 26.4.2 App Component: Money Requests
Action Performed:
Preconditions: two accounts needed - User A and User B
As User A, open chat with User B, send an expense with $20 amount
As User B, open chat with User A, send an expense with a lower amount
As User B, open the expense report, click on your expense
Click "Add a receipt", upload any receipt
Click back button to navigate to the report
The error appears on the expense row with a receipt, open the expense
Click "Delete expense"
Expected Result:
The receipt is added to a manual expense without an error
Actual Result:
Issue 1 - "There was an error uploading your receipt" is displayed on the expense row in report.
Issue 2 - "Receipt upload failed. Save the receipt, or delete the expense and lose it." is shown in the expense with the buttons "Save receipt" and "Delete expense". Nothing happens after clicking "Delete expense".
On Prod "Try again" is the second option instead of "Delete expense"
📣 @antan2002! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
If I understand this issue correctly, the bug is reproducible on both production and staging, the only difference is that since we introduced the new UI without the "Try again" button in #82139, staging now shows "Delete expense" where prod still shows "Try again." So we probably need to investigate why the error pops up in the first place, since that's the underlying bug. This doesn't look like a regression, that PR only changed the error-state UI, not the upload path itself.
This issue has two distinct problems. One is fixable in App; the other is a backend failure.
What is the root cause of that problem?
Issue 2 — "Delete expense" does nothing (App bug, fixable here):
The "Delete expense" button in the receipt-error UI is wired to the generic dismiss-error handler, not a real delete. In DotIndicatorMessage.tsx:149-154 the button's onPress={dismissError}, which resolves to dismissReceiptError in MoneyRequestReceiptView.tsx:418-526. That handler only actually deletes the expense when transaction.pendingAction === ADD (i.e. the expense creation itself failed). Here the expense was created successfully and only the receipt attachment failed, so pendingAction !== ADD — the delete branch is skipped and the handler merely clears the error, leaving the expense in place. This is a regression from the new UI in #82139 (which replaced "Try again" with "Delete expense"), matching why prod still shows "Try again".
Issue 1 — "There was an error uploading your receipt" (backend, not fixable in App):
"Add a receipt" on an existing manual expense calls replaceReceipt(), which fires the ReplaceReceipt WRITE command (Receipt.ts:310). The error string is set only in that action's failureData — never optimistically — so its appearance means ReplaceReceipt genuinely returned a failure. The frontend is behaving correctly and displaying a real backend error. The root cause of Issue 1 is in the backend ReplaceReceipt command, which is outside the App repo — an internal engineer will need to investigate why it fails for this scenario (a manual expense on a 1:1 IOU report).
What changes do you think we should make in order to solve the problem?
For Issue 2 (App): Change the "Delete expense" button's onPress so it calls the real transaction-delete action (delete the money request unconditionally) instead of the dismiss-error handler. The button should remove the expense regardless of pendingAction.
For Issue 1 (backend): Escalate to an internal engineer with access to the ReplaceReceipt Auth command to determine why the API rejects adding a receipt to a manual expense on a 1:1 IOU report. This requires production logs from a repro (capture the requestID and check the returned jsonCode/error for that ReplaceReceipt call).
In dismissReceiptError, the only branch that calls cleanUpMoneyRequest (delete) is guarded by transaction?.pendingAction === RED_BRICK_ROAD_PENDING_ACTION.ADD. For a receipt-upload failure on an already-created expense, that guard is false, so only clearError/revert run — no deletion.
optimisticData sets errors: null; successData clears the pending flag; the error is set only in failureData via getReceiptError (Receipt.ts:216-254). So the error is a real API failure, not a stale optimistic error.
Strings: en.ts:1606-1608 (receiptFailureMessageShort = the row RBR, receiptUploadFailedMessage = inside the expense).
Alternative considered: whether Issue 1 was a stale/optimistic error that never cleared — ruled out, since optimisticData explicitly resets errors: null on each attempt and successData would leave it null. The error only appears on a genuine failureData application.
Confidence: High that Issue 2's button is mis-wired and that Issue 1 is a real backend ReplaceReceipt failure surfaced correctly by the frontend. Medium on the exact backend rejection reason (needs logs).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/90871) to create a draft PR (scoped to the Issue 2 "Delete expense" button fix only — Issue 1 needs a backend engineer). To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
I checked this and was not able to reproduce it on the latest build. @jponikarchuk could you please retest this and confirm whether it's still reproducible? Thanks!
Activity
antan2002 commentedon May 16, 2026
Hi, I’d like to work on this issue. Could you please assign it to me?
melvin-bot commentedon May 16, 2026
📣 @antan2002! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
antan2002 commentedon May 16, 2026
Contributor details
Your Expensify account email: antanroy502@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0174aef847660818b7
Hi, I’d like to work on this issue. Could you please assign it to me?
melvin-bot commentedon May 16, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
situchan commentedon May 18, 2026
cc: @mjasikowski @OlimpiaZurek for tracking
situchan commentedon Jun 1, 2026
@mjasikowski @OlimpiaZurek What do you think about this issue?
OlimpiaZurek commentedon Jun 1, 2026
If I understand this issue correctly, the bug is reproducible on both production and staging, the only difference is that since we introduced the new UI without the "Try again" button in #82139, staging now shows "Delete expense" where prod still shows "Try again." So we probably need to investigate why the error pops up in the first place, since that's the underlying bug. This doesn't look like a regression, that PR only changed the error-state UI, not the upload path itself.
sandipanghos commentedon Jun 2, 2026
@jponikarchuk
Can I work in the issue?
MelvinBot commentedon Jul 17, 2026
Proposal
This issue has two distinct problems. One is fixable in App; the other is a backend failure.
What is the root cause of that problem?
Issue 2 — "Delete expense" does nothing (App bug, fixable here):
The "Delete expense" button in the receipt-error UI is wired to the generic dismiss-error handler, not a real delete. In
DotIndicatorMessage.tsx:149-154the button'sonPress={dismissError}, which resolves todismissReceiptErrorinMoneyRequestReceiptView.tsx:418-526. That handler only actually deletes the expense whentransaction.pendingAction === ADD(i.e. the expense creation itself failed). Here the expense was created successfully and only the receipt attachment failed, sopendingAction !== ADD— the delete branch is skipped and the handler merely clears the error, leaving the expense in place. This is a regression from the new UI in #82139 (which replaced "Try again" with "Delete expense"), matching why prod still shows "Try again".Issue 1 — "There was an error uploading your receipt" (backend, not fixable in App):
"Add a receipt" on an existing manual expense calls
replaceReceipt(), which fires theReplaceReceiptWRITE command (Receipt.ts:310). The error string is set only in that action'sfailureData— never optimistically — so its appearance meansReplaceReceiptgenuinely returned a failure. The frontend is behaving correctly and displaying a real backend error. The root cause of Issue 1 is in the backendReplaceReceiptcommand, which is outside the App repo — an internal engineer will need to investigate why it fails for this scenario (a manual expense on a 1:1 IOU report).What changes do you think we should make in order to solve the problem?
For Issue 2 (App): Change the "Delete expense" button's
onPressso it calls the real transaction-delete action (delete the money request unconditionally) instead of the dismiss-error handler. The button should remove the expense regardless ofpendingAction.For Issue 1 (backend): Escalate to an internal engineer with access to the
ReplaceReceiptAuth command to determine why the API rejects adding a receipt to a manual expense on a 1:1 IOU report. This requires production logs from a repro (capture the requestID and check the returned jsonCode/error for thatReplaceReceiptcall).Investigation details & evidence
Issue 2 path:
DotIndicatorMessage.tsx:140-156; "Delete expense" →onPress={dismissError}.dismissErroris passed throughOfflineWithFeedbackasdismissReceiptErrorfromMoneyRequestReceiptView.tsx:610-643.dismissReceiptError, the only branch that callscleanUpMoneyRequest(delete) is guarded bytransaction?.pendingAction === RED_BRICK_ROAD_PENDING_ACTION.ADD. For a receipt-upload failure on an already-created expense, that guard is false, so onlyclearError/revertrun — no deletion.Issue 1 path:
MoneyRequestReceiptView.tsx:593-599→ scan step in EDIT mode →ScanEditReceipt.handleCapturecallsreplaceReceipt().optimisticDatasetserrors: null;successDataclears the pending flag; the error is set only infailureDataviagetReceiptError(Receipt.ts:216-254). So the error is a real API failure, not a stale optimistic error.en.ts:1606-1608(receiptFailureMessageShort= the row RBR,receiptUploadFailedMessage= inside the expense).Alternative considered: whether Issue 1 was a stale/optimistic error that never cleared — ruled out, since
optimisticDataexplicitly resetserrors: nullon each attempt andsuccessDatawould leave it null. The error only appears on a genuinefailureDataapplication.Confidence: High that Issue 2's button is mis-wired and that Issue 1 is a real backend
ReplaceReceiptfailure surfaced correctly by the frontend. Medium on the exact backend rejection reason (needs logs).Possibly related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/90871)to create a draft PR (scoped to the Issue 2 "Delete expense" button fix only — Issue 1 needs a backend engineer).To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
19 remaining items
mjasikowski commentedon Jul 20, 2026
@OlimpiaZurek since you have context, can you look into this please?
OlimpiaZurek commentedon Jul 21, 2026
I checked this and was not able to reproduce it on the latest build.
@jponikarchuk could you please retest this and confirm whether it's still reproducible? Thanks!
jponikarchuk commentedon Jul 21, 2026
@OlimpiaZurek The issue is not repro on build 9.4.41-2
Add.receipt.mp4
mjasikowski commentedon Jul 22, 2026
Thanks. I'll close this then.