Skip to content

[Due for payment 2025-10-07] [$250] Android - Reports -When deleting expense while offline, selection mode is applied on preview #68716

Closed

Description

@mitarachim

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.96-1
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-327/folder/13176670/41237092/846109493
Email or phone of affected tester (no customers): ibellicotest+1616@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 (Hybrid app)
App Component: Search

Action Performed:

Prerequisite: Account has at least one workspace available.

  1. Open the Expensify app.
  2. Open any workspace chat.
  3. Create two manual expenses.
  4. Navigate to Reports.
  5. If you are not on "Submit" section, navigate to it.
  6. Turn off internet connection.
  7. Open the report of the just created expenses.
  8. Long tap and select the expense displayed on top.
  9. Delete the expense.
  10. Use the device´s back button to return to "Reports"
  11. Note that when you land on "Reports", selection mode is applied on expenses preview.

Expected Result:

When deleting an expense from a report while offline, selection mode shouldn´t be applied on the report preview when returning.

Actual Result:

When opening a report and deleting an expense while offline on "Submit" section, selection mode is applied on the report preview when using device´s back button to return.

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

Bug6920616_1755574436892.Selection.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021961209396410763283
  • Upwork Job ID: 1961209396410763283
  • Last Price Increase: 2025-08-28
Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

  1. added
    Daily
    Bug
    on Aug 19, 2025
  2. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    Triggered auto assignment to @trjExpensify (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. mkzie2 commented on Aug 19, 2025

    @mkzie2
    Contributor

    Proposal

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

    When opening a report and deleting an expense while offline on "Submit" section, selection mode is applied on the report preview when using device´s back button to return.

    What is the root cause of that problem?

    In offline, the delete transaction is marked as pending delete, then after deleting the transaction offline, the selection mode is not turned off. We can see that the header of the report is still in the selection mode.

    if (transactions.length <= 1) {
    turnOffMobileSelectionMode();
    }
    return (

    That's why the selection mode is enabled when we go back to Reports

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

    We need to check the visible transaction length instead

    const visibleTransactions = transactions.filter((t) => t.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
    if (visibleTransactions.length <= 1) {
        turnOffMobileSelectionMode();
    }
    

    if (transactions.length <= 1) {
    turnOffMobileSelectionMode();
    }
    return (

    And we also need to turn off the selection mode when the MoneyReportHeader is unmounted to prevent the same bug.

    useEffect(() => {
        return () => {
            turnOffMobileSelectionMode();
        }
    }, []);
    

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

    NA

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. trjExpensify commented on Aug 20, 2025

    @trjExpensify
    Contributor

    Asking if this will be fixed by #66028 (comment)

  5. changed the title [-]Android - Reports -When deleting expense while offline, selection mode is applied on preview[/-] [+][Hold https://github.com/Expensify/App/pull/67216] Android - Reports -When deleting expense while offline, selection mode is applied on preview[/+] on Aug 22, 2025
  6. trjExpensify commented on Aug 22, 2025

    @trjExpensify
    Contributor

    Held on #67216

  7. melvin-bot commented on Aug 25, 2025

    @melvin-bot

    @trjExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  8. trjExpensify commented on Aug 26, 2025

    @trjExpensify
    Contributor

    Deployed to staging. This can be retested.

  9. added
    retest-weekly
    on Aug 26, 2025
  10. 51 remaining items

  11. added
    Awaiting Payment
    on Sep 30, 2025
  12. changed the title [-][$250] Android - Reports -When deleting expense while offline, selection mode is applied on preview[/-] [+][Due for payment 2025-10-07] [$250] Android - Reports -When deleting expense while offline, selection mode is applied on preview[/+] on Sep 30, 2025
  13. melvin-bot commented on Sep 30, 2025

    @melvin-bot

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

  14. removed
    Reviewing
    on Sep 30, 2025
  15. melvin-bot commented on Sep 30, 2025

    @melvin-bot

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

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

    • @rushatgabhane requires payment through NewDot Manual Requests
    • @mkzie2 requires payment (Needs manual offer from BZ)
  16. melvin-bot commented on Sep 30, 2025

    @melvin-bot

    @rushatgabhane @trjExpensify 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]

  17. rushatgabhane commented on Oct 1, 2025

    @rushatgabhane
    Member

    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.

      Link to comment: 26d0cd0#r166900645

    • [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: Not critical

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

    Precondition:

    Test:

    1. Open any workspace chat.
    2. Create two manual expenses.
    3. Navigate to Reports.
    4. If you are not on "Submit" section, navigate to it.
    5. Turn off internet connection.
    6. Open the report of the just created expenses.
    7. Long tap and select the expense displayed on top.
    8. Delete the expense.
    9. Back to "Reports"
    10. Verify that when you land on "Reports", selection mode is not applied on expenses preview (On mobile device)

    Do we agree 👍 or 👎

  18. trjExpensify commented on Oct 13, 2025

    @trjExpensify
    Contributor

    Payment summary as follows:

  19. trjExpensify commented on Oct 14, 2025

    @trjExpensify
    Contributor

    Paid @mkzie2, closing!

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Oct 14, 2025
  21. quinthar commented on Oct 18, 2025

    @quinthar
    Contributor

    Approved $250 to @rushatgabhane

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

Metadata

Metadata

Labels

Awaiting PaymentBugExternalWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions