Skip to content

[Due for payment 2025-11-20] [Due for payment 2025-11-07] [$250] Receipt gets lost and transaction type returns to cash after editing split. #72975

Closed

Description

@m-natarajan

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.2.34-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @mukhrr
Slack conversation (hyperlinked to channel name): #Open Source

Action Performed:

Precondition:
Have card transactions created

  1. Go to https://staging.new.expensify.com/
  2. Go to a card transaction
  3. Split it and save
  4. Click to one of split expense
  5. Click Edit split
  6. Add one more split and make sure to match total of all splits
  7. Click Save

Expected Result:

All transactions in report should have a receipt and card icon/text

Actual Result:

Only some (previously touched: added and subtracted) transactions have receipt and card icon/text. The rest defaults to cash and no receipt
Refreshing page makes it correct

Workaround:

Refreshing page makes it correct

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
edit_split_bug.mp4
Recording.1783.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021980242265245066836
  • Upwork Job ID: 1980242265245066836
  • Last Price Increase: 2025-10-27
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 20, 2025
  2. melvin-bot commented on Oct 20, 2025

    @melvin-bot

    Triggered auto assignment to @Christinadobrzyn (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. mukhrr commented on Oct 20, 2025

    @mukhrr
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Receipt gets lost editing split.

    What is the root cause of that problem?

    When editing or deleting transactions splits we optimistically build with buildOptimisticTransaction.

    We lose receipts as we return empty object as receipt when building optimistically here:
    Besides, not providing existing transactions card details when building it optimistically which leads to defaulting cash icon/text.

    receipt: receipt?.source
    ? {source: receipt.source, filename: receipt?.name ?? filename, state: receipt.state ?? CONST.IOU.RECEIPT_STATE.SCAN_READY, isTestDriveReceipt: receipt.isTestDriveReceipt}
    : {},

    And receipt is decided to show only if we don't have receipt object and hasEReceipt is true

    const isEReceipt = transactionItem.hasEReceipt && !hasReceiptSource(transactionItem);

    function hasReceiptSource(transaction: OnyxInputOrEntry<Transaction>): boolean {
    return !!transaction?.receipt?.source;
    }

    So we return both hasEReceipt and receipt when building optimistically.

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

    We need to return undefined for receipt and true for hasEReceipt in case it doesn't exist. Besider to get proper card or cash icon/text after editing split, we need to return card details of existing transaction:

    receipt: receipt?.source
                ? {source: receipt.source, filename: receipt?.name ?? filename, state: receipt.state ?? CONST.IOU.RECEIPT_STATE.SCAN_READY, isTestDriveReceipt: receipt.isTestDriveReceipt}
                : undefined,
            hasEReceipt: !receipt?.source,
            cardID: existingTransaction?.cardID,
            cardName: existingTransaction?.cardName,
            cardNumber: existingTransaction?.cardNumber,

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

    What alternative solutions did you explore? (Optional)

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 20, 2025
  5. changed the title [-]Receipt gets lost and transaction type returns to cash after editing split.[/-] [+][$250] Receipt gets lost and transaction type returns to cash after editing split.[/+] on Oct 20, 2025
  6. melvin-bot commented on Oct 20, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 20, 2025
  8. melvin-bot commented on Oct 20, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)

  9. lakchote commented on Oct 20, 2025

    @lakchote
    Contributor

    @ikevin127 please review @mukhrr's proposal above, thanks!

  10. mukhrr commented on Oct 20, 2025

    @mukhrr
    Contributor

    @ikevin127 pls, make sure I intentionally missed defaulting cash issue as it's already tracked in this issue and being fixed in this PR. Here is related Slack thread. Thanks!

  11. 57 remaining items

  12. Christinadobrzyn commented on Nov 20, 2025

    @Christinadobrzyn
    Contributor

    Thanks so much @ikevin127

    @mukhrr, can you please provide your Upwork profile? TY!

  13. mukhrr commented on Nov 20, 2025

    @mukhrr
    Contributor
  14. Christinadobrzyn commented on Nov 20, 2025

    @Christinadobrzyn
    Contributor

    Awesome! Thanks for the quick action @mukhrr! Can you please accept my offer? https://www.upwork.com/nx/wm/offer/109551057

  15. ikevin127 commented on Nov 20, 2025

    @ikevin127
    Contributor

    @Christinadobrzyn Mind dropping a payment sumnary for ND request ? Thank you!

  16. Christinadobrzyn commented on Nov 20, 2025

    @Christinadobrzyn
    Contributor

    Oh yep - payment summary - #72975 (comment)

  17. mukhrr commented on Nov 21, 2025

    @mukhrr
    Contributor

    Awesome! Thanks for the quick action @mukhrr! Can you please accept my offer? https://www.upwork.com/nx/wm/offer/109551057

    Accepted

  18. mukhrr commented on Nov 24, 2025

    @mukhrr
    Contributor

    @Christinadobrzyn kindly bump here)

  19. Christinadobrzyn commented on Nov 24, 2025

    @Christinadobrzyn
    Contributor

    Thanks for the nudge. Payment summary here - #72975 (comment)

    Regression test here - #72975 (comment)

    Closing this out as complete! Thanks everyone

  20. JmillsExpensify commented on Nov 25, 2025

    @JmillsExpensify
    Contributor

    $125 approved for @ikevin127

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions