Skip to content

[Due for payment 2025-11-03] [$250] Android - Reports - Skeleton loader constantly shown when switching reports with arrow navigation #71268

Closed

Description

@jponikarchuk

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.18-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-935/folder/13176730/41237115/915651817
Email or phone of affected tester (no customers): ibellicotest+1844@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 (Hybrid app)
App Component: Search

Action Performed:

Prerequisite: Account has at least one workspace.
Prerequisite 2: Delayed submissions and approvals enabled.

  1. Open the Expensify app.
  2. Open any workspace chat.
  3. Create two manual expenses.
  4. Navigate to "Reports" > "Submit"
  5. Tap on FAB and select "Create Report"
  6. Add a manual expense to report.
  7. Note that when you land on report again, arrows to navigate between reports appear on top of report.
  8. Use arrow navigation several times, to switch between both reports.
  9. Note that after switching between reports a few times, skeleton loader appears constantly when navigating to the last created report.

Expected Result:

Skeleton loader shouldn´t be displayed when navigating between reports using arrow navigation.

Actual Result:

When creating a second report while on "Reports" > "Submit" and navigating between reports with arrow navigation, skeleton loader is displayed everytime the user navigates to the last created report.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021973461503559490277
  • Upwork Job ID: 1973461503559490277
  • Last Price Increase: 2025-10-15
  • Automatic offers:
    • situchan | Contributor | 109120735
    • huult | Contributor | 109208307
Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    Daily
    Bug
    on Sep 25, 2025
  2. melvin-bot commented on Sep 25, 2025

    @melvin-bot

    Triggered auto assignment to @CortneyOfstad (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. melvin-bot commented on Sep 30, 2025

    @melvin-bot

    @CortneyOfstad Eep! 4 days overdue now. Issues have feelings too...

  4. CortneyOfstad commented on Oct 1, 2025

    @CortneyOfstad
    Contributor

    Getting eyes on this!

  5. added
    External
    on Oct 1, 2025
  6. changed the title [-]Android - Reports - Skeleton loader constantly shown when switching reports with arrow navigation[/-] [+][$250] Android - Reports - Skeleton loader constantly shown when switching reports with arrow navigation[/+] on Oct 1, 2025
  7. melvin-bot commented on Oct 1, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Oct 1, 2025
  9. melvin-bot commented on Oct 1, 2025

    @melvin-bot

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

  10. huult commented on Oct 2, 2025

    @huult
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-10-02 16:10:16 UTC.

    Proposal

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

    Skeleton loader constantly shown when switching reports with arrow navigation

    What is the root cause of that problem?

    When we navigate quickly using the arrow buttons, the route parameter updates immediately, but the Onyx data for the report may take a short time to update around 0.16s to 0.25s

    Navigation.setParams({
    reportID: reportId,
    });

    reportIDFromRoute is the new report ID (from the route params)

    report?.reportID is still the old report ID (from Onyx data that hasn't updated yet)

    const shouldWaitForReportSync = report?.reportID !== reportIDFromRoute;

    This makes shouldWaitForReportSync return true

    if (!!(isLoadingInitialReportActions && reportActions.length === 0 && !isOffline) || shouldWaitForTransactions || shouldWaitForReportSync) {

    This triggers the skeleton loader, which is why we see the loading skeleton. If we click normally, the skeleton doesn’t appear. This issue only occurs with rapid clicks, making the UI seem slower than it actually is.

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

    To resolve this issue, we should debounce the shouldWaitForReportSync to avoid skeleton flashing during rapid navigation

    const shouldWaitForReportSync = report?.reportID !== reportIDFromRoute;

        const shouldWaitForReportSync = report?.reportID !== reportIDFromRoute;
    
        const [debouncedShouldWaitForReportSync, setDebouncedShouldWaitForReportSync] = useState(false);
        const debounceTimeoutRef = useRef<NodeJS.Timeout | undefined>(undefined);
    
        // Debounce the shouldWaitForReportSync to avoid skeleton flashing during rapid navigation
        useEffect(() => {
            // Clear any existing timeout
            if (debounceTimeoutRef.current) {
                clearTimeout(debounceTimeoutRef.current);
            }
    
            if (shouldWaitForReportSync) {
                // Only show skeleton after a short delay (300ms) to avoid flashing during rapid navigation
                debounceTimeoutRef.current = setTimeout(() => {
                    setDebouncedShouldWaitForReportSync(true);
                }, 300);
            } else {
                // Immediately hide skeleton when sync is complete
                setDebouncedShouldWaitForReportSync(false);
            }
    
            return () => {
                if (!debounceTimeoutRef.current) {
                    return;
                }
                clearTimeout(debounceTimeoutRef.current);
            };
        }, [shouldWaitForReportSync]);

    shouldWaitForReportSync={shouldWaitForReportSync}

    to

    shouldWaitForReportSync={debouncedShouldWaitForReportSync}

    Note: We will apply a debounce solution; the current source code will implement it in a PR if available.

    Screen.Recording.2025-10-02.at.23.22.20.mov

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

    Solution 1: Use reportCache in SearchMoneyRequestReportPage so that shouldWaitForReportSync is false. This way, we don’t need to wait and the loading skeleton won’t appear
    Solution 2: Debounce goToNextReport and goToPrevReport
    Solution 3: we should add a short delay when clicking the arrow buttons to reduce render load and lighten the UI performance impact.

    Navigation.setParams({
    reportID: reportId,
    });

            InteractionManager.runAfterInteractions(() => {
                requestAnimationFrame(() => {
                    Navigation.setParams({
                        reportID: reportId,
                    });
                });
            });

    Solution 4: Remove check shouldWaitForReportSync={shouldWaitForReportSync}

  11. 40 remaining items

  12. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Oct 27, 2025
  13. changed the title [-][$250] Android - Reports - Skeleton loader constantly shown when switching reports with arrow navigation[/-] [+][Due for payment 2025-11-03] [$250] Android - Reports - Skeleton loader constantly shown when switching reports with arrow navigation[/+] on Oct 27, 2025
  14. removed
    Reviewing
    on Oct 27, 2025
  15. melvin-bot commented on Oct 27, 2025

    @melvin-bot

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

  16. melvin-bot commented on Oct 27, 2025

    @melvin-bot

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

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

  17. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    @situchan @CortneyOfstad 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]

  18. CortneyOfstad commented on Oct 28, 2025

    @CortneyOfstad
    Contributor

    Hey @situchan! Please complete the checklist before Nov 3 so there is no delay in the payment summary. Thank you!

  19. added
    Daily
    and removed
    Weekly
    on Nov 2, 2025
  20. situchan commented on Nov 3, 2025

    @situchan
    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: Add ability to cycle via reports v2 #69221 (comment)

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

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    1. Account has at least one workspace.
    2. Delayed submissions and approvals enabled.

    Test:

    1. Open workspace chat.
    2. Create two manual expenses.
    3. Navigate to "Reports" > "Submit"
    4. Tap on FAB and select "Create Report"
    5. Add a manual expense to report.
    6. Note that when you land on report again, arrows to navigate between reports appear on top of report.
    7. Use arrow navigation several times, to switch between both reports.
    8. Verify that while navigating between reports several times, skeleton loader doesn't show.

    Do we agree 👍 or 👎

  21. CortneyOfstad commented on Nov 3, 2025

    @CortneyOfstad
    Contributor

    Payment Summary

    @huult — paid $250 via Upwork
    @situchan — paid $250 via Upwork

    Regression Test

    https://github.com/Expensify/Expensify/issues/564528

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions