Skip to content

Feat/access errors - #893

Open
SharonStrats wants to merge 12 commits into
stagingfrom
feat/access-errors
Open

SharonStrats wants to merge 12 commits into
stagingfrom
feat/access-errors

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This PR does a major refactor of the code so that all the code is not in one file and many things were simplified.

It also adds error handling using the debug for console logs, displaying errors to the user, handling input errors up front. I'll explain a few details below as well I have included an example of how it will look to the user.

Behavior notes:
Adding new assures valid authorization targets before Save

  • When adding a new authorization the target must resolve to a supported access-control subject: agent/WebID, agent group, agent class, or origin, where supported. If the target cannot be verified, it is rejected and is not added to the pending list. If that happens in the UI it will say Could not verify this access target
  • If target resolution throws for adding input—for example, because classification or related lookup fails—the exception is caught. The error message will show and if no message this Could not verify this access target
  • When an error is received here the user can retype and the error is cleared.

All save errors appear in the dialog below
Screenshot 2026-10-14 at 1 13 55 PM

SharonStrats and others added 7 commits October 13, 2026 18:04
Prompt: Validate the input for each subjectType for agent and agentGroup
make sure you can load the doc and see that it has a valid agent,
agentGroup, agentClass type, validate origin based on format we have the
check in solidlogic already add hostname.

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
Prompt: Create shared ACL view models instead of reconstructing them in multiple methods.
then rerun unit and e2e tests.

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
…errors

Prompt: When there are errors the results that were successful need to be shown to
the user in the open dialog, but they still should not be able to retry unsuccessful
updates.

Co-authored-by: GPT-5.6 Terra <gpt-5.6-terra@openai.com>

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

Failed saves can leave misleading role state, stale validation errors, and duplicate close events.

4 open findings
What changed in this PR

Adds granular access-control error handling while decomposing the modal into focused components.

Changes:

  • Reports individual save and validation failures.
  • Extracts access-target, grant-draft, and save logic.
  • Adds tests for partial failures and target resolution.
File Description
test/​components/​access-control-modal/​buildAccessChanges.test.ts Tests change construction.
test/​components/​access-control-modal/​accessTargetResolver.test.ts Tests target resolution.
test/​components/​access-control-modal/​accessGrantDrafts.test.ts Tests grant drafts.
test/​components/​access-control-modal.test.ts Expands modal integration tests.
src/​components/​access-control-modal/​types.ts Defines events, drafts, and errors.
src/​components/​access-control-modal/​helpers.ts Adds origin normalization.
src/​components/​access-control-modal/​buildAccessChanges.ts Builds queued ACL changes.
src/​components/​access-control-modal/​applyAccessChanges.ts Applies changes with per-item errors.
src/​components/​access-control-modal/​accessTargetResolver.ts Resolves and verifies targets.
src/​components/​access-control-modal/​accessGrantDrafts.ts Manages grant draft models.
src/​components/​access-control-modal/​AccessControlSharedAccess.ts Extracts shared-access UI.
src/​components/​access-control-modal/​AccessControlSharedAccess.styles.css Styles shared-access UI.
src/​components/​access-control-modal/​AccessControlModal.ts Coordinates saving and errors.
src/​components/​access-control-modal/​AccessControlModal.styles.css Retains modal-level styles.
src/​components/​access-control-modal/​AccessControlGeneralAccess.ts Extracts general-access UI.
src/​components/​access-control-modal/​AccessControlGeneralAccess.styles.css Styles general-access UI.
src/​components/​access-control-modal/​AccessControlErrors.ts Renders save failures.
src/​components/​access-control-modal/​AccessControlErrors.styles.css Styles failure details.
src/​components/​access-control-modal/​AccessControlAddAccess.ts Extracts grant-entry UI.
src/​components/​access-control-modal/​AccessControlAddAccess.styles.css Styles grant-entry UI.

🧠 Review effort: Balanced


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

Comment thread src/components/access-control-modal/AccessControlErrors.ts Outdated
Comment thread src/components/access-control-modal/AccessControlModal.ts Outdated
Comment thread src/components/access-control-modal/AccessControlModal.ts
Comment thread src/components/access-control-modal/AccessControlErrors.ts Outdated
@SharonStrats
SharonStrats marked this pull request as ready for review October 14, 2026 03:07
@SharonStrats SharonStrats linked an issue Oct 14, 2026 that may be closed by this pull request
Prompt: Pasted the errors from the ci into the chat - can you see why these
errors would happen in ci but not locally and fix.

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>

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.

Comment on lines +24 to +28
export function getAccessGrantId (authorization: AccessAuthorization): string {
return getAuthorizationSubjectEntries(authorization)
.map(subject => `${subject.type}:${subject.iri}`)
.sort()
.join('|')
this.failed = true
}
this.logPendingGrantFailures(failedGrants, true)
this.clearInputError()
action: 'input',
label: 'Access target',
targetUri: principal,
message: error instanceof Error ? error.message : 'Could not verify this access target'
Comment on lines +38 to +39
} catch {
return undefined
Comment on lines +28 to +40
const first: AccessAuthorization = {
agent: ['https://alice.example/profile#me'],
agentGroup: ['https://example/group'],
agentClass: [],
origin: ['https://example.test'],
mode: ['Read'] as AccessMode[]
}
const second = {
...first,
agent: [...first.agent].reverse(),
agentGroup: [...first.agentGroup].reverse(),
origin: [...first.origin].reverse()
}

@timea-solid timea-solid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I looked at the code in general and it looks ok. A lot of great work!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Sharing pane: Add error handling

3 participants