Skip to content

[$250] Report - "It´s not here" page when moving track expense to report of deleted expense offline #66630

Closed

Description

@vincdargento

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.1.82-3
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://docs.google.com/spreadsheets/d/1nPID07oiJkVDfW0GDmVYKrbmvse7V_3BnW-Rmyyr_Hs/edit?gid=319833773#gid=319833773&range=D19
Email or phone of affected tester (no customers): ibellicotest+1341@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 / Chrome ( mWeb / Hybrid app) - Windows 10 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least one workspace.0

  1. Open the staging.new.epensify.com
  2. Open any workspace chat.
  3. Submit a manual expense to it.
  4. Turn off internet connection.
  5. Long tap and delete the expense.
  6. Return to "Inbox"
  7. Create a new expense and submit it to Self DM.
  8. Open Self DM.
  9. Open the just created expense.
  10. Tap on the report field, and select the report of the deleted expense.
  11. Once the expense was moved, turn on internet connection.
  12. Note that an "It´s not here" page appears.
  13. Tap on the arrow on the top left corner.
  14. Note that you land on an empty report, where only the header displays the expense amount.
  15. Tap on the arrow on the top left corner again.
  16. Note that you land on Self DM, and the last created expense, is displayed again, but now, system message is displayed above it.

Expected Result:

When recovering internet connection after moving a track expense to a report of a deleted expense, the moved expense should remain on report, while the deleted one should disappear automatically.

Actual Result:

When recovering internet connection after moving a track expense to a report of a deleted expense, an "It´s not here" page appears and when returning from that page, user lands on an empty report, where only the header displays the expense amount. Also, when returning to Self DM, expense reappears, but Concierge system message now appears above the expense.

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

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021945907107487983677
  • Upwork Job ID: 1945907107487983677
  • Last Price Increase: 2025-07-17
  • Automatic offers:
    • FitseTLT | Contributor | 108126436
Issue OwnerCurrent Issue Owner: @FitseTLT

Activity

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

    @melvin-bot

    Triggered auto assignment to @clarajones-expensify (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 Jul 17, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Report - "It´s not here" page when moving track expense to report of deleted expense offline

    What is the root cause of that problem?

    We are not filtering out pending delete reports here

    return expenseReports
    .sort((report1, report2) => sortOutstandingReportsBySelected(report1, report2, onlyReport?.reportID))
    .filter((report) => !debouncedSearchValue || report?.reportName?.toLowerCase().includes(debouncedSearchValue.toLowerCase()))
    .filter((report): report is NonNullable<typeof report> => report !== undefined)
    .map((report) => {
    const matchingOption = options.reports.find((option) => option.reportID === report.reportID);
    return {
    ...matchingOption,
    alternateText: getPolicyName({report}) ?? matchingOption?.alternateText,
    value: report.reportID,
    isSelected: onlyReport && report.reportID === onlyReport?.reportID,

    so moving the expense to a deleted expense will fail in BE

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

    We should not allow moving to a pending delete reports so we should filter out or disable report options that are pending delete.
    Currently, when all the expenses in the expense report is deleted (shouldDeleteIOUReport) we add pending delete on pendingfields.preview on the iou report

    App/src/libs/actions/IOU.ts

    Lines 8125 to 8127 in 48a96b0

    pendingFields: {
    preview: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
    },

    So we can either utilize it or add pendingAction delete on the iou report here

    App/src/libs/actions/IOU.ts

    Lines 8123 to 8125 in 48a96b0

    key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`,
    value: {
    pendingFields: {

    We can add

                    pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
    
    

    and also revert on failureData
    Then we will add the whatever pending field we use above here to use the field in the page

            pendingAction: report.pendingAction,
    
    

    We can apply the filtering logic to getOutstandingReportsForUser for more generic solution so that report field menu will not be enabled when all the expense reports are pending delete ones as we use it to check if there are enough available reports to chose from.

     return Object.values(reports)
            .filter(
                (report) =>
                    report?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE &&
                    isReportOutstanding(report, policyID, reportNameValuePairs) &&
                    report?.ownerAccountID === reportOwnerAccountID,
            )
    

    or if we want we can disable the option

                        isDisabled: report.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
    
    

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

    If need we can add a test for getOutstandingReportsForUser to assert it fitlers pending delete reports.

    What alternative solutions did you explore? (Optional)

  4. changed the title [-]Report - "It´s not here" page when moving track expense to report of deleted expense offline[/-] [+][$250] Report - "It´s not here" page when moving track expense to report of deleted expense offline[/+] on Jul 17, 2025
  5. melvin-bot commented on Jul 17, 2025

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

    @melvin-bot

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

  8. ZhenjaHorbach commented on Jul 21, 2025

    @ZhenjaHorbach
    Contributor

    @FitseTLT
    Thanks for your proposal
    This proposal makes sense to me !
    🎀👀🎀 C+

  9. melvin-bot commented on Jul 21, 2025

    @melvin-bot

    Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  10. 1 remaining item

  11. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 21, 2025
  12. melvin-bot commented on Jul 21, 2025

    @melvin-bot

    📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

    Offer link
    Upwork job
    Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
    Keep in mind: Code of Conduct | Contributing 📖

  13. FitseTLT commented on Aug 8, 2025

    @FitseTLT
    Contributor

    @clarajones-expensify Payment overdue based on #66980 (comment) Thx

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Aug 8, 2025
  15. ZhenjaHorbach commented on Aug 8, 2025

    @ZhenjaHorbach
    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 (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. 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.

      Unfortunately, I did not find a suitable PR

    • [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: NA

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

    Regression Test Proposal

    Test:

    1. Open any workspace chat.
    2. Submit a manual expense to it.
    3. Turn off internet connection.
    4. Long tap and delete the expense.
    5. Return to "Inbox"
    6. Create a new expense and submit it to Self DM.
    7. Open Self DM.
    8. Open the just-created expense.
    9. Tap on the report field
    10. Verify that the pending delete expense report in (4) is not included in the list

    Do we agree 👍 or 👎

  16. clarajones-expensify commented on Aug 8, 2025

    @clarajones-expensify
    Contributor

    Payment Summary

    Contributor: @FitseTLT paid $250 via Upwork job
    Contributor+: @ZhenjaHorbach due $250 via NewDot

  17. ZhenjaHorbach commented on Aug 8, 2025

    @ZhenjaHorbach
    Contributor

    Requested in ND !

  18. isabelastisser commented on Aug 8, 2025

    @isabelastisser
    Contributor

    $250 approved in ND.

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.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions