Skip to content

Session staleness - #871

Merged
bourgeoa merged 5 commits into
stagingfrom
session-staleness
Sep 20, 2026
Merged

bourgeoa merged 5 commits into
stagingfrom
session-staleness

Conversation

@bourgeoa

Copy link
Copy Markdown
Contributor

What this is

Consumes the new session/identity state from solid-logic 6.0.0-2: when an identity that was actively established is replaced while the session stays active — an A → B switch in this tab or another — everything fetched under the previous identity is dropped by reloading the app. Tracks solid-ui 5.0.0-1.

The case this handles

Logout, login and session restore already have UI paths (header/footer rebuild, the logout cleanup, the sessionRestore listener). The one transition nothing covered is an active identity replacement: the session never goes inactive, so no logout/login listener fires, yet the documents, panes and edit forms on screen were fetched with the previous identity's credentials — and its authorization answers. solid-logic 6.0.0-2 reports it as identityReplaced (paired with sessionChange) and invalidates its own cached authorization before any listener is notified; already-rendered documents still belong to the previous identity, so the app reloads.

The change

  • src/lib/auth/SolidAuth.ts: reloadOnIdentityReplaced(authSession.events, …) is wired in initialize(), reloading only while the derived info still reports a logged-in session.
    • a local logout is left alone on purpose: the session is inactive by then and the existing logout path runs its IdP / /.well-known/solid/logout cleanup and navigation — a reload there would race it;
    • a cross-tab logout behaves the same way: it emits logout, which that handler already drives.
  • src/login/login.ts: the issuer-default assignment sat at column 0; the last npm run lint error is fixed.

Dependencies

  • solid-logic 6.0.0-2 — exports reloadOnIdentityReplaced and the identityReplaced / sessionChange events.
  • rdflib ^2.4.1 — required by the authorization repair: load() refetches a document whose recorded answers are all flagged (fix: refetch a flagged document and keep its old answers excluded (#870) linkeddata/rdflib.js#871), exactly the state an identity transition leaves behind.
  • pane-registry 5.0.0-1 — accepts ^2.4.1, so the tree keeps a single rdflib (the lockfile moves to registry packages).

Verification

  • npm run lint 0 errors, npm run typecheck clean, npm test 57 files / 657 passed / 46 skipped, lockfile consistent with package.json (npm ci).
  • The reload path itself is the cross-tab / active-switch case that cannot be simulated on localhost (no shared worker session, one identity per browser profile) — the same limitation the underlying change documents; the transition and event contract is covered by the solid-logic unit tests.

bourgeoa and others added 5 commits September 20, 2026 20:05
An A -> B switch while the session stays active replaces the identity with
no logout, so everything fetched under the previous identity stays on
screen. reloadOnIdentityReplaced() (new in solid-logic 6.0.0-2) reloads in
that case; a logout is skipped — the derived info already reports logged
out, and the logout path runs its own cleanup and navigation.

Dependencies move to solid-logic 6.0.0-2, pane-registry 5.0.0-1 and
rdflib ^2.4.1: one rdflib in the tree, the version the authorization
repair contract relies on.
Fixes the @stylistic/indent error at login.ts:569 — the assignment sat at
column 0.
@bourgeoa
bourgeoa merged commit 5fbf5f6 into staging Sep 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant