8000 Report an error when sharing a resource fails in the account console by Praiztl · Pull Request #55510 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Report an error when sharing a resource fails in the account console - #55510

Open
Praiztl wants to merge 2 commits into
keycloak:mainfrom
Praiztl:fix/55488-account-console-share-error
Open

Praiztl wants to merge 2 commits into
keycloak:mainfrom
Praiztl:fix/55488-account-console-share-error

Conversation

@Praiztl
@Praiztl Praiztl commented Nov 25, 2026
Copy link
Copy Markdown

Closes #55488

This pull request was created with the assistance of an AI agent.

@Praiztl
Praiztl marked this pull request as ready for review November 25, 2026 09:38
@Praiztl
Praiztl requested review from a team as code owners November 25, 2026 09:38
Copilot AI balanced review requested due to automatic review settings November 25, 2026 09:38
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

Regression tests are missing for failed sharing and permission updates, leaving error-description display and suppression of success alerts on 404/403 responses unverified.

1 open issue
What changed in this PR

Fixes #55488 by making failed resource-sharing and permission-update requests reject, allowing the Account Console’s existing error handlers to display errors instead of success messages.

Changes:

  • Adds HTTP status checks to updateRequest and updatePermissions.
  • Uses parseResponse for failed responses while preserving successful response returns.
File Description
js/​apps/​account-ui/​src/​api.ts Adds error handling to resource-sharing and permission-update requests.

Review effort: Balanced

Comment on lines +57 to +58
if (!response.ok) {
throw await parseResponse(response);
@Praiztl
Praiztl commented Nov 25, 2026
Copy link
Copy Markdown
Author

Thanks for the review. The two write helpers now throw on a non-OK response, mirroring the existing deleteConsent and deleteSession helpers so the caller's error handling runs. A Playwright case for the 404/403 failure paths (asserting the error description is shown and no success alert appears) is reasonable follow-up; happy to add it if it should land in this PR.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 19:35
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.

🟢 Approval recommended

No active review issues were identified for the resource-sharing and permission-update error-handling changes.

1 open issue

Review effort: Balanced

@stianst stianst added the kind/bug Categorizes a PR related to a bug label Nov 27, 2026
@stianst
stianst requested review from edewit and ssilvert December 2, 2026 11:19
@Praiztl
Praiztl force-pushed the fix/55488-account-console-share-error branch from 0000887 to e08dc62 Compare December 3, 2026 09:08
Copilot AI balanced review requested due to automatic review settings December 3, 2026 09:08
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 regression test covers only updateRequest, leaving updatePermissions failure handling untested for displaying the server’s error description and suppressing success alerts.

2 open issues

Review effort: Balanced

Comment on lines +76 to +77
if (!response.ok) {
throw await parseResponse(response);
@Praiztl
Praiztl force-pushed the fix/55488-account-console-share-error branch from e08dc62 to f21556d Compare December 3, 2026 11:17
Copilot AI balanced review requested due to automatic review settings December 3, 2026 11:17
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.

🔵 Needs a closer look

The regression test covers only updateRequest, leaving failed unshare and permission-edit responses untested for displaying the server error without a success alert.

2 open issues

Review effort: Balanced

Closes keycloak#55488

Signed-off-by: Tochukwu Chikezie <95018735+Praiztl@users.noreply.github.com>
Signed-off-by: Tochukwu Chikezie <95018735+Praiztl@users.noreply.github.com>
@Praiztl
Praiztl force-pushed the fix/55488-account-console-share-error branch from f21556d to d9d7131 Compare December 4, 2026 09:58
Copilot AI balanced review requested due to automatic review settings December 4, 2026 09:58
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.

🔵 Needs a closer look

The regression test covers only updateRequest, leaving failed unshare and permission-edit paths unprotected against false-success alerts.

2 open issues

Review effort: Balanced

@Praiztl
Praiztl commented Dec 4, 2026
Copy link
Copy Markdown
Author

@stianst thanks for approving. This is ready, and the only thing left is the CI run, which is currently waiting on a maintainer to approve the workflow. Could you approve the run when you have a moment so it can merge?

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

Labels

kind/bug Categorizes a PR related to a bug team/core-iam

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Account Console reports success when sharing a resource fails

3 participants

0