Fix for patch issue - #325
Open
SharonStrats wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The current SolidAuthnLogic.checkUser() changes regress legacy login event emission and the new rdflib invalidation code relies on unguarded internal APIs that can throw at runtime.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates Solid authentication/session handling so the app can reliably detect (and react to) a restored/activated session, avoiding stale anonymous fetch metadata that prevents authenticated PATCH operations (e.g., profile card updates).
Changes:
- Add a Vitest case covering a “late restore after timeout” scenario to ensure
sessionRestorecan still be emitted whenrestore()settles after the timeout. - In
SolidAuthnLogic.checkUser(), add logic to emitsessionRestorewhen a timed-out restore later completes. - In
createSolidLogic, invalidate rdflib’s cached “anonymous” fetch completion state onsessionRestoreso subsequent loads can record authenticated headers.
File summaries
| File | Description |
|---|---|
| test/solidAuthLogic.test.ts | Adds coverage for late restore() completion emitting sessionRestore. |
| src/logic/solidLogic.ts | Clears rdflib fetch completion cache on sessionRestore to allow authenticated reload/PATCH. |
| src/authn/SolidAuthnLogic.ts | Emits sessionRestore on late restore completion and refactors restore activation detection. |
Review details
Suppressed comments (1)
src/authn/SolidAuthnLogic.ts:165
- The
handleRedirectFromLogin()path no longer emits the legacyloginevent when the session transitions from inactive to active.authSession.tsexplicitly relies onSolidAuthnLogic.checkUser()to emitlogin/sessionRestore, so this is a behavior regression for any listeners waiting onlogin.
if (typeof sessionAny?.handleRedirectFromLogin === 'function') {
await sessionAny.handleRedirectFromLogin()
}
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
SharonStrats
force-pushed
the
fix/patch-issue
branch
from
September 8, 2026 02:13
a60d085 to
5df7c2f
Compare
Prompt: various prompts and research to determine that the authSession event was not being sent and that we had to remove previous anonymous fetches so they can be refetched with authentication Co-authored-by: GPT-5.4 <gpt-5.4@openai.com>
SharonStrats
force-pushed
the
fix/patch-issue
branch
from
September 8, 2026 02:15
5df7c2f to
7637788
Compare
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.
There are two pieces to the changes that needed to be made to make it where the profile card could be PATCHED after a restored session.
First
The changes in solidauthlogic are needed because this is the only layer that can reliably tell when the session has actually become usable. The logs showed a real race: restore() could complete late, or handleIncomingRedirect()/checkUser() could see the session active before the rest of the app had a populated WebID context. The code in SolidAuthnLogic.ts:17 and SolidAuthnLogic.ts:105 fixes that by timing out a hung restore, then still emitting sessionRestore if the session becomes active later.
That matters because other code depends on that event. In particular, the store invalidation in solidLogic.ts only runs when login or sessionRestore fires, so without this auth-layer code the app can keep stale anonymous fetch metadata and PATCH keeps failing.
Second
The changes in SolidLogic clears the stale anonymous fetch state on session restore, so rdflib is willing to re-evaluate the document with authenticated headers. Without this the refresh nor reload work.