Skip to content

reload to check editable - #448

Open
SharonStrats wants to merge 2 commits into
stagingfrom
fix/save-issue
Open

reload to check editable#448
SharonStrats wants to merge 2 commits into
stagingfrom
fix/save-issue

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fix for this ticket SolidOS/solidos#349.

@SharonStrats
SharonStrats requested review from bourgeoa and a lite review from Copilot September 6, 2026 20:41
@SharonStrats SharonStrats self-assigned this Sep 6, 2026
@SharonStrats SharonStrats added the bug Something isn't working label Sep 6, 2026
@SharonStrats SharonStrats moved this to In review in SolidOS NLNet UI Sep 6, 2026
…@5.0.0-1 pane-registry@5.0.0-0 chat-pane@4.0.0-0) (latest: rdflib@2.4.0)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new priming path can crash or block updates (e.g., undefined fetcher and unhandled priming errors) and should be guarded and made best-effort before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a “reload-to-determine-editable” flow for RDF documents by extending shared RDF types and priming editable state during update transport.

Changes:

  • Extend RdfFetcher.load typing to accept load options, and add updater hooks (checkEditable, flagAuthorizationMetadata).
  • Add primeEditableState() to re-check editability and (when needed) force-reload a document to refresh authorization/editable metadata.
  • Invoke primeEditableState() from runUpdateTransport().
File summaries
File Description
src/sections/shared/types.ts Adds DocumentLoadOptions and new optional updater/fetcher capabilities used by the editable-state priming flow.
src/sections/shared/rdfMutationHelpers.ts Implements primeEditableState() and wires it into the update transport path to force reload when editability is initially unknown.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +119 to +126
async function primeEditableState(store: LiveStore, doc: NamedNode, updater: RdfUpdater, fetcher: RdfFetcher): Promise<void> {
if (!authn.currentUser()) {
return
}

const { checkEditable, flagAuthorizationMetadata } = updater
const { load } = fetcher

Comment on lines +133 to +141
const docUri = doc.value
const initialEditable = await checkEditable(docUri, store)
if (initialEditable !== undefined || typeof load !== 'function') {
return
}

await load(doc, { force: true, clearPreviousData: true })
await checkEditable(docUri, store)
}
Comment on lines +385 to +389
const fetcher = getStoreFetcher(store)

if (doc) {
await primeEditableState(store, doc, updater, fetcher)
}
Comment on lines +139 to +141
await load(doc, { force: true, clearPreviousData: true })
await checkEditable(docUri, store)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants