Skip to content

[Due for payment 2026-07-16] [$250] Spend-"Something went wrong" screen for a failing query flashes #92462

Closed

Description

@applause-bot

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.97-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: https://test-management.browserstack.com/projects/2219752/folder/13176922/test-cases/41237516
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: iPhone 15 iOS 26.5
App Component: Search

Action Performed:

  1. Sign in to ND
  2. Create a workspace
  3. Go to Spend tab/ Expenses
  4. Type "type:chat category:abcd" in the search field, apply the search

Expected Result:

"Something went wrong" page appears and does not flash

Actual Result:

"Something went wrong" page flashes

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7170088_1780453295881.Flashes.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7170088

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @QichenZhu

Activity

  1. applause-bot commented on Jun 3, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/32ec2cac45ba9245f03eacdf9fee4c6f9bdbf239583c023fddd5180354c06784

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 3, 2026
  3. MelvinBot commented on Jun 3, 2026

    @MelvinBot
    Contributor

    Proposal

    Preliminary analysis — medium confidence. I traced the error-rendering path with code evidence, but the exact frame-timing is iOS-specific (the bug only repros on iOS: App), so the fix below is a strong direction to validate on an iOS build rather than a certainty.

    What is the root cause of that problem?

    The "Something went wrong" page is FullPageErrorView, and Search renders it whenever the current search snapshot has any errors — that branch is gated only on hasErrors, with no guard for the "request still in flight" state.

    The flash happens because searchResults.errors is toggled on every search round-trip: each search() call optimistically clears it (errors: null), and the failure response re-sets it. So as the failing query moves through loading → error (and across any re-render/re-request), the errors key briefly clears and the error page unmounts for a frame before reappearing — the visible flash.

    The app already has machinery meant to defer the error UI until the response is confirmed (hasUnresolvedErrors = hasErrors && searchRequestResponseStatusCode === null, which feeds shouldShowLoadingState). But that guard is never applied to the error render branch, and the narrow/mobile page used on iOS never resets searchRequestResponseStatusCode to null at the start of a search — unlike the wide page. So the === null window that's supposed to keep the skeleton up never opens on iOS, which fits the iOS‑App‑only repro.

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

    1. In SearchPageNarrow's handleSearchAction, reset searchRequestResponseStatusCode to null before calling search(), matching the wide page.
    2. Gate the error branch so the page renders only after the search settles (i.e. don't render FullPageErrorView while the search is still in its loading/transition state), so the transient clear/loading frames show the skeleton instead of flashing the error page.

    Together these aim to make the error page appear once, after the response is confirmed, instead of flickering during the transition.

    What alternative solutions did you explore? (Optional)

    Keeping the previously-shown error visible during an immediate re-search (instead of optimistically clearing errors) would also remove the flash, but it's more invasive than the gating approach above.

    Code references & evidence chain

    SHA: b8898bf30ca7cf361f146cc13018b050b124669a

    Open question to confirm on an iOS build: what triggers the extra search round-trip (or render) that clears errors mid-flow on iOS. The totals/group retry path doesn't apply to a type:chat query (shouldCalculateTotals/validGroupBy are both false), so the trigger is likely platform render/Onyx-propagation timing. The existing [Search] Showing skeleton log (index.tsx:694) can be used to observe the transition order during a repro.

    I also ruled out the canned-query reset effect (index.tsx:1432): it only fires on route / (the reports home) or when shouldResetSearchQuery is set, neither of which applies to a typed query submitted on the /search page.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/92462) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 3, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 3, 2026
  6. mukhrr commented on Jun 3, 2026

    @mukhrr
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-06-03 03:01:17 UTC.

    Proposal

    What is the root cause of that problem?

    The initial search() for a query is issued at the page level by useSearchPageSetup before Search mounts, but Search kept its own mount-time effect that re-issues the same query as soon as it mounts. That call is redundant — Search only ever mounts under SearchPage, keyed by queryJSON.hash, always after the page-level request was already issued.

    The redundant call produces both symptoms:

    • Failing query: the page-level request fails; failureData deletes snapshot.data and writes snapshot.errors. useSearchLoadingState deliberately lets Search mount when errors are present so it can render FullPageErrorView. On mount, the redundant effect re-issues the failing query; its optimisticData sets errors: null, putting the snapshot back to "no data, no errors" → the skeleton replaces the error view → the request fails again → error view → remount → re-issue — an infinite loop of flashing screens and network requests.
    • Normal query: Search mounts after the first request resolved, so the in-flight dedupe in search() can't catch it → one duplicate API request per search.

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

    1. Make useSearchPageSetup the single owner of every initial (offset 0) fetch — including the cached-snapshot refresh.

    Remove the mount-time handleSearch() from Search. On its own, that removal leaves one gap: on main, the mount-time call also refreshed an already-cached snapshot whenever Search remounted (e.g. flipping Expenses ↔ Reports tabs), which is how rows added/removed elsewhere show up. Onyx mirrors edits to existing snapshot rows automatically, but membership changes need a re-search — pure removal would leave revisited tabs stale.

    So the page hook gets a per-instance lastFetchedHashRef tracking the last hash it fetched. Navigating to a hash it hasn't fetched fires search() even when a cached snapshot exists (the refresh main did on remount); dep-driven re-runs for the same hash (load completion, failure, reconnect) are blocked by the ref:

    -        if (isSnapshotDataLoaded || isSnapshotSearchLoading) {
    +        if (isSnapshotSearchLoading) {
                 return;
             }
    +
    +        // A loaded snapshot only blocks re-runs for the hash we already fetched; navigating (back)
    +        // to a cached hash still goes through, so it gets the refresh the Search component's
    +        // mount-time fetch used to provide. Unloaded snapshots can always (re)fire — that keeps
    +        // the reconnect recovery for queries that never finished loading while offline.
    +        if (isSnapshotDataLoaded && lastFetchedHashRef.current === hash) {
    +            return;
    +        }
    +
    +        lastFetchedHashRef.current = hash;
             const shouldSkipWaitForWrites = hasDeferredWrite(CONST.DEFERRED_LAYOUT_WRITE_KEYS.SEARCH);

    Loop-safety, verified against the Onyx writes: failureData keeps search.type/search.status and sets errors, so isSearchDataLoaded treats a failed snapshot as loaded — with the ref blocking same-hash re-runs, nothing re-issues the failed query and the error page renders once and stays. Revisiting a previously failed tab retries it once (a fresh attempt), never loops.

    2. Search keeps only the fetches the page hook can't know about, each as its own single-trigger effect — pagination, reconnect refresh, and the totals/grouped retry flag:

    -    useEffect(() => {
    -        const focusedRoute = findFocusedRoute(navigationRef.getRootState());
    -        const isMigratedModalDisplayed = focusedRoute?.name === NAVIGATORS.MIGRATED_USER_MODAL_NAVIGATOR || focusedRoute?.name === SCREENS.MIGRATED_USER_WELCOME_MODAL.ROOT;
    -
    -        const comingBackOnlineWithNoResults = prevIsOffline && !isOffline && isEmptyObject(searchResults?.data);
    -        if (!comingBackOnlineWithNoResults && ((!isFocused && !isMigratedModalDisplayed) || isOffline)) {
    -            return;
    -        }
    -
    -        if (hasPendingWriteOnMountRef.current.hasPendingWriteOnMount && hasDeferredWrite(CONST.DEFERRED_LAYOUT_WRITE_KEYS.SEARCH)) {
    -            return;
    -        }
    -
    -        if (searchResults?.search?.isLoading) {
    -            if (validGroupBy || (shouldCalculateTotals && searchResults?.search?.count === undefined)) {
    -                shouldRetrySearchWithTotalsOrGroupedRef.current = true;
    -            }
    -            return;
    -        }
    -
    -        handleSearch({queryJSON, searchKey: currentSearchKey, offset, shouldCalculateTotals, prevReportsLength: filteredDataLength, isLoading: !!searchResults?.search?.isLoading});
    -        // eslint-disable-next-line react-hooks/exhaustive-deps
    -    }, [handleSearch, isOffline, offset, queryJSON, currentSearchKey, shouldCalculateTotals, validGroupBy]);
    +    // The initial (offset 0) fetch is owned by useSearchPageSetup at the page level — Search only
    +    // mounts under SearchPage (keyed by queryJSON.hash), after that request has already been issued.
    +
    +    // Pagination: fetch the next page when fetchMoreResults advances the offset.
    +    useEffect(() => {
    +        if (offset === 0 || !isFocused || isOffline || searchResults?.search?.isLoading) {
    +            return;
    +        }
    +        handleSearch({queryJSON, searchKey: currentSearchKey, offset, shouldCalculateTotals, prevReportsLength: filteredDataLength, isLoading: !!searchResults?.search?.isLoading});
    +        // We don't need to run the effect on change of isFocused or isLoading.
    +        // eslint-disable-next-line react-hooks/exhaustive-deps
    +    }, [handleSearch, isOffline, offset, queryJSON, currentSearchKey, shouldCalculateTotals]);
    +
    +    // Reconnect: refresh the current page when coming back online. Unloaded offset-0 queries are
    +    // already re-fired on reconnect by useSearchPageSetup, which keeps `isOffline` in its deps.
    +    useEffect(() => {
    +        if (!prevIsOffline || isOffline || !isFocused || searchResults?.search?.isLoading) {
    +            return;
    +        }
    +        handleSearch({queryJSON, searchKey: currentSearchKey, offset, shouldCalculateTotals, prevReportsLength: filteredDataLength, isLoading: !!searchResults?.search?.isLoading});
    +        // Only the offline -> online transition should trigger this refresh.
    +        // eslint-disable-next-line react-hooks/exhaustive-deps
    +    }, [isOffline, prevIsOffline]);
    +
    +    // While a search issued elsewhere is in flight without the totals/grouped data we need,
    +    // flag it so the existing retry effect below re-queries once it resolves.
    +    useEffect(() => {
    +        if (!searchResults?.search?.isLoading) {
    +            return;
    +        }
    +        if (validGroupBy || (shouldCalculateTotals && searchResults?.search?.count === undefined)) {
    +            shouldRetrySearchWithTotalsOrGroupedRef.current = true;
    +        }
    +    }, [searchResults?.search?.isLoading, searchResults?.search?.count, shouldCalculateTotals, validGroupBy]);

    fetchMoreResults stays offset-only, so offline load-more behaves like main: scrolling offline only advances the offset, and the pending page fetches once on reconnect.

    The two mount-time special cases existed only to serve the redundant call and are deleted with it, with their original jobs verified covered:

    3. Companion fix: SearchPageNarrow's handleSearchAction doesn't clear searchRequestResponseStatusCode before re-searching, unlike SearchPage's, so a stale status code can leak into the next request's error state:

             } else {
    +            setSearchRequestResponseStatusCode(null);
                 search(value)?.then((jsonCode) => setSearchRequestResponseStatusCode(Number(jsonCode ?? 0)));
             }

    What alternative solutions did you explore? (Optional)

    n/a

  7. yusufdeveloper2903 commented on Jun 3, 2026

    @yusufdeveloper2903
    Contributor

    Proposal

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

    When a search query fails (e.g. type:chat category:abcd, which the backend rejects with INVALID_SEARCH_QUERY), the "Something went wrong" error page does not stay on screen — it flashes/flickers, repeatedly toggling with the loading skeleton instead of rendering stably.

    What is the root cause of that problem?

    The flash is a self‑perpetuating skeleton ↔ error‑page loop that is unique to failing queries. It comes from three pieces of code interacting:

    1. A failed search deletes data from the snapshot.
    The failureData for the Search request merges data: null into the snapshot:

    const failureData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.SNAPSHOT>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
    value: {
    ...(isOffline ? {} : {data: null}),
    search: {
    status: queryJSON?.status,
    type: queryJSON?.type,
    ...(isSearchAPI && {isLoading: false}),
    },
    errors: getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'),
    },
    },
    ];

    In Onyx, merging null for a key deletes it, so after a failure searchResults.data === undefined (not an empty array). A successful search instead sets data to a defined value — this asymmetry is the seed of the bug.

    2. The page‑level skeleton gate treats "no data + no errors" as "still loading".
    The narrow page chooses between the page skeleton and mounting <Search> (which renders the FullPageErrorView) using useSearchLoadingState:

    const hasNoData = searchResults?.data === undefined;
    const validGroupBy = getValidGroupBy(queryJSON.groupBy);
    const isCardFeedsLoading = validGroupBy === CONST.SEARCH.GROUP_BY.CARD && cardFeedsResult?.status === 'loading';
    const hasErrors = Object.keys(searchResults?.errors ?? {}).length > 0;
    // Show page-level skeleton when no data has ever arrived for this query,
    // or when card feeds are still loading for card-grouped searches.
    // Once data arrives (even empty []), Search mounts and handles its own
    // loading/empty states internally via shouldShowLoadingState.
    // When errors are present, let Search mount so it can render FullPageErrorView.
    return (hasNoData && !hasErrors) || isCardFeedsLoading;

    const hasNoData = searchResults?.data === undefined;
    const hasErrors = Object.keys(searchResults?.errors ?? {}).length > 0;
    return (hasNoData && !hasErrors) || isCardFeedsLoading;

    It returns true (→ show page skeleton, unmount <Search> and its error view) whenever there is no data and no errors. This is reinforced one level up in SearchPage, which only forwards searchResults when there is data or errors, and forwards undefined otherwise:

    let searchResults: SearchResults | undefined;
    if (currentSearchResults?.data != null || currentSearchResults?.errors) {
    searchResults = currentSearchResults;
    } else if (isSorting) {
    searchResults = lastNonEmptySearchResults;
    }

    The skeleton ↔ error swap happens here:

    {!useStaticRendering && (
    <>
    {shouldShowLoadingSkeleton ? (
    <SearchLoadingSkeleton
    containerStyle={styles.searchListContentContainerStyles(hasFilterBars)}
    reasonAttributes={{
    context: 'SearchPage',
    isOffline,
    isDataLoaded,
    isSearchLoading: !!searchResults?.search?.isLoading,
    hasEmptyData: Array.isArray(searchResults?.data) && searchResults?.data.length === 0,
    hasErrors: Object.keys(searchResults?.errors ?? {}).length > 0 && !isOffline,
    hasPendingResponse: searchRequestResponseStatusCode === null,
    shouldUseLiveData,
    }}
    />
    ) : (
    <SearchWithNavigationDeferredMount
    searchResults={searchResults}
    queryJSON={queryJSON}
    key={queryJSON.hash}
    onSearchListScroll={scrollHandler}
    contentContainerStyle={contentContainerStyle}
    handleSearch={handleSearchAction}
    isMobileSelectionModeEnabled={isMobileSelectionModeEnabled}
    searchRequestResponseStatusCode={searchRequestResponseStatusCode}
    onDestinationVisible={endSubmitNavigationSpans}
    onContentReady={onSearchContentReady}
    hasFilterBars={hasFilterBars}
    />
    )}

    3. <Search> re‑fires the search every time it mounts — even for an already‑errored query.
    When <Search> mounts (which, for a failing query, only happens after the error has arrived), this effect runs and unconditionally calls handleSearch because searchResults.search.isLoading is already false:

    useEffect(() => {
    const focusedRoute = findFocusedRoute(navigationRef.getRootState());
    const isMigratedModalDisplayed = focusedRoute?.name === NAVIGATORS.MIGRATED_USER_MODAL_NAVIGATOR || focusedRoute?.name === SCREENS.MIGRATED_USER_WELCOME_MODAL.ROOT;
    const comingBackOnlineWithNoResults = prevIsOffline && !isOffline && isEmptyObject(searchResults?.data);
    if (!comingBackOnlineWithNoResults && ((!isFocused && !isMigratedModalDisplayed) || isOffline)) {
    return;
    }
    // When mounting after the pre-insert fast path, the deferred write hasn't
    // been flushed yet. Triggering a search now would race with the CREATE
    // API call and return stale results that overwrite the optimistic row.
    // Skip this call; the optimistic data from flushDeferredWrite will populate
    // the list, and the next user-driven search will refresh from the server.
    if (hasPendingWriteOnMountRef.current.hasPendingWriteOnMount && hasDeferredWrite(CONST.DEFERRED_LAYOUT_WRITE_KEYS.SEARCH)) {
    return;
    }
    if (searchResults?.search?.isLoading) {
    if (validGroupBy || (shouldCalculateTotals && searchResults?.search?.count === undefined)) {
    shouldRetrySearchWithTotalsOrGroupedRef.current = true;
    }
    return;
    }
    handleSearch({
    queryJSON,
    searchKey: currentSearchKey,
    offset,
    shouldCalculateTotals,
    prevReportsLength: filteredDataLength,
    isLoading: !!searchResults?.search?.isLoading,
    });
    // We don't need to run the effect on change of isFocused.
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [handleSearch, isOffline, offset, queryJSON, currentSearchKey, shouldCalculateTotals, validGroupBy]);

    That redundant re‑search applies optimisticData, which clears errors (errors: null) and sets isLoading: true:

    const shouldClearTotals = isSearchAPI && shouldCalculateTotals === false && offset === 0;
    const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.SNAPSHOT>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
    value: {
    search: {
    ...(isSearchAPI && {isLoading: true}),
    ...(offset !== undefined ? {offset} : {}),
    ...(shouldClearTotals ? {count: null, total: null, currency: null} : {}),
    },
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
    value: {
    errors: null,
    },
    },
    ];

    The error page itself is rendered here:

    if (hasErrors) {
    const isInvalidQuery = searchRequestResponseStatusCode === CONST.JSON_CODE.INVALID_SEARCH_QUERY;
    cancelNavigationSpans();
    return (
    <View style={[shouldUseNarrowLayout ? styles.searchListContentContainerStyles(!!hasFilterBars) : styles.mt3, styles.flex1]}>
    <FullPageErrorView
    shouldShow
    containerStyle={styles.searchBlockingErrorViewContainer}
    subtitleStyle={styles.textSupporting}
    title={translate('errorPage.title', {
    isBreakLine: shouldUseNarrowLayout,
    })}
    subtitle={translate(isInvalidQuery ? 'errorPage.wrongTypeSubtitle' : 'errorPage.subtitle')}
    />
    </View>
    );
    }

    Putting it together — the loop for a failing query:

    1. User applies the query → first search() runs → optimistic (data undefined, errors: null, loading) → page skeleton.
    2. Backend rejects with INVALID_SEARCH_QUERY → failureData merges (data deleted → undefined, errors set, loading false) → useSearchLoadingState returns false → <Search> mounts → error page appears. ✅
    3. <Search>'s mount effect (index.tsx#L704) fires a redundant re‑search → optimistic clears errors to null, data is still undefined → state is now "no data and no errors" → SearchPage forwards undefined / useSearchLoadingState returns true → page skeleton, <Search> unmounts → error page disappears (flash).
    4. The re‑search fails again → errors set → <Search> remounts → its mount effect fires another re‑search → back to step 3 → continuous flashing.

    A successful query never flashes because step 2 sets data to a defined value, so the re‑search in step 3 keeps hasNoData === false; <Search> stays mounted and just refreshes in place. The flash is therefore specific to failed queries, exactly as reported.

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

    Break the loop at its source: do not re‑fire a search for a query whose latest result already errored. There is no value in immediately re‑running a query the server just rejected, and doing so is what clears errors, collapses the state to "no data + no errors", and unmounts the error view.

    In src/components/Search/index.tsx, add a hasErrors early‑return to the search‑triggering effect (L704):

    useEffect(() => {
        const focusedRoute = findFocusedRoute(navigationRef.getRootState());
        const isMigratedModalDisplayed = /* ... */;
    
        const comingBackOnlineWithNoResults = prevIsOffline && !isOffline && isEmptyObject(searchResults?.data);
        if (!comingBackOnlineWithNoResults && ((!isFocused && !isMigratedModalDisplayed) || isOffline)) {
            return;
        }
    
        // The current query already resolved with an error; re-running it here would clear
        // `errors` optimistically, unmount FullPageErrorView and cause the page to flash
        // between the skeleton and the error screen. The user can re-submit to retry.
        if (hasErrors) {
            return;
        }
    
        if (hasPendingWriteOnMountRef.current.hasPendingWriteOnMount && hasDeferredWrite(CONST.DEFERRED_LAYOUT_WRITE_KEYS.SEARCH)) {
            return;
        }
    
        if (searchResults?.search?.isLoading) {
            /* ...unchanged... */
            return;
        }
    
        handleSearch({ /* ...unchanged... */ });
        // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [handleSearch, isOffline, offset, queryJSON, currentSearchKey, shouldCalculateTotals, validGroupBy, hasErrors]);

    The same guard should be applied to the totals/grouped retry effect so it can't re‑search an errored result either:

    useEffect(() => {
    if (!shouldRetrySearchWithTotalsOrGroupedRef.current || searchResults?.search?.isLoading || (!shouldCalculateTotals && !validGroupBy)) {
    return;
    }
    // If count is already present, the latest response already contains totals and we can skip the re-query.
    // If we show grouped values we want to retry search either way, the data may be outdated e.g. after deleting an expense.
    if (!validGroupBy && searchResults?.search?.count !== undefined) {
    shouldRetrySearchWithTotalsOrGroupedRef.current = false;
    return;
    }
    shouldRetrySearchWithTotalsOrGroupedRef.current = false;
    handleSearch({
    queryJSON,
    searchKey: currentSearchKey,
    offset,
    shouldCalculateTotals: true,
    prevReportsLength: filteredDataLength,
    isLoading: false,
    });
    }, [filteredDataLength, handleSearch, offset, queryJSON, currentSearchKey, searchResults?.search?.count, searchResults?.search?.isLoading, shouldCalculateTotals, validGroupBy]);

    useEffect(() => {
        if (!shouldRetrySearchWithTotalsOrGroupedRef.current || hasErrors || searchResults?.search?.isLoading || (!shouldCalculateTotals && !validGroupBy)) {
            return;
        }
        /* ... */
    }, [/* ..., */ hasErrors]);

    With this guard, after step 2 above <Search> mounts, the effect sees hasErrors === true and returns without re‑searching. errors is never cleared, the page never swaps back to the skeleton, and the "Something went wrong" screen renders stably — matching the expected result.

    Why this is the right layer: the flash is caused by a needless re‑request, not by the rendering logic. Editing the query to something valid still works (that's a new hash → new search triggered by the router submit / queryJSON change with hasErrors === false), and the legitimate offline→online recovery path (comingBackOnlineWithNoResults) is untouched.

    Edge cases covered:

    • Offline: hasErrors is already gated by !isOffline (index.tsx#L435), so offline behaviour is unchanged; the offline error/empty handling and the comingBackOnlineWithNoResults retry still fire.
    • Valid queries (incl. empty results): unaffected — hasErrors is false, so the effect behaves exactly as today.
    • Retry after a transient/server error: the user re‑submitting the same query goes through the router (handleSearchAction), which calls search() directly and is not blocked by this effect.
    • Platforms: the fix is in shared logic (Search/index.tsx), so it covers iOS App (reported) plus every other platform.

    Optional hardening (defense‑in‑depth): the underlying fragility is that a "resolved‑with‑error" query looks identical to a "never‑searched" query because failureData deletes data. If we want the page skeleton to never reappear once a query has resolved to an error, useSearchLoadingState could also treat a present-but-loading/errored snapshot as "not loading". The effect‑guard above is sufficient on its own; this is only listed for completeness.

    What alternative solutions did you explore? (Optional)

    1. Stop failureData from deleting data (don't merge data: null). This would make hasNoData stay false after a failure so the page never falls back to the skeleton. Rejected: clearing stale data on failure is intentional (we don't want to show stale rows behind an error), and it would mask, not fix, the redundant re‑search.

    2. Make useSearchLoadingState not return true while a search is actively loading for an already‑mounted query. This narrows the skeleton flash window but still leaves the pointless re‑request firing on every mount; it treats the symptom rather than the cause. Better as the optional hardening above, layered on top of the effect guard.

    3. Reset to the canned search on error (the existing index.tsx#L1432-L1447 behaviour) for the /search route too. Rejected: the expected result is that the error page stays, not that the query is silently replaced.

  8. melvin-bot commented on Jun 3, 2026

    @melvin-bot

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

  9. wildan-m commented on Jun 3, 2026

    @wildan-m
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  10. moxw commented on Jun 3, 2026

    @moxw

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  11. melvin-bot commented on Jun 3, 2026

    @melvin-bot
  12. changed the title [-]Spend-"Something went wrong" screen for a failing query flashes[/-] [+][$250] Spend-"Something went wrong" screen for a failing query flashes[/+] on Jun 3, 2026
  13. 115 remaining items

  14. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. mallenexpensify commented on Jul 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @nabi-ebrahimi due $125 via Upwork
    Contributor+: @QichenZhu due $125 via NewDot

    @nabi-ebrahimi can you please accept the job below? Please reply here and tag me once you have.
    If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
    https://www.upwork.com/jobs/~022078242745554726073

    ^ Test case created. Thx

  16. oqildev commented on Jul 18, 2026

    @oqildev
    Contributor

    Payment Summary

    Contributor: @nabi-ebrahimi due $125 via Upwork Contributor+: @oqildev due $125 via NewDot

    @nabi-ebrahimi can you please accept the job below? Please reply here and tag me once you have. If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022078242745554726073

    ^ Test case created. Thx

    @mallenexpensify

    Ohh. It’s not me. Wrong assignement.
    Thanks😊

  17. nabi-ebrahimi commented on Jul 20, 2026

    @nabi-ebrahimi
    Contributor

    @mallenexpensify, Accepted the offer. thanks.

  18. melvin-bot commented on Jul 20, 2026

    @melvin-bot

    @QichenZhu Huh... This is 4 days overdue. Who can take care of this?

  19. mallenexpensify commented on Jul 20, 2026

    @mallenexpensify
    Contributor

    @nabi-ebrahimi paid, summary updated above. Thx.

    Thanks @oqildev , I was a lil too quick

    Image

    @QichenZhu paid, summary updated above. Thx.

  20. trjExpensify commented on Aug 3, 2026

    @trjExpensify
    Contributor

    approved $250 for @QichenZhu

  21. QichenZhu commented on Aug 4, 2026

    @QichenZhu
  22. trjExpensify commented on Aug 4, 2026

    @trjExpensify
    Contributor

    Ah yeah cool, you submitted $125 so all good.

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