Skip to content

[Due for payment 2026-09-03] Expense - x of 3 is shown after deleting the third expense #99617

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.62-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: #98611
Email or phone of affected tester (no customers): sdsiodjnosdjiodsj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create three expenses.
  4. Open the report.
  5. Open any expense.
  6. Navigate to all expenses via arrow.
  7. Click More > Delete > Delete.
  8. Open any expense.

Expected Result:

x of 2 will be shown after deleting the third expense.

Actual Result:

x of 3 is shown after deleting the third expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7243762_1787787921776.8.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @thelullabyy

Activity

  1. applause-bot commented on Aug 27, 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/25f62e774efe281d09e1e7c507440b005656ca8e5f9c37c6103159edba6466eb

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

    @melvin-bot

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

  4. melvin-bot commented on Aug 27, 2026

    @melvin-bot

    @JS00001 @ShridharGoel you have been assigned to this deploy blocker because you reviewed the offending PR: #98611

  5. github-actions commented on Aug 27, 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. melvin-bot commented on Aug 27, 2026

    @melvin-bot

    @thelullabyy you have been assigned to this deploy blocker because you authored the offending PR: #98611

  7. melvin-bot commented on Aug 27, 2026

    @melvin-bot

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

  8. MelvinBot commented on Aug 27, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #98611 - "Standardize Expense Report and Expense header with predictable button placement and carousel counter" by @thelullabyy (High confidence)
    Related Issues: Original issue fixed by the PR: #90366

    Recommendation: ROLL FORWARD

    The "x of N" counter regression is caused by a self-contained flaw in the new "preserve broader carousel" heuristic introduced by #98611. A targeted fix is far less disruptive than reverting this large header-standardization PR (which also fixed #96545, #96548, #96563, #96566, #96575 and touches every src/languages/* file). If a quick fix can't land, fall back to REVERT.

    Assigned: @thelullabyy (PR author), @ShridharGoel and @JS00001 (approving reviewers) — all already assigned by melvin-bot.
    Labels: No changes. This is a Frontend bug so DeployBlockerCash is kept (App deploy is correctly blocked). DeployBlocker was not present, and the issue is not reproducible in production, so no label is removed.

    📋 Detailed Analysis

    Evidence

    Verification

    Root Cause

    visualOrderTransactionIDs filters out deleted/pending-delete transactions (L576/L578), so after deleting the 3rd expense the report's own list correctly drops to 2 IDs. But both new guards decide whether to re-seed the carousel using a "subset means preserve the broader list" check:

    • List effect guard: latestActiveTransactionIDs.length >= visualOrderTransactionIDs.length && visualOrderTransactionIDs.every((id) => latestActiveTransactionIDs.includes(id)) → returns early.
    • shouldPreserveActiveTransactionIDs: activeIDs.length > candidateIDs.length && candidateIDs.every((id) => activeIDs.includes(id)) → returns true.

    After a deletion, the 2 remaining IDs are a strict subset of the stale 3-ID list, so both guards fire and the code does not call setActiveTransactionIDs. The Onyx list stays at 3 entries, and the counter keeps showing "x of 3".

    The heuristic was designed to avoid clobbering a broader carousel the user drilled in from (e.g. the Spend page). It cannot distinguish "user drilled into a narrower report" from "a transaction was just deleted from the current report" — both look like "current list is a subset of the active list."

    Suggested fix direction (roll forward)

    Re-seed the carousel when the shrink originates from the current report itself — e.g. only preserve the broader list when the active list contains IDs that are not part of the current report's transactions (a true drill-down), and always re-seed when the current report's own set of live transactions changed. A regression test in tests/unit/components/MoneyRequestReportTransactionsNavigation.test.tsx / tests/unit/hooks/useNavigateToTransactionThread.test.ts for the delete-within-report case should be added.

  9. m-natarajan commented on Aug 27, 2026

    @m-natarajan

    Issue not reproducible as "x of N" expense counter not displayed anymore in report view. Not repro on Win 11/Chrome build v9.4.62-4

    Recording.13.mp4
  10. added and removed
    ReviewingHas a PR in review
    on Aug 27, 2026
  11. changed the title [-]Expense - x of 3 is shown after deleting the third expense[/-] [+][Due for payment 2026-09-03] Expense - x of 3 is shown after deleting the third expense[/+] on Aug 27, 2026
  12. melvin-bot commented on Aug 27, 2026

    @melvin-bot

    @thelullabyy

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.62-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 2026-09-03. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions