Repository navigation
fix(platform): show a failed secrets read, not an empty editor - #4317
Conversation
A project's Environment tab branched only on the three access refusals. Any other failed read of its secrets (a 503, a lost connection) fell through to the editor over an empty list, the page a project with no secrets gets: an administrator could add a stored name again and Save, overwriting that secret, while nothing said the list had failed to load. useProjectSecrets now also reports how the read stands (readStateOf) and a retry. A read that never answered shows CatalogLoadError in place of the editor: a live alert in the reader's language, with a Try again that stays focused and busy while the read runs, announces each new failure, and hands the focus to the Environment group when the editor replaces it. The editor only mounts over a read that answered, so no Save can write over secrets the page could not read. A refresh that fails keeps the last answer and any draft under the same notice. The access notices are unchanged, and an empty answer still opens the empty editor. Closes #3887
|
Request changes — reviewed at exact head The behavior change matches the #3887/TALE-312 contract: generic failed reads render a localized Blocking finding: the manual suite is not merge-safe. On the PR tree,
Current Verification:
|
PROJ-B14 is already taken on main by "A slow agent save cannot discard later typing", so the suite merged with main carried the ID twice and lint:manual refused it. PROJ-B15 is reserved by #4322, and no commit on main and no open pull request has used PROJ-B16, so the Environment box takes that one. Current main lists 63 boxes under a Cost 62 header (its PROJ-B14 came without a bump). With this box the merged suite holds 64, so the header says 64.
|
Publication receipt: round 2 published (TALE-733, agent #5, run
|
ACCEPT — exact head
|
Merge receipt — TALE-741 / C12ACCEPT was posted for exact head Immediately before merge, the head was unchanged and all 55 checks were COMPLETED (37 SUCCESS, 17 SKIPPED, 1 NEUTRAL), with none failed or pending. Ran only Read-back: MERGED at 2026-10-05T01:41:05Z, squash commit Manual-ID finding closed: two-line repair independently verified; merged-tree manual lint and projects guide check passed on main Receipts go to TALE-312, TALE-359 and TALE-360. Release owner may include this accepted merge in a later eligible candidate under its existing gates; merge alone does not prove deployment. |
|
Live check of #4317 on
Results
Limits
|
What changed
A project's Environment tab (
ProjectSecretsTab) handled only the three access refusals (PROJECT_FORBIDDEN,PROJECT_NOT_FOUND,UNAUTHORIZED). Any other failed read of its secrets, such as a 503 or a lost connection, fell through toEnvVarListEditorover an empty list. That is the page a project with no secrets gets. Nothing said the read had failed, there was no Retry, and an administrator could add a stored name again and Save, overwriting that secret.useProjectSecretsnow also returns how the read stands, from the sharedreadStateOf(unavailable,stale,retrying,failureCount), plus aretry.A read that never answered now shows the design system's
CatalogLoadErrorin place of the editor:projectSecrets.errors.loadFailed, EN/DE/FR);aria-busy) while the read runs;The editor only mounts over a read that answered, so no Save can write over secrets the page could not read.
A refresh that fails after a good answer keeps the last answer and any unsaved draft. A notice above the editor says so (
projectSecrets.errors.refreshFailed), with Try again.Unchanged: the access-refusal notices, and an empty answer, which still opens the empty editor with Add variable.
Manual layer: a new box,
PROJ-B16, intests/manual/suites/projects.md. The suite header reads Cost 64: main already holds 63 boxes under Cost 62, and this box makes 64.PROJ-B14is taken on main, and fix(platform): preserve project-agent app save preconditions #4322 reservesPROJ-B15.How I verified it
All runs were local: Node v24.21.0 with Vitest 4.1.11 (
/opt/node/bin/node node_modules/vitest/vitest.mjs),--maxWorkers=1, jsdom.The new
project-secrets-tab.read-failure.test.tsxruns the real hook,useBackendQuery, the adapter row,backendFetchand the read retry policy against the closedsyntheticBackend()transport. A 503 makes four attempts. Every name is a synthetic placeholder, and no secret value is read or printed.On this branch: 9/9 pass.
Against main's
project-secrets-tab.tsxandhooks/secrets.ts(restored fromorigin/main9e8f87f68, new strings kept): 7 of 9 fail.sends no write over secrets it could not read) fails withReceived: ["POST /api/app/projects/proj-1/secrets?orgId=org-1"]: the Save from that state goes out.Other checks:
project-secrets-tab.test.tsxandproject-secrets-tab.lapsed-session.test.tsx: 23/23 together with the new suite.lib/i18n/messages.test.ts: 24/24.tests/guards/error-message-description.guard.test.tsandsingle-failure-toast.guard.test.ts: 75/75.oxlint --type-aware --type-checkon the four changed TS files exits 0. A planted file with a type error and an unused variable was reported, which proves the invocation checks.check-guide.tsonprojects.md: OK.bun run lint:manual: OK.Accessibility: axe (
checkAccessibility, withheading-ordersuppressed as in the tab's other suites) is clean on the failure state.Mutation checks, each on
project-secrets-tab.tsxalone and restored after its run. Each turns the new suite red:isErrorinstead ofreadStateOf: 1 failed (Try again loses its focus while the retry runs);onFocusLost: 2 failed;failureKey: 1 failed (a new failure is not re-announced);Not run here: a real browser, E2E, the visual analyzer, screen-reader runs and the backend stack (the sandbox has no browser or stack).
PROJ-B16covers that by hand, and the full CI suites run on this PR.Notes
docs/*/platform/member/preferences.mdstill holds, because a 401 keeps the access notice.pendinganderror: nullwhile it re-runs. A refused read that re-runs (for example on remount) briefly shows the generic alert with a busy Try again before the access notice returns. Main showed the editor skeleton in that window. Nothing in it is editable.Round 2: the manual box ID (review d3c1dea3)
The first head,
6887e4c5, added its box asPROJ-B14, which current main already uses, solint:manualfailed on the merged tree (projects.md:555 — PROJ-B14 is already defined).73c5711e6(fix(manual): give the failed secrets read box an unused ID) renames the box toPROJ-B16and sets the header to Cost 64. It changes no product code. Checks on main349fdcfa82merged with73c5711e6:bun run lint:manualpasses (5 trees, 1459 boxes); the same tree with the old head fails at the duplicate;check-guideis OK, and there are 64 unique box IDs;project-secrets-tab.read-failure,project-secrets-tab,project-secrets-tab.lapsed-session) pass 23/23 under Node 24, one worker;lib/i18n/messages.test.tspasses 24/24, and type-aware oxlint exits 0 on the 4 TS files.Closes #3887