Session staleness - #871
Merged
Merged
Conversation
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.
…istry@5.0.0-1) (latest: rdflib@2.4.1)
… into session-staleness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Consumes the new session/identity state from
solid-logic6.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. Trackssolid-ui5.0.0-1.The case this handles
Logout, login and session restore already have UI paths (header/footer rebuild, the logout cleanup, the
sessionRestorelistener). 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-logic6.0.0-2 reports it asidentityReplaced(paired withsessionChange) 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 ininitialize(), reloading only while the derivedinfostill reports a logged-in session./.well-known/solid/logoutcleanup and navigation — a reload there would race it;logout, which that handler already drives.src/login/login.ts: the issuer-default assignment sat at column 0; the lastnpm run linterror is fixed.Dependencies
solid-logic6.0.0-2— exportsreloadOnIdentityReplacedand theidentityReplaced/sessionChangeevents.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-registry5.0.0-1— accepts^2.4.1, so the tree keeps a single rdflib (the lockfile moves to registry packages).Verification
npm run lint0 errors,npm run typecheckclean,npm test57 files / 657 passed / 46 skipped, lockfile consistent withpackage.json(npm ci).solid-logicunit tests.