Skip to content

[Due for payment 2026-08-10] Expense - Contact name disappears in recipient list after reset app #97250

Closed

Description

@lanitochka17

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.4.45-4
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #96785
Email or phone of affected tester (no customers): soidjnsodjoisjiodjios@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. Open 1:1 DM with any user.
  3. Send a message to the user.
  4. Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh.
  5. Open FAB > Create expense > Manual.
  6. Enter amount > Next.
  7. Click To field.

Expected Result:

Contact name will not disappear in recipient list after reset app.

Actual Result:

Contact name disappears in recipient list after reset app.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7219950_1785250493134.15.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @shubham1206agra

Activity

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

    @melvin-bot

    @mountiny recently merged #96785, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on Jul 28, 2026

    @melvin-bot

    Triggered auto assignment to @rlinoz (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Jul 28, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 28, 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 Jul 28, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  7. MelvinBot commented on Jul 28, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug (fix is in Expensify/App)
    Causing PR: #96785 - "Coalesce OnyxDerived recomputations via microtask scheduling" by @fabioh8010 (High confidence)
    Related Issues: #97251 (duplicate — same repro, version 9.4.45-4, same suspected PR)

    Recommendation: REVERT

    PR #96785 re-lands the OnyxDerived recompute coalescing engine that was already reverted twice for causing a cluster of stale-derived-data deploy blockers, and this regression is the same failure class: after a cache reset, the DM's reportAttributes.isEmpty stays stale/true, so the 1:1 chat is filtered out of the recipient list. Reverting restores the per-dependency recompute that does not have this staleness window.

    Assigned: @fabioh8010 (PR author), @shubham1206agra and @mountiny (approving reviewers) from PR #96785
    Labels: No change. DeployBlockerCash kept (App deploy is correctly blocked for a frontend regression). DeployBlocker (Web) was not present, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    Verification

    The recipient list is built by OptionsListUtils, which filters reports via shouldReportBeInOptionList → reasonForReportToBeInOptionList in src/libs/ReportUtils.ts. A non-empty DM is dropped only when it is judged empty:

    • src/libs/ReportUtils.ts:9942 computes const isEmptyChat = isEmptyReport(report, isReportArchived);
    • src/libs/ReportUtils.ts:9996-10008 returns null (excludes the chat) when excludeEmptyChats && isEmptyChat && isChatReport(report) && … && canHideReport — this is what makes the contact name disappear from the "To" list.
    • isEmptyReport reads the derived value directly:
      src/libs/ReportUtils.ts:9187-9189 → const attributes = reportAttributesDerivedValue?.[report.reportID]; if (attributes) { return attributes.isEmpty; }

    So the option list's empty-chat filter is driven entirely by the REPORT_ATTRIBUTES derived value, and reportAttributes is one of the configs rewritten by PR #96785 (files changed include configs/reportAttributes.ts, configs/visibleReportActions.ts, configs/sortedReportActions.ts, and the coalescing engine OnyxDerived/index.ts + new getCollectionDelta.ts). Confirmed PR #96785 modifies these exact files.

    Root Cause

    PR #96785 stops using Onyx's own sourceValue and instead reconstructs the changed-member delta at flush time by diffing the current collection snapshot against a snapshot captured on the previous flush:

    • src/libs/actions/OnyxDerived/index.ts:80-81 — lastFlushedCollectionValues baseline + hasFlushedOnce flag are held in the per-key init() closure, created once at app startup.
    • src/libs/actions/OnyxDerived/index.ts:132-137 — once hasFlushedOnce is true, the delta is getCollectionDelta(current, lastFlushedCollectionValues[index]), and getCollectionDelta (src/libs/getCollectionDelta.ts:12-42) only emits members whose reference differs from the baseline.

    "Clear cache and restart → Reset and refresh" clears Onyx and re-broadcasts every collection member through the existing connection callbacks (the init() closures are not re-created, so hasFlushedOnce is already true and the pre-reset baselines are still in lastFlushedCollectionValues). During that re-broadcast burst, reportAttributes then relies on the coalesced delta to decide what to recompute:

    • src/libs/actions/OnyxDerived/configs/reportAttributes.ts:306 — useIncrementalUpdates is true whenever currentValue.reports is non-empty (which it is, restored from disk/prior compute).
    • src/libs/actions/OnyxDerived/configs/reportAttributes.ts:361-441 — in the incremental path, only reports appearing in the reconstructed sourceValues delta (report / report-action / metadata updates) are recomputed; if the delta for the DM's REPORT_ACTIONS member is lost or split across bursts (a known hazard the PR itself calls out for sortedReportActions/reportTransactionsAndViolations where coalescing "would drop the second trigger"), the DM's isEmpty is never recomputed and remains true from before the message/reset settled.

    With isEmpty stuck at true, reasonForReportToBeInOptionList filters the DM out at ReportUtils.ts:9996-10008, so the just-messaged contact vanishes from the manual-expense "To" recipient list — matching the report exactly, and matching the stale-derived-value class of the five blockers #96785 was meant to fix.

    Because the fix requires changing Expensify/App code (revert or repair the coalescing engine), this is a Frontend bug and DeployBlockerCash should remain.

    Recommendation detail: REVERT vs ROLL FORWARD

    REVERT is recommended over a targeted fix because (a) this exact coalescing mechanism has already produced multiple deploy blockers across two prior land/revert cycles, indicating the delta-reconstruction approach is fragile under full re-broadcast bursts; (b) a targeted fix would need to prove correctness of delta reconstruction after cache reset across every derived config, which is higher risk under deploy-blocker time pressure than restoring the known-good per-dependency recompute. If the perf win must be preserved, roll forward only with a fix that forces a full (non-incremental) recompute after a storage clear/re-broadcast.

  8. 8 remaining items

  9. fabioh8010 commented on Jul 28, 2026

    @fabioh8010
    Contributor

    PR ready #97283

  10. added and removed
    ReviewingHas a PR in review
    on Aug 3, 2026
  11. melvin-bot commented on Aug 3, 2026

    @melvin-bot

    @shubham1206agra

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

    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]. If no checklist is needed for this issue, you can click: [no checklist button]

  12. changed the title [-]Expense - Contact name disappears in recipient list after reset app[/-] [+][Due for payment 2026-08-10] Expense - Contact name disappears in recipient list after reset app[/+] on Aug 3, 2026
  13. shubham1206agra commented on Aug 4, 2026

    @shubham1206agra
    Contributor

    @mountiny You can close this issue

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