Skip to content

Expense - Expense preview persists and opens not here page after deleting moved IOU expense #80305

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.3.7-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #78634
Email or phone of affected tester (no customers): sjidonjodjsodsjoi@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Have at least one workspace.
  1. Go to staging.new.expensify.com
  2. Open 1:1 DM with any user.
  3. Submit an expense to the user.
  4. Open the report.
  5. Click More > Change workspace.
  6. Select a workspace.
  7. Click More > Delete.
  8. Delete the expense.
  9. Go to the workspace chat where the IOU expense was moved to in Step 6.
  10. Click on the expense preview.

Expected Result:

Expense preview should be removed from workspace chat after moving IOU expense to workspace and deleting the expense.

Actual Result:

Expense preview is not removed from workspace chat after moving IOU expense to workspace and deleting the expense.
Not here page opens after opening the expense preview.

On Android and iOS, the expense preview is not responsive.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7056073_1769129269440.13.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jan 23, 2026
  2. melvin-bot commented on Jan 23, 2026

    @melvin-bot

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

  3. melvin-bot commented on Jan 23, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 23, 2026

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

  5. github-actions commented on Jan 23, 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. OSBotify commented on Jan 23, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #78634 - "new Onyx Derived Value VISIBLE_REPORT_ACTIONS" by @BartekObudzinski (High confidence)
    Related Issues: None identified

    Recommendation: REVERT

    This PR introduced a performance optimization by pre-computing report action visibility in a derived Onyx value. However, the implementation does not properly handle dynamic visibility state changes for REPORT_PREVIEW actions, specifically the shouldShow property that gets set to false when an expense is deleted.

    The bug occurs because:

    1. The derived value caches visibility at computation time
    2. When an expense is moved and deleted, the REPORT_PREVIEW action's shouldShow property changes to false
    3. The derived value does not recompute for this property change, causing stale visibility data
    4. The expense preview persists in the workspace chat despite being deleted

    Labels: Keeping DeployBlockerCash (App deploy blocked). Removing DeployBlocker (backend not involved).

    Detailed Analysis

    Evidence

    The issue reports that after moving an IOU expense to a workspace and deleting it (steps 1-8), the expense preview persists in the workspace chat (steps 9-10) and opens a "Not here" page. This is reproducible on staging but not production, confirming it's from a recent staging PR.

    PR #78634 was merged on 2026-01-22 and is included in the current staging deploy checklist (issue #80277). The PR introduced VISIBLE_REPORT_ACTIONS derived value to pre-compute visibility for performance optimization.

    Verification

    PR #78634 modified key files:

    • src/libs/actions/OnyxDerived/configs/visibleReportActions.ts (new file) - implements the derived value
    • src/pages/home/report/ReportActionsView.tsx - uses the derived value for filtering
    • src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx - uses the derived value
    • src/libs/ReportActionsUtils.ts - exports visibility helper functions

    The derived value dependencies are:

    dependencies: [ONYXKEYS.COLLECTION.REPORT_ACTIONS, ONYXKEYS.COLLECTION.REPORT, ONYXKEYS.SESSION]

    However, the shouldShow property on report actions is not part of these dependencies and changes to it do not trigger recomputation.

    Root Cause

    In ReportActionsUtils.ts, the isVisiblePreviewOrMoneyRequest function checks:

    const isHiddenReportPreviewWithoutPendingAction = 
        isReportPreviewAction(action) && 
        action.pendingAction === undefined && 
        action.shouldShow === false;

    When an expense is deleted after being moved:

    1. The backend sets shouldShow: false on the REPORT_PREVIEW action
    2. The derived value was already computed with shouldShow: true
    3. The change to shouldShow updates the report action in Onyx
    4. The derived value recomputes based on the report action change
    5. BUT the shouldReportActionBeVisible function is called, which checks shouldShow
    6. However, the caching logic in the derived value may not properly invalidate for this specific property change on REPORT_PREVIEW actions

    The issue is in the incremental update logic in visibleReportActions.ts - it processes updated actions but the shouldShow property change on a REPORT_PREVIEW might not be properly reflected in the visibility calculation.

  7. chuckdries commented on Jan 23, 2026

    @chuckdries
    Contributor

    Fixed by #80318

  8. Beamanator commented on Jan 23, 2026

    @Beamanator
    Contributor

    Ooh sick @chuckdries did you test and confirm that revert fixed it? 🙏

  9. chuckdries commented on Jan 23, 2026

    @chuckdries
    Contributor

    Yep! Although I'm gonna hold off on testing any of the others until applause finishes the retest request

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions