Skip to content

Detached-view (Data Pane Expand) refresh failure never reports auth loss #522

Description

@BorisTyshkevich

Problem

src/ui/results.ts's detached/expanded-result-view rerun() (the Data Pane
Expand's own standalone re-run, around src/ui/results.ts:1009) checks
app.conn.ensureFreshToken() before running, and on failure does only:

if (!(await app.conn.ensureFreshToken())) {
  if (myGen === gen && !closed) settle('Not signed in');
  return;
}

Unlike every other ensureFreshToken/getToken call site in the app —
net/ch-client.ts's authedFetch, workbench-session.ts, export-service.ts,
schema-graph-session.ts, app.ts, and
dashboard/application/dashboard-viewer-session.ts's own preflight() (which
explicitly calls deps.onAuthFailed?.() on the same failure) — this path
never notifies onSignedOut/onAuthFailed. It only shows a local "Not
signed in" message on the detached view itself.

Impact

If a user's only current activity is refreshing a detached/expanded panel
when the OAuth token (and its refresh token) have both died, nothing ever
tells the connection session the session is over: no teardown runs
(Workbench/graph/export/catalog/doc pane), and the login screen never
renders — the detached view just sits showing "Not signed in" while the
rest of the app still presents as signed in, until some other action
happens to hit the same expired token and correctly routes into
chCtx.onSignedOut.

This predates #502/#520 — it's a third, differently-shaped instance of the
same family of bug (a preflight check that doesn't route into the shared
teardown), not something introduced by either of those fixes.

Suggested fix

Either call an injected onAuthFailed-style hook here too (mirroring
dashboard-viewer-session.ts's preflight()), or make an explicit,
documented product decision that a detached view's own refresh failure is
deliberately scoped and must never force a global sign-out — in which case
that decision (and why) belongs in a comment at this call site, the way
connection-session.ts's ensureFreshToken doc comment already explains
the analogous choice for Dashboard tiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inboxFiled mid-task; not yet triaged into the roadmap

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions