Skip to content

Chat - Skeleton loader appears when refreshing app #85867

Closed

Description

@vincdargento

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.41-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: N/A
Email or phone of affected tester (no customers): sijnisojnsiojdosjjo2@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Chat Report View

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to any chat.
  3. Refresh the page.

Expected Result:

App will load instantly without skeleton loader when refreshing the app.

Actual Result:

Skeleton loader appears in LHN and central pane when refreshing app.
Report header shows the report name, while the rest is skeleton loader.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

bug.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.
    on Mar 19, 2026
  2. melvin-bot commented on Mar 19, 2026

    @melvin-bot

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

  3. melvin-bot commented on Mar 19, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 19, 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.
  5. MelvinBot commented on Mar 19, 2026

    @MelvinBot
    Contributor

    Proposal

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

    On staging v9.3.41-0, refreshing the app shows a skeleton loader in the LHN and central pane. The report header shows the report name correctly, but the body and LHN show skeleton loaders. This does not happen on production.

    What is the root cause of that problem?

    The root cause is PR #84673 which removed REPORT_VIOLATIONS from ONYXKEYS.COLLECTION in ONYXKEYS.ts, but the reportAttributes derived value config still references it as a dependency (added by the earlier PR #85199).

    This creates an undefined entry in the reportAttributes dependency array at reportAttributes.ts:74. During derived value initialization in OnyxDerived/index.ts:86-132, the system tries to connect to undefined as an Onyx key via Onyx.connectWithoutView({ key: undefined }). This connection either errors out or never fires its callback, preventing connectionsEstablishedCount from reaching totalConnections (12). As a result, areAllConnectionsSet is never true, and the guard at line 71-74 causes recomputeDerivedValue to always return early — the reportAttributes derived value is never recomputed after startup.

    This breaks the data pipeline for the LHN:

    1. reportAttributes is never updated after initial cache restoration from IndexedDB
    2. useSidebarOrderedReports depends on reportAttributes for filtering and sorting LHN items
    3. With stale or absent reportAttributes, orderedReports may stay empty or take longer to populate
    4. Meanwhile, isLoadingReportData defaults to true (via const [isLoadingReportData = true] = useOnyx(...) at SidebarLinks.tsx:42) because IS_LOADING_REPORT_DATA is not in Onyx's initialKeyStates and loads asynchronously from IndexedDB
    5. Both conditions for the skeleton are met: isLoadingReportData === true && optionListItems?.length === 0 at SidebarLinks.tsx:102

    For the central pane skeleton: useOnyx returns undefined for reportMetadata before Onyx hydrates from storage, causing the destructuring default (isLoadingInitialReportActions: true, hasOnceLoadedReportActions: false) to apply at ReportScreen.tsx:127-135, which triggers the skeleton at ReportScreen.tsx:992-994.

    Note: A revert of #84673 was already merged to main via PR #85863, but it is not yet deployed to staging.

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

    Cherry-pick or deploy PR #85863 (the revert of #84673) to the staging branch. This restores ONYXKEYS.COLLECTION.REPORT_VIOLATIONS so the reportAttributes derived value's dependency array no longer contains undefined, allowing all 12 connections to initialize and areAllConnectionsSet to become true.

    What alternative solutions did you explore? (Optional)

    1. Add defensive handling in OnyxDerived/index.ts to skip undefined dependencies during init (e.g., if (!dependencyOnyxKey) { checkAndMarkConnectionInitialized(dependencyIndex); continue; }). This would make the derived value system resilient to missing dependencies but doesn't address the underlying issue of the removed Onyx key.

    2. Remove ONYXKEYS.COLLECTION.REPORT_VIOLATIONS from the reportAttributes dependency list in reportAttributes.ts. However, this would lose the field violation detection added by PR follow up: GBR appears when there is report field error #85199, which is needed for correct brick road indicators.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  6. vincdargento commented on Mar 19, 2026

    @vincdargento
    Author

    This issue was not reproducible in any snapshot build from the PR checklist (#85862), PR culprit was not found

  7. stitesExpensify commented on Mar 19, 2026

    @stitesExpensify
    Contributor

    The offending PR was reverted about an hour ago #85863

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions