Skip to content

[Due for payment 2025-10-28] [$250] Reports - Infinite skeleton loading on any Reports tab after going online #70887

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.2.15-12
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/folder/13176682/test-cases/41236550
Issue reported by: Applause - Internal Team

Action Performed:

  1. Sign in to ND (or go to Troubleshoot and clear cache)
  2. On the Inbox or Account page press CMD+D or tap four fingers and enable Force offline mode
  3. Navigate to the Reports tab - Expenses or any other tab
  4. "You appear to be offline" is displayed, go online
  5. Verify the page loads successfully

Expected Result:

The page loads successfully after going online

Actual Result:

The page in Reports tab shows infinite skeleton loading after going online. It loads after re-visiting the page. For expensifail accounts user's avatar is default in Chats

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6949574_1758296567171.Loading_reports.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021970142612481614536
  • Upwork Job ID: 1970142612481614536
  • Last Price Increase: 2025-09-22
Issue OwnerCurrent Issue Owner: @sakluger

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 19, 2025
  2. melvin-bot commented on Sep 19, 2025

    @melvin-bot

    Triggered auto assignment to @sakluger (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.

  3. nyomanjyotisa commented on Sep 19, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Reports - Infinite skeleton loading on any Reports tab after going online

    What is the root cause of that problem?

    We doesn't properly handle the offline-to-online transition here

    • While offline, no new search requests are made
    • The searchResults?.search.isLoading state from before going offline can remain true or undefined
    • When coming back online, if isLoading is still true AND data.length === 0, the component shows infinite skeleton loading
    • No new search request is triggered to clear the stale loading state

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

    Add an onReconnect callback to the useNetwork hook to trigger a search when the user comes back online

        const {isOffline} = useNetwork({
            onReconnect: useCallback(() => {
                handleSearch({queryJSON, searchKey, offset, shouldCalculateTotals});
            }, [handleSearch, queryJSON, searchKey, offset, shouldCalculateTotals])
        });

    const {isOffline} = useNetwork();

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    None

  4. bernhardoj commented on Sep 20, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Infinite skeleton shows in reports page after going online.

    What is the root cause of that problem?

    When we open the Reports page while offline, the Search API is not called.

    useEffect(() => {
    const focusedRoute = findFocusedRoute(navigationRef.getRootState());
    const isMigratedModalDisplayed = focusedRoute?.name === NAVIGATORS.MIGRATED_USER_MODAL_NAVIGATOR || focusedRoute?.name === SCREENS.MIGRATED_USER_WELCOME_MODAL.ROOT;
    if ((!isFocused && !isMigratedModalDisplayed) || isOffline) {
    return;
    }
    handleSearch({queryJSON, searchKey, offset, shouldCalculateTotals});
    // We don't need to run the effect on change of isFocused.
    // eslint-disable-next-line react-compiler/react-compiler
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [handleSearch, isOffline, offset, queryJSON, searchKey, shouldCalculateTotals]);

    When we go online from the debug modal page, the Search API is also not called because the page isn't focused. It shows the skeleton because the data is not loaded (isDataLoaded is false).

    const isDataLoaded = isSearchDataLoaded(searchResults, queryJSON);
    const shouldShowLoadingState = !isOffline && (!isDataLoaded || (!!searchResults?.search.isLoading && Array.isArray(searchResults?.data) && searchResults?.data.length === 0));

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

    We can call Search API even if it's not focused if we are going online and there is no result yet.

    const prevIsOffline = usePrevious(isOffline);
    ...
    const comingBackOnlineWithNoResults = prevIsOffline && !isOffline && searchResults === undefined;
    if (!comingBackOnlineWithNoResults && ((!isFocused && !isMigratedModalDisplayed) || isOffline)) {
        return;
    }
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A

    What alternative solutions did you explore? (Optional)

    We can add an exception for debug modal page too like isMigratedModalDisplayed, but it will still happen if we switch the network status manually.

    const isMigratedModalDisplayed = focusedRoute?.name === NAVIGATORS.MIGRATED_USER_MODAL_NAVIGATOR || focusedRoute?.name === SCREENS.MIGRATED_USER_WELCOME_MODAL.ROOT;
    if ((!isFocused && !isMigratedModalDisplayed) || isOffline) {
    return;
    }

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 22, 2025
  6. melvin-bot commented on Sep 22, 2025

    @melvin-bot
  7. changed the title [-]Reports - Infinite skeleton loading on any Reports tab after going online[/-] [+][$250] Reports - Infinite skeleton loading on any Reports tab after going online[/+] on Sep 22, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 22, 2025
  9. melvin-bot commented on Sep 22, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox (External)

  10. 21 remaining items

  11. melvin-bot commented on Oct 21, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  12. melvin-bot commented on Oct 21, 2025

    @melvin-bot

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

    For reference, here are some details about the assignees on this issue:

    • @suneox requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  13. melvin-bot commented on Oct 21, 2025

    @melvin-bot

    @suneox / @bernhardoj @sakluger The PR fixing this issue has been merged! 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]

  14. melvin-bot commented on Oct 28, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@sakluger)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1970142612481614536/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. suneox commented on Oct 29, 2025

    @suneox
    Contributor

    BugZero Checklist:

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

      Link to comment: I believe there is no specific PR responsible for this bug as it's an edge case that may have existed for a very long time. The PR that fixes this issue adds a case similar to issue [Due for payment 2025-08-07] Migrated users see prolonged Search loading #67040

    • [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: N/A

    • [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.

    Regression Test Proposal

    Precondition:

    • User signed in to Expensify app
    • User has at least one report in their account
    • Debug/troubleshoot mode accessible (CMD+D or 4-finger tap)

    Test:

    1. Go to Account tab -> Troubleshoot and clear cache)
    2. Enable Force offline mode (CMD+D or 4-finger tap on mobile)
    3. Navigate to Reports tab (Expenses or any other Reports tab)
    4. Verify "You appear to be offline" message is displayed
    5. Disable offline mode to go back online
    6. Verify the page loads successfully without infinite skeleton loading

    Do we agree 👍 or 👎

  16. sakluger commented on Oct 29, 2025

    @sakluger
    Contributor

    Thanks everyone, please use the payment summary above to request payment.

  17. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Oct 29, 2025
  18. bernhardoj commented on Oct 29, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  19. quinthar commented on Nov 2, 2025

    @quinthar
    Contributor

    $250 approved to @bernhardoj

  20. garrettmknight commented on Nov 21, 2025

    @garrettmknight
    Contributor

    $250 approved for @suneox

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions