Skip to content

Bug: a failed member-context refresh blanks Knowledge and leaves Governance, Metrics and most Settings pages on skeletons #4859

Closed

Description

@yannickmonney

Problem

A failed background refresh of the caller's membership (GET /members/me) leaves its last good result in the cache. The dashboard still treats that failure as "access is loading", and never ends that state. The member sees a blank Knowledge page and permanent skeletons on Governance, Metrics and most Settings pages, with no message and no Try again. Paths at main 4cde0834a, under services/platform/app/.

  1. The flag. routes/dashboard/$id.tsx:226 sets const isLoading = isAuthLoading || isQueryLoading || isError;. This value goes to every page as AbilityLoadingContext (:306).
  2. The only error screen needs an empty cache. :264 shows the "error loading page" alert with Try again only if (isError && !memberContext). After a refresh fails, TanStack Query keeps the old memberContext, so this screen never shows. The role logic at :205-214 keeps the last known role during a refresh, so the shell and navigation look healthy.
  3. What the pages do with the flag:
    • Knowledge: routes/dashboard/$id/_knowledge.tsx:59 renders {!abilityLoading && <Outlet />}, so every Knowledge tab's content is empty under an intact header.
    • Governance (settings/governance/route.tsx:64-72) and Metrics (settings/metrics/route.tsx:61): the content pane is a skeleton.
    • Settings: Organization, Branding, Connectors, Providers, Data residency, Enterprise SSO, API (use-api-settings-access.ts:47) and Sandboxes all wrap their content in Skeletonize loading={abilityLoading || …}.
  4. When it happens:
    • The /events hint stream invalidates the member context on any member change in the organization (useBackendHints, :122), for example someone joining or a role change.
    • The query refetches after its 5-minute stale window (router.tsx:39) whenever an observer remounts.
    • A failure during any of these refreshes starts the state. Transport faults retry 3 times first. A structured server error (isStructuredBackendError, any error with data) fails at once and is not retried on window focus (router.tsx:45-47). The page then stays blank until another member change or a full reload.
    • PR fix(platform): hold up under a load burst and a database restart #4853 shows the server does return such errors during load bursts and database restarts.

Why nothing catches it: routes/dashboard/dashboard-layout.test.tsx:387-407 ("keeps outlet visible when query errors but has previous data") covers this exact state, but only asserts that the layout's own outlet renders. It never reads AbilityLoadingContext, which is still true, so it misses the pages under the outlet blanking themselves. The :205 comment shows the shell is meant to keep the last known role through a refresh; counting isError as loading undoes that for the pages.

Expected

  • A failed refresh with a cached member context is not "loading". Keep the last known role and render the page. Add a non-blocking notice ("Couldn't refresh your access") with Try again, which calls refetch.
  • Show the full-page error only when there is no cached context (the current :264 case).
  • Regression: extend the :387 case so it asserts useAbilityLoading() is false under the outlet and that a retry affordance is visible. Add a Knowledge layout test with abilityLoading derived from the same state. On 4cde0834a the flag is true, and the Knowledge content is empty.

Severity and owner

  • Severity: medium. The trigger is a transient backend fault during an ordinary membership refresh. The member gets no explanation and no way out except reloading. It affects about a dozen surfaces at once.
  • Owner: platform (dashboard shell, access context).
  • Found by: Review A (TALE-358), 2026-10-12 16:15 Zurich occurrence. A worker raised it as lead K1 at 08:15; I verified it at 4cde0834a across all 17 useAbilityLoading consumers. Automations is not affected, because its gate returns its children when the retained role allows. Members, Teams and Audit logs only use the flag for the access check. This is static reading; I didn't run it, because Review A's stack is BLOCKED.

Activity

  1. added
    agent-ready
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions