Skip to content

[Due for payment 2025-10-27] [$250] Reports - Submitted report, reappears on "Submit" when adding an expense to it while offline #71343

Closed

Description

@nlemma

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.18-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-935/folder/13176730/41237111/915651813
Email or phone of affected tester (no customers): ibellicotest+1846@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 / Chrome ( mWeb / Hybrid app) - Windows 11 / Chrome
App Component: Search

Action Performed:

Prerequisite; Account has at least one workspace.
Prerequisite 2: Delayed submissions and approvals enabled.

  1. Open the Expensify app.
  2. Open any workspace chat,
  3. Create a manual expense.
  4. Tap on "Submit" on expense preview.
  5. Navigate to "Reports" > "Submit"
  6. Note that expense is not displayed on "Submit" section.
  7. Return to workspace chat and turn off internet connection.
  8. Open the expense report.
  9. Tap on "More" and select "Add Expense"
  10. Tap on "Create Expense" and create a new manual expense.
  11. Navigate to "Reports" > "Submit" again.
  12. Note that report is now displayed on "Submit" section, despite already being submitted.
  13. Expand the report preview.
  14. Note that a "This report has no expenses" message is displayed.
  15. Turn on internet connection.
  16. Note that report is still displayed.
  17. Navigate to a different section and return.
  18. Note that now, report disappeared from "Submit"

Expected Result:

Already submitted report, shouldn´t reappear on "Submit" section after adding a new expense to it while offline.

Actual Result:

Already submitted report, reappears on "Submit" section after adding a new expense to it while in offline mode. Report displays total amount, but when expanded, a "This report has no expenses" message can be seen.
After recovering internet connection, report still remains displayed on "Submit" section and only disappears after navigating to a different section and returning.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6955693_1758820438231.Reappear.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021973494967904572209
  • Upwork Job ID: 1973494967904572209
  • Last Price Increase: 2025-10-01
  • Automatic offers:
    • truph01 | Reviewer | 109109280
    • FitseTLT | Contributor | 109109282
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @Christinadobrzyn

Activity

  1. added
    Daily
    Bug
    on Sep 25, 2025
  2. melvin-bot commented on Sep 25, 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. FitseTLT commented on Sep 25, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Reports - Submitted report, reappears on "Submit" when adding an expense to it while offline

    What is the root cause of that problem?

    In shouldOptimisticallyUpdateSearch we don't check the status of the iouReport is draft when the currentSearchHash submitQueryJSON

    App/src/libs/actions/IOU.ts

    Lines 11971 to 11975 in 30a92e7

    shouldOptimisticallyUpdateByStatus &&
    validSearchTypes &&
    (currentSearchQueryJSON.flatFilters.length === 0 ||
    [submitQueryJSON?.similarSearchHash, approveQueryJSON?.similarSearchHash].includes(currentSearchQueryJSON.similarSearchHash) ||
    (unapprovedCashSimilarSearchHash === currentSearchQueryJSON.similarSearchHash && isExpenseReport(iouReport) && transaction?.reimbursable))

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

    We should check the iouReport is draft for the case of submitQueryJSON (we should also check that the status is submitted for approveQueryJSON)

                (submitQueryJSON?.similarSearchHash === currentSearchQueryJSON.similarSearchHash && expenseReportStatusFilterMapping[CONST.SEARCH.STATUS.EXPENSE.DRAFTS](iouReport)) ||
                (approveQueryJSON?.similarSearchHash === currentSearchQueryJSON.similarSearchHash && expenseReportStatusFilterMapping[CONST.SEARCH.STATUS.EXPENSE.OUTSTANDING](iouReport)) 
    

    We can also add a similar check for unapprovedCashSimilarSearchHash to ensure the status is either draft or outstanding

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

    We can test that search items are not added optimistically if the iouReport on which the expense is added is submitted one and the current search hash is submitQueryJSON one

    What alternative solutions did you explore? (Optional)

  4. Christinadobrzyn commented on Sep 26, 2025

    @Christinadobrzyn
    Contributor

    These reproduction steps are so confusing! I don't understand step 9, how do you add an expense to a submitted report? asking QA for help - https://expensify.slack.com/archives/C9YU7BX5M/p1758863969626679

  5. IuliiaHerets commented on Sep 26, 2025

    @IuliiaHerets

    @Christinadobrzyn I recorded a video for you. You need to open the More menu in the Expense report

    bandicam.2025-09-26.10-02-41-701.mp4
  6. melvin-bot commented on Sep 29, 2025

    @melvin-bot

    @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick!

  7. Christinadobrzyn commented on Sep 30, 2025

    @Christinadobrzyn
    Contributor

    Thanks @IuliiaHerets! I still don't get the same on steps 14-18.

    Here's a video -

    2025-09-30_10-57-59.mp4
  8. IuliiaHerets commented on Sep 30, 2025

    @IuliiaHerets

    @Christinadobrzyn issue is still repro, full video here

    screen-20250930-154122.mp4
  9. Christinadobrzyn commented on Sep 30, 2025

    @Christinadobrzyn
    Contributor

    Awesome thank you! testing

  10. Christinadobrzyn commented on Oct 1, 2025

    @Christinadobrzyn
    Contributor

    I can reproduce this with this video - #71343 (comment)

    Sorry for the delay here. adding External label.

  11. 43 remaining items

  12. truph01 commented on Oct 21, 2025

    @truph01
    Contributor

    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: https://github.com/Expensify/Expensify/issues/562347

    Regression Test Proposal

    Precondition:

    Test:

    Prerequisite: The Account has at least one workspace.
    Prerequisite 2: Delayed submissions and approvals enabled.

    1. Open the workspace chat,
    2. Create a manual expense.
    3. Tap on "Submit" on expense preview.
    4. Navigate to "Reports" > "Submit"
    5. Note that expense is not displayed on "Submit" section.
    6. Return to workspace chat and turn off internet connection.
    7. Open the expense report.
    8. Tap on "More" and select "Add Expense"
    9. Tap on "Create Expense" and create a new manual expense.
    10. Navigate to "Reports" > "Submit" again.
    11. Verify that the submitted report doesn't reappear on "Submit" section after adding a new expense to it while offline.

    Do we agree 👍 or 👎

  13. Julesssss commented on Oct 28, 2025

    @Julesssss
    Contributor

    @Christinadobrzyn ready for payment as of today 👍

  14. Christinadobrzyn commented on Oct 28, 2025

    @Christinadobrzyn
    Contributor

    Regression test - #71343 (comment)

    Payment summary - #71343 (comment)

    @truph01 can you please accept this Upwork offer - https://www.upwork.com/nx/wm/offer/109109280

    TY

  15. added
    Daily
    and removed
    Weekly
    Bug
    on Oct 28, 2025
  16. Christinadobrzyn commented on Oct 28, 2025

    @Christinadobrzyn
    Contributor

    moving to daily

  17. truph01 commented on Oct 29, 2025

    @truph01
    Contributor

    @Julesssss I've accepted the offer

  18. Julesssss commented on Oct 29, 2025

    @Julesssss
    Contributor

    Cool, so we can close right?

  19. truph01 commented on Nov 3, 2025

    @truph01
    Contributor

    @Christinadobrzyn Please release the payment for me in the Upwork contract

  20. Christinadobrzyn commented on Nov 10, 2025

    @Christinadobrzyn
    Contributor

    So sorry @truph01! I just paid you in Upwork. #71343 (comment)

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

Metadata

Metadata

Labels

Awaiting PaymentDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions