Repository navigation
ui: show not-found and error states on org and user detail - #1247
Conversation
|
Thanks for opening this pull request! A SPACE maintainer will take a look. CONTRIBUTING.md explains how we review outside contributions. |
Withdrawing this approval for now. Any feedback above still stands.
Opening an organization or user that does not exist left a blank page and an uncaught promise rejection, and a failed branding save on the organization page produced no message at all. Both detail pages now show a not-found state with the API's error, the ID and a link back to the list; saving branding reports failures and shows progress.
The organization and user detail pages titled every load failure "not found", including a 500, a 403 or a network error, which tells an operator the object does not exist when it merely failed to load. A 404 still reads "Organization not found" or "User not found". Any other failure reads "Could not load the organization" or "Could not load the user" with the error and a Retry that loads the page again.
36bf5fd to
8f0f82f
Compare
|
Rebased onto The conflict was this PR's "stop polling a sandbox after its first 404" change. #1253 and #1262, stacked on this PR, were restacked with their commits unchanged. At each of the three heads, in |
johnlouie-pplx
left a comment
There was a problem hiding this comment.
Approving.
I compared 8f0f82f with the head I reviewed before. The only change is dropping the sandbox page's stop-polling-on-404, which is the right call now that main keeps polling while a create is pending. The sandbox page on main also uses the same rule now (404 is "not found" with no retry, anything else is "Could not load" with Retry), so all three detail pages agree. I ran npm test (144 pass) and tsc on this head. I didn't run it in a browser.
Summary
Org and user detail pages now say when the object does not exist, instead of rendering a blank page.
Changes:
/dashboard/orgs/{id}and/dashboard/users/{id}never handled a failed load. An unknown or deleted ID left an empty content area and an uncaught promise rejection (resource not found) in the console. Both pages now show "Organization not found" or "User not found" for a 404, with the API's message, the ID and a link back to the list. Any other failure (a 500, a 403, a network error) shows "Could not load the organization" or "Could not load the user" with the error and a Retry.PATCH /admin/api/v1/orgs/{id}produced an unhandled rejection and no message. It now reports the API's error, and the button shows progress while the save runs.Stack
Not stacked on anything. #1253 (user page) is stacked on this PR, and #1262 on #1253.
Validation
At this head, in
ui/:npm ci,npm test(144 pass, includingsrc/lib/load-failure.test.mjs),npx tsc --noEmit -p .andnpm run build.A Playwright loop against a local Kind stack with synthetic data, run on
main(production build) and on this branch (the Kindspace-uiimage):mainare gone;PATCH) shows an error message;No new console errors, page errors or failed requests compared with
main.A loop step answers the first org or user GET with a synthetic 500 (route interception): the page reads "Could not load the organization" (or "the user") with Retry instead of "not found", and Retry loads the page.
Visual confirmation
main)Severity and risk
Severity: low. These are error paths, but on them an operator saw nothing and could not tell an unknown ID from a broken page.
Risk: low. The successful paths are unchanged. Roll back by reverting the commit.
AI assistance: Claude Code wrote the code and this description, and ran the validation; a maintainer reviews it.