Skip to content

[Due for payment 2026-01-05] [$250] Reports - After going to Reports > Expenses offline, app auto opens Approve when online #76622

Closed

Description

@nlemma

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.71-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #75704
Email or phone of affected tester (no customers): sjdoisjdonisjdsoij@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 26.1 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with a new account.
  3. Do not create workspace. Do not go to Reports tab.
  4. Go offline.
  5. Go to Workspaces tab and create a workspace.
  6. Go to Reports.
  7. Go to a different tab on Reports (eg, Expenses or Reports).
  8. Go online.

Expected Result:

Reports will stay on the selected tab.

Actual Result:

Reports opens Approve tab.

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

Bug7019695_1764774986793.2.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @lydiabarclay

Activity

  1. added
    Daily
    Bug
    on Dec 3, 2025
  2. melvin-bot commented on Dec 3, 2025

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (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 Dec 3, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Reports - After going to Reports > Expenses offline, app auto opens Approve when online

    What is the root cause of that problem?

    The useSuggestedSearchDefaultNavigation hook auto-navigates to the default actionable search tab (Approve or Submit) whenever the skeleton loading state transitions from showing to hidden. However, the current condition only checks if the user is already on the default tab, but doesn't account for when the user has intentionally navigated to a different tab

    const defaultMenuItem = getDefaultActionableSearchMenuItem(flattenedMenuItems);
    if (!defaultMenuItem || similarSearchHash === defaultMenuItem.similarSearchHash) {
    return;
    }
    clearAllFilters();
    clearSelectedTransactions();
    Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: defaultMenuItem.searchQuery}));

    The condition similarSearchHash === defaultMenuItem.similarSearchHash evaluates to false because the user is on Expenses (not Approve), so the hook navigates to Approve, overriding the user selection

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

    We should skip the auto-navigation if the user is already viewing any search tab

            if (!defaultMenuItem || similarSearchHash) {
                return;
            }

    if (!defaultMenuItem || similarSearchHash === defaultMenuItem.similarSearchHash) {
    return;
    }

    What alternative solutions did you explore? (Optional)

    None

  4. added
    External
    on Dec 4, 2025
  5. melvin-bot commented on Dec 4, 2025

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  6. added
    Help Wanted
    on Dec 4, 2025
  7. melvin-bot commented on Dec 4, 2025

    @melvin-bot

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

  8. tsa321 commented on Dec 8, 2025

    @tsa321
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-12-08 02:31:32 UTC.

    Proposal

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

    On report after going online from offline, sidebar tab changes to approve

    What is the root cause of that problem?

    In this PR we add loading skeleton on the sidebar when workspace BE data is not ready yet:

    shouldShowSuggestedSearchSkeleton: !isSuggestedSearchDataReady && !isOffline,

    even optimistic workspace data is not enough. The workspace data must be from BE based on:

    const isSuggestedSearchDataReady = useMemo(() => {
    const policiesList = Object.values(allPolicies ?? {}).filter((policy): policy is NonNullable<typeof policy> => policy !== null && policy !== undefined);
    return policiesList.some((policy) => policy.employeeList !== undefined && policy.exporter !== undefined);
    }, [allPolicies]);

    So when user going online from offline, the displayed skeleton will be displayed and will reset the search default menu item,

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

    We could disable displaying the skeleton when the user is already in search page and when sidebar already displayed. We could add hasBeenDisplayed useRef and use it on shouldShowSuggestedSearchSkeleton:

    const hasBeenDisplayed = useRef(isSuggestedSearchDataReady || isOffline)
    const shouldShowSuggestedSearchSkeleton = useMemo(() => {
        return (!isSuggestedSearchDataReady && !isOffline) && !hasBeenDisplayed.current;
    }, [isOffline, isSuggestedSearchDataReady])

    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.

  9. brunovjk commented on Dec 8, 2025

    @brunovjk
    Contributor

    It's on my list, I'll review it in a moment.

  10. 10 remaining items

  11. added and removed
    Weekly
    on Jan 3, 2026
  12. melvin-bot commented on Jan 3, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @blimpich, @nyomanjyotisa, @brunovjk, @lydiabarclay eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  13. changed the title [-]Reports - After going to Reports > Expenses offline, app auto opens Approve when online[/-] [+][Due for payment 2026-01-05] [$250] Reports - After going to Reports > Expenses offline, app auto opens Approve when online[/+] on Jan 5, 2026
  14. melvin-bot commented on Jan 5, 2026

    @melvin-bot

    ⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

  15. added
    Awaiting Payment
    Weekly
    and removed
    Reviewing
    on Jan 5, 2026
  16. lydiabarclay commented on Jan 5, 2026

    @lydiabarclay
    Contributor

    Payment Summary

    Contributor: @nyomanjyotisa paid $250 via Upwork
    Contributor+: @brunovjk due $250 via NewDot

    ✅ Regression test filed

  17. nyomanjyotisa commented on Jan 6, 2026

    @nyomanjyotisa
    Member

    Thanks! Offer accepted

  18. brunovjk commented on Jan 6, 2026

    @brunovjk
    Contributor

    Requested :D

  19. twisterdotcom commented on Jan 6, 2026

    @twisterdotcom
    Contributor

    @brunovjk has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-3ed1-a964-91e8-ff68a6f657c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugExternalWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions