Skip to content

[Due for payment 2026-06-19] Expense disappears from the report view before the thread screen is closed #92036

Closed

Description

@applause-bot

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.3.89-1
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #88538
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: MacBook Air 26.5 Chrome
App Component: Money Requests

Action Performed:

  1. Create a new expense report with two expenses
  2. Navigate to the Spend/ Reports and open the report
  3. Click on one of the expenses to enter its transaction thread
  4. Inside the transaction thread, tap More → Delete
  5. Observe the report view while the transaction thread screen closes
  6. Create a new expense report with two expenses
  7. Navigate to the Spend/ Reports and open the report
  8. Tap the More button - Delete
  9. Observe the screen while the report is closing

Expected Result:

Step 5 - The transaction thread screen closes first, and only then the transaction entry disappears from the report view (the entry should not vanish while the transaction thread is still animating closed)
Step 9 - The report entry in Spend is removed only after the report screen has fully closed (the entry should remain visible during the closing transition and disappear afterward)

Actual Result:

Step 5 -The transaction entry disappears while the thread is animating closed
Step 9 - The report disappears from the screen while the report view is closing

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7165846_1780008223260.Report_disappears.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7165846

Issue OwnerCurrent Issue Owner: @collectioneur

Activity

  1. applause-bot commented on May 29, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/59025b2bf075abfd3ade0cdccbda39bcc036cbb58b8bf3b436e057cf88390e1b

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 29, 2026
  3. melvin-bot commented on May 29, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #88538

  4. melvin-bot commented on May 29, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on May 29, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on May 29, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    This is a regression from #88538 (merged 2026-05-28), which migrated InteractionManager.runAfterInteractions cleanup patterns to Navigation.goBack({afterTransition: ...}) / TransitionTracker.runAfterTransitions. Two distinct bugs explain the two reported symptoms.

    Step 5 — transaction-thread delete drops the row early (high confidence):
    The DELETE handler in useExpenseActions was only half-migrated. The single-transaction branch still calls Navigation.goBack(...) synchronously and then wraps the Onyx mutation in the old InteractionManager.runAfterInteractions(...), so the close animation and the optimistic delete race (useExpenseActions.ts:521-538). The sibling whole-report branch in the same file was migrated correctly to Navigation.goBack(backToRoute, {afterTransition: () => deleteAppReport(...)}) (useExpenseActions.ts:557-572), so the new pattern is clearly what was intended. A telling smell: the file carries an // eslint-disable-next-line no-restricted-imports for InteractionManager (useExpenseActions.ts:5-6) — the lint rule installed by the migration is flagging this exact line.

    Step 9 — whole-report delete drops the row early (medium confidence):
    That branch already uses the new afterTransition pattern, so the bug is in TransitionTracker itself. Navigation.goBack schedules the callback via runAfterTransitions({waitForUpcomingTransition: true}) (Navigation.ts:511-538). waitForUpcomingTransition races React Navigation's transitionStart against a 1 s safety timer (MAX_TRANSITION_START_WAIT_MS); if no transitionStart event arrives, the callback fires immediately at the 1 s mark (TransitionTracker.ts:116-146). On the Search → MoneyRequestReportView pop in the reported scenario, the popping screen does not appear to emit transitionStart, so the fallback timer fires deleteAppReport while the close animation is still running.

    Full code paths and evidence

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

    1. In the single-transaction delete branch of useExpenseActions, replace the synchronous navigateOnDeleteExpense(goBackRoute) + InteractionManager.runAfterInteractions(() => deleteTransactions(...)) pair with a single Navigation.goBack(goBackRoute, {afterTransition: () => deleteTransactions(...)}), mirroring the whole-report branch a few lines below.
    2. Remove the now-unused InteractionManager import (the file's eslint-disable comment can come off too).
    3. Investigate why the Search → MoneyRequestReportView pop does not produce a transitionStart event. Likely candidates: the popping screen unmounts before the listeners in ScreenLayout fire, or it is rendered outside the PlatformStackNavigation wrapper that attaches the listeners. Once identified, ensure the listeners are attached on the right screen so the 1 s fallback is not relied on for the happy path. As a defensive fallback, the MAX_TRANSITION_START_WAIT_MS value could be reduced or the strategy could be replaced with a deferred requestAnimationFrame chain when no transition is in flight — but the real fix is making the screen emit transition events.

    What alternative solutions did you explore?


    Related issues

    • The PR's own test plan (Test 2 and Test 3 on #88538) describes the exact two scenarios that Applause is now flagging — suggesting these passed in the author's environment but regressed in QA, consistent with a transitionStart event mismatch by platform/layout.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/92036#issuecomment-PLACEHOLDER) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. collectioneur commented on May 29, 2026

    @collectioneur
    Contributor

    After investigating, I discovered that the goBack animation for RHPs (both wide and Super Wide) is now much faster. I tested these two flows using my reverted PR and an AdHoc build. The transaction/report does get deleted after the animation ends, exactly as intended. However, due to the increased speed of the transition, it creates a visual illusion that the deletion happens before the transition finishes. I've attached two videos demonstrating that the transaction correctly waits for the transition to end:

    2.mov

    Also, when the transition starts, an unrelated bug occurs (the overlay's opacity doesn't animate with the transition). This also contributes to the illusion that the transaction deletes before transitionEnd. As shown in the video, this is not the case, the transaction properly deletes after the transition:

    1.mov
  8. luacmartins commented on May 29, 2026

    @luacmartins
    Contributor

    @collectioneur maybe we just need to make the transition animation a bit slower? I feels kinda jerky now that it's too fast 😂

  9. luacmartins commented on May 29, 2026

    @luacmartins
    Contributor

    I don't think this is a blocker, but let's address this

  10. 32 remaining items

  11. melvin-bot commented on Jun 18, 2026

    @melvin-bot

    Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

  12. melvin-bot commented on Jun 19, 2026

    @melvin-bot

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

  13. mallenexpensify commented on Jun 20, 2026

    @mallenexpensify
    Contributor

    @daledah , or any other C+, due payment here? If so, how much? Plz link to PRs and address any regressions. Thx

  14. daledah commented on Jun 23, 2026

    @daledah
    Contributor

    @mallenexpensify Initially, this issue was considered a regression from PR #88538.

    However, after further investigation, the actual root cause was introduced in PR #90212, and it was subsequently fixed in PR #93020 (which I reviewed).

    Given that the regression was not caused by the PR I reviewed and that I reviewed the fix PR, I believe I should still be eligible for the standard C+ payment of $250 here.

  15. mallenexpensify commented on Jun 23, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @daledah due $250 via NewDot

    @daledah plz complete the BZ checklist and tag me in a post once you have. Thx

  16. daledah commented on Jun 24, 2026

    @daledah
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: N/A

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

    Regression Test Proposal

    Test:

    1. Create a new expense report with two expenses
    2. Navigate to the Spend/ Reports and open the report
    3. Click on one of the expenses to enter its transaction thread
    4. Inside the transaction thread, tap More → Delete
    5. Verify that: The transaction thread screen closes first, and only then the transaction entry disappears from the report view (the entry should not vanish while the transaction thread is still animating closed)
    6. Create a new expense report with two expenses
    7. Navigate to the Spend/ Reports and open the report
    8. Tap the More button - Delete
    9. Verify that: The report entry in Spend is removed only after the report screen has fully closed (the entry should remain visible during the closing transition and disappear afterward)

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-ff6a-a840-bbbe-847fe7e07dd4
  17. daledah commented on Jun 24, 2026

    @daledah
    Contributor

    @mallenexpensify i added the BZ checklist

  18. quinthar commented on Jun 29, 2026

    @quinthar
    Contributor

    Approved $250 to @daledah

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions