Skip to content

[Due for payment 2025-07-18] [$250] [Multi-Scan] Delete the draft transaction when deleting a receipt while creating expenses in bulk with Multi-Scan #65252

Closed

Description

@cristipaval

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:
Reproducible in staging?: yes
Reproducible in production?: Feature not in prod yet
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: @dylanexpensify
Slack conversation (hyperlinked to channel name):

Action Performed:

  1. Global Create -> Create expense
  2. Select Scan tab -> Enable Multi-Scan toggle
  3. Capture a few receipts
  4. Tap on a receipt in the bottom carousel with receipt previews
  5. Delete the receipt

Expected Result:

In the confirmation screen, the draft transaction initially created for the deleted receipt should not exist.

Actual Result:

The draft transaction is not deleted. Only the receipt is deleted.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021940031624360843372
  • Upwork Job ID: 1940031624360843372
  • Last Price Increase: 2025-07-01
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @dylanexpensify

Activity

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

    @melvin-bot

    Current assignee @dylanexpensify is eligible for the Bug assigner, not assigning anyone new.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 1, 2025
  4. changed the title [-][Multi-Scan] Delete the draft transaction when deleting a receipt while creating expenses in bulk with Multi-Scan[/-] [+][$250] [Multi-Scan] Delete the draft transaction when deleting a receipt while creating expenses in bulk with Multi-Scan[/+] on Jul 1, 2025
  5. melvin-bot commented on Jul 1, 2025

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

    @melvin-bot

    Current assignee @dukenv0307 is eligible for the External assigner, not assigning anyone new.

  8. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 1, 2025
  9. Swor71 commented on Jul 1, 2025

    @Swor71
    Contributor

    update: switching removeTransactionReceipt for removeDraftTransaction fixes that problem, however when testing this I found another bug which happens after deleting the first photo/draftTransaction. The multi scan closes or hangs in the loading state. This has to do with the logic of creating the first draft transaction in the optimistic state. This is also why the first transaction has the id of 1. I will look for a way to fix this tomorrow

  10. Swor71 commented on Jul 2, 2025

    @Swor71
    Contributor

    update: following up to the previous update, switching removeTransactionReceipt for removeDraftTransaction solves the problem of confirmation page's invalid report, however removing the first photo results in another bug.

    The problem indeed is with the optimistic transaction being created and the logic breaking when removing that draft transaction which is the first photo in the filmstrip. Next photo taken is set only to have basic information from the file like source but no transactionID which is then compared to the initialTransactionID (the optimistic transaction id) which is not there anymore and the logic breaks down.

    When the first photo is removed and user tries to navigate to confirmation page, the isMultiScanEnabled set to false from resetIOUTypeIfChanged(transactionRequestType); call in IOURequestStartPage because iouRequestType is undefined (transaction does not have that field).

    I will be ooo from tomorrow but I hope this will help someone who picks this issue up.

  11. 11 remaining items

  12. changed the title [-][$250] [Multi-Scan] Delete the draft transaction when deleting a receipt while creating expenses in bulk with Multi-Scan[/-] [+][Due for payment 2025-07-18] [$250] [Multi-Scan] Delete the draft transaction when deleting a receipt while creating expenses in bulk with Multi-Scan[/+] on Jul 11, 2025
  13. melvin-bot commented on Jul 11, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.79-11 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 2025-07-18. 🎊

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

    • @VickyStash does not require payment (Contractor)
    • @dukenv0307 requires payment through NewDot Manual Requests
  14. melvin-bot commented on Jul 11, 2025

    @melvin-bot

    @dukenv0307 @dylanexpensify 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]

  15. melvin-bot commented on Jul 18, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    • Contributor: @VickyStash is from an agency-contributor and not due payment
    • Reviewer: @dukenv0307 owed $250 via NewDot

    BugZero Checklist (@dylanexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1940031624360843372/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. dylanexpensify commented on Jul 21, 2025

    @dylanexpensify
    Contributor

    Payment summary:

    Contributor+: @dukenv0307 $250 via NewDot

    Please apply/request!

  17. dylanexpensify commented on Jul 22, 2025

    @dylanexpensify
    Contributor

    @dukenv0307 please complete checklist!

  18. dukenv0307 commented on Jul 22, 2025

    @dukenv0307
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: https://github.com/Expensify/App/pull/63352/files#r2223188199

    • [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: N/A

    • [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. Yes

    Regression Test Proposal Template
    • [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:

    1. Tap FAB -> Create expense
    2. Select Scan tab
    3. Enable Multi-Scan toggle
    4. Capture a 3-4 receipts
    5. Tap on the first receipt in the bottom carousel.
    6. Delete the receipt. Make sure the receipt is deleted and doesn't show in the carousel anymore.
    7. Navigate to the confirmation screen.
    8. Make sure only non-deleted receipts/transactions are displayed.
    9. Repeat steps 1-8 deleting different receipts in the step 5.

    Do we agree 👍 or 👎

  19. dukenv0307 commented on Jul 22, 2025

    @dukenv0307
    Contributor

    @dylanexpensify I completed the checklists

  20. flaviadefaria commented on Aug 6, 2025

    @flaviadefaria
    Contributor

    $250 Approved for @dukenv0307

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