Skip to content

[Due for payment 2026-04-30] [Due for payment 2026-04-28] Native share - Original receipt is uploaded despite choosing a new receipt from confirm page #88068

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.60-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #87142
Email or phone of affected tester (no customers): soidnjsoidjoisjdiosj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: iPhone 15 Pro Max / iOS 26.3
App Component: Money Requests

Action Performed:

  1. Share a receipt from device gallery to Expensify app.
  2. Go to Submit tab.
  3. Select workspace chat.
  4. On confirm page, tap on the receipt.
  5. Tap Replace.
  6. Select another receipt.
  7. Tap Create expense.
  8. Open the expense.

Expected Result:

The new receipt from Step 6 will be uploaded.

Actual Result:

The original receipt is uploaded despite choosing a new receipt from confirm page.

The same issue also happens when the receipt is cropped on confirm page. The uploaded receipt is not cropped.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. added
    DeployBlockerCash
    Bug
    on Apr 16, 2026
  2. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    @marcochavezf recently merged #87142, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    Triggered auto assignment to @aldo-expensify (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. github-actions commented on Apr 16, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. OSBotify commented on Apr 16, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #87142 - fix: Add updated automatic/scan flow to native share sheet creation flow by @TaduJR (High confidence)
    Related Issues: #86027 (the original issue this PR fixed)

    Recommendation: REVERT

    The causing PR introduced a regression where replacing or cropping a receipt on the confirm page has no effect and the original receipt is always submitted. Reverting PR 87142 is the safest path since the issue is staging-only (new feature, not in production) and the roll-forward fix is non-trivial.

    Assigned: @TaduJR (PR author), @hoangzinh (approving reviewer), @marcochavezf (approving reviewer)
    Labels: DeployBlockerCash kept (frontend bug in App PR). No label changes made.

    Detailed Analysis

    Evidence

    PR 87142 modified src/pages/Share/SubmitDetailsPage.tsx to enable receipt replacement on the native share sheet confirm page (isReceiptEditable=true). It introduced three variables computed once from the original shared file, and these are passed to both MoneyRequestConfirmationList (as receiptPath/receiptFilename) and used in onConfirm -> readFileAsync(receiptSource, ...) when the expense is submitted.

    When the user replaces or crops the receipt on the confirm page, MoneyRequestConfirmationList updates transaction.receipt in Onyx. However, receiptSource/receiptFileName/receiptFileType in SubmitDetailsPage are NOT derived from transaction.receipt. They remain tied to ONYXKEYS.SHARE_TEMP_FILE (currentAttachment) and ONYXKEYS.VALIDATED_FILE_OBJECT (fileUri), which always reflect the original shared file.

    As a result onConfirm always calls readFileAsync with the original file path regardless of what the user selected as the replacement.

    Verification

    • Affected file: src/pages/Share/SubmitDetailsPage.tsx
    • PR 87142 is the PR that introduced the isReceiptEditable flag and the receiptSource variables
    • The issue body directly references PR 87142 as the associated test PR
    • melvin-bot auto-identified marcochavezf (who merged 87142) as the owner

    Root Cause

    onConfirm reads receiptSource from component-level variables derived from the original currentAttachment/fileUri rather than from transaction.receipt (which is what gets updated when the user replaces or crops on the confirm page). The setMoneyRequestReceipt effect in this PR only sets the receipt once at mount time. When the user picks a replacement via the editable receipt UI, the Onyx draft transaction is updated but SubmitDetailsPage never reads it back for the readFileAsync call, so the original file is always submitted.

  7. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    SubmitDetailsPage.tsx (the native share sheet confirm page) always uses the original shared file when displaying and submitting the receipt, ignoring any replacement or crop the user makes on the confirm page.

    Three things combine to cause this:

    1. receiptSource is derived from ONYXKEYS.SHARE_TEMP_FILE (the original shared file), which is never updated when the user replaces or crops the receipt.
    2. A useEffect writes this original source back to the transaction draft via setMoneyRequestReceipt, which can overwrite a replaced receipt.
    3. onConfirm reads from receiptSource (the original) when submitting, not from the transaction draft's receipt.source.

    By contrast, the normal flow in IOURequestStepConfirmation.tsx reads receipt data from transaction?.receipt?.source, so replacements and crops are correctly respected.

    What changes do you think we should make in order to solve the problem?

    In src/pages/Share/SubmitDetailsPage.tsx:

    1. Guard the setMoneyRequestReceipt effect — only set the receipt on the transaction draft if one hasn't already been set (i.e., transaction?.receipt?.source is falsy). This prevents the effect from overwriting a replaced/cropped receipt.
    2. Read receipt from the transaction draft for display — pass transaction?.receipt?.source ?? receiptSource as the receiptPath prop to MoneyRequestConfirmationList so the UI reflects a replaced receipt.
    3. Read receipt from the transaction draft in onConfirm — use transaction?.receipt?.source and transaction?.receipt?.filename (falling back to the original receiptSource/receiptFileName) when calling readFileAsync, so the submitted expense uses the replacement.

    What alternative solutions did you explore? (Optional)

    An alternative would be to update ONYXKEYS.SHARE_TEMP_FILE whenever the user replaces the receipt, keeping SubmitDetailsPage deriving everything from that single source. However, this would diverge from the established pattern used by IOURequestStepConfirmation (reading from the transaction draft) and would require changes to the receipt replacement flow. Aligning with the existing transaction-draft pattern is simpler and more consistent.


    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.

  8. hoangzinh commented on Apr 16, 2026

    @hoangzinh
    Contributor

    @MelvinBot, is it an existing bug or caused by this PR #87142?

  9. 10 remaining items

  10. mountiny commented on Apr 17, 2026

    @mountiny
    Contributor

    I went ahead and cped it

  11. m-natarajan commented on Apr 20, 2026

    @m-natarajan

    Not repro: iPhone 13/18.6.2/v9.3.60-19 and samsung s21/android 15/v9.3.60-19

    1000361718.mp4
    ScreenRecording_04-20-2026.19-06-30_1.MP4
  12. removed
    DeployBlockerCash
    on Apr 20, 2026
  13. added
    Daily
    and removed
    Reviewing
    Hourly
    on Apr 21, 2026
  14. changed the title [-]Native share - Original receipt is uploaded despite choosing a new receipt from confirm page[/-] [+][Due for payment 2026-04-28] Native share - Original receipt is uploaded despite choosing a new receipt from confirm page[/+] on Apr 21, 2026
  15. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 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 2026-04-28. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hoangzinh requires payment through NewDot Manual Requests
    • @TaduJR requires payment (Needs manual offer from BZ)
  17. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    @hoangzinh 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]

  18. changed the title [-][Due for payment 2026-04-28] Native share - Original receipt is uploaded despite choosing a new receipt from confirm page[/-] [+][Due for payment 2026-04-30] [Due for payment 2026-04-28] Native share - Original receipt is uploaded despite choosing a new receipt from confirm page[/+] on Apr 23, 2026
  19. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.61-4 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 2026-04-30. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hoangzinh requires payment through NewDot Manual Requests
    • @TaduJR requires payment (Needs manual offer from BZ)
  20. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    @hoangzinh 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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions