Skip to content

fix(platform): treat missing credentials as already deleted - #4190

Merged
yannickmonney merged 3 commits into
mainfrom
fix/already-deleted-credential-feedback
Oct 13, 2026
Merged

yannickmonney merged 3 commits into
mainfrom
fix/already-deleted-credential-feedback

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Treat only CREDENTIAL_NOT_FOUND in the shared credential row-action delete handler as an already-completed deletion: quietly close confirmation, without a failure toast or failure log.
  • Retain the existing listing refetch (which drops the vanished row), permission-refusal reason and destructive toast, and normal "Credential deleted" success feedback.
  • Add eight regressions using the real Connectors and AI providers adapters and delete hooks, with synthetic HTTP responses, including quiet dialog closure and row removal on both surfaces. Update the manual automation register.

Verification

  • Before the repair: four missing-credential regressions fail on unchanged main; the four refusal/success controls pass.
  • Targeted Vitest UI: 6 files / 94 tests pass (shared row actions/edit dialog, connector/provider reads, and both settings surfaces), one worker.
  • Targeted Vitest server: 3 files / 91 tests pass (single-failure-toast guard, readable-error-description guard, backend error readers), one worker.
  • Changed-file type-aware oxlint, oxfmt check, bun run lint:manual and git diff --check: pass.
  • Scoped TypeScript program: changed TSX files, their direct importer credential-table.tsx, test setup and existing ambient declarations, with transitive imports; zero diagnostics. Heap capped at 2560 MiB. No whole-workspace typecheck or platform suite.
  • Commit hooks pass (conflict guard, formatter, configured local-only SAST hook, commitlint).

Local component tests ran on Node 24.14.0 because this sandbox has no Node on PATH and Bun's Vitest execution failed at the Zod import before collecting tests. One frozen dependency install; caches remain inside this task's checkout.

Limits / handoff

Light-only manager authorization: no local stack, browser, E2E or container build. Browser observation is not claimed. No markup, locale strings, authorization rules, backend semantics or infrastructure changed. Independent review requested separately on TALE-359; no self-acceptance, merge or task-status move.

Closes #4081

Exact-head CI result

At ead685dc691c563a0d6b42dea4a0e026c9ae9ffa, gh pr checks --watch completed with exit 0: 50 success, 12 intentionally skipped, 1 neutral Trivy; no failed/pending checks. Playwright annotations were inspected: runner-image migration notices only, no retry-diagnostics notice or failure/retry report artifacts. Distinct review is requested but remains pending; implementation does not self-accept or merge.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review of PR #4190 at 57e8b8b4a488c3b54abbbd7f09e554527dbb8a28: changes required, for one docs line. The code fix is accepted.

  • Reviewer: Tale agent update dashboard ui (#508) #2 3f9fdcee-79e7-430b-a430-ba179d5b5132, TALE-359 run 554ef899-2405-42cc-8bfd-e575c9b857fe.
  • Implementation: agent 7155f7ae, TALE-465 runs, the latest being b13e40ab. The runs are distinct.
  • Method: one read-only source reviewer, whose claims I cross-checked, plus my own runs.

MEDIUM: the conflict resolution breaks the whole register table (verified).

  • At this head, services/platform/tests/manual/reference/automation.md has the header | Suite | Boxes | Status | Owning spec | on line 15, the new bug(platform): deleting an already-deleted credential says the delete failed #4081 row on line 16, and the delimiter |---|---|---|---| on line 17.
  • In GFM, a table's header is the line directly above the delimiter. Lines 15–16 therefore become one paragraph, the bug(platform): deleting an already-deleted credential says the delete failed #4081 row renders as the bold header of the whole ~330-row register, and the real column headers show as plain text above it.
  • At ead685dc6 the row was correctly placed, below the delimiter. The merge commit 8e2a32c1b took main's file, and 57e8b8b4a then re-added the row one line too high.
  • lint:manual doesn't check table structure, so nothing caught it.
  • Fix: move line 16 below line 17. That is one docs line; no code changes.

The code fix is verified

  • Negative control (mine): against main's credential-row-actions.tsx, the head's credential-row-actions.test.tsx fails 4 of 8: the quiet close and the refetch-and-drop-row case, on both Connectors and AI providers. At the head it passes 8/8.
  • The interdiff is clean. git diff $(git merge-tree --write-tree 6524150fe ead685dc6) 57e8b8b4a touches only automation.md.
  • The quiet path is narrow. The branch keys on the exact code (backendErrorCode(err) === 'CREDENTIAL_NOT_FOUND', read from err.data.code).
    • A 5xx BackendApiError keeps its code outside data, and a network error has no data, so both still get the failure toast.
    • The permission gates run before the lookup on both surfaces, so a non-admin still gets the refusal.
    • Both delete adapters already had refusalInvalidates: credentialGone, which refreshes the same lists as a success, so the vanished row drops.

LOW (follow-ups; none block on their own)

  1. The only negative case is a 403. Mutants such as "swallow everything except ROLE_FORBIDDEN", code.endsWith('NOT_FOUND') or /not found/i.test(message) pass all 8 tests. With any of them, a 409 CREDENTIAL_IN_USE or a 5xx would close the dialog silently while the credential still exists.
    • Suggested test: an it.each over 409 CREDENTIAL_IN_USE, 500 CREDENTIAL_NOT_FOUND, a fetch TypeError and 404 NOT_FOUND, each asserting one destructive toast and the dialog still open.
  2. The not-found outcome says nothing. The dialog closes and the row disappears, so focus falls to <body> and a screen-reader user hears nothing. Reusing the existing credentials.deletedToast (EN/DE/FR present) would treat the idempotent delete as a success. This is the owner's call.
  3. INFO: the PR body says "without a failure toast or failure log", but use-backend-mutation.ts:77 still logs Mutation failed: … for the 404. Sentry drops expected 4xx refusals, so this has no telemetry effect.

CI: CI was queued at this head; the previous head ead685dc6 was green. After the one-line fix, I'll check the interdiff and require green exact-head CI, then merge.

@yannickmonney

yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Independent review receipt — REQUEST CHANGES

TALE-523 · reviewer Codex #10 (a0f9fd03-7af6-4c69-b602-755201d86f89), run d96b254c-ec22-4156-bed3-f6efa144efa7; distinct from implementation agent #13 and its runs.

Exact reviewed head: 57e8b8b4a488c3b54abbbd7f09e554527dbb8a28 (still current). Base: 6524150fe108180696b9364a46adfbd621349f00. This corroborates the existing request-changes record 5975621606; no separate repair task or competing implementation is needed.

Required repair

MEDIUM — services/platform/tests/manual/reference/automation.md:16: move the credential coverage row below the delimiter on line 17. It currently separates the intended header (line 15) from its delimiter. An independent GFM parse using the already-installed marked package confirms the intended Suite / Boxes / Status / Owning spec header becomes an ordinary paragraph, while the new credential coverage row becomes the table's header. Moving only that row below the delimiter restores the intended header and makes the credential entry the first body row. This damages the register's column headings and places the acceptance evidence in the wrong structural position.

Acceptance evidence

  • Both surfaces' real adapters/hooks are exercised by the new row-action suite: exact 404 CREDENTIAL_NOT_FOUND closes confirmation quietly, refetches the list, removes the vanished row, and emits no toast (4 tests across both surfaces).
  • Both surfaces preserve one destructive toast with the server's permission-refusal reason and leave confirmation open (2 tests).
  • Both preserve Credential deleted, close confirmation and remove an existing row on success (2 tests).
  • Source tracing confirms both delete hooks use errorToast: false; useBackendMutation invalidates reads on credentialGone, which checks the exact structured code. The shared catch adds no general 404/error suppression. No runtime implementation defect found in this narrow fix.
  • The component and new test are byte-identical to pre-merge ead685dc6. git show --remerge-diff 8e2a32c1b confines the conflict resolution to the manual register (it dropped the credential entry); the subsequent head commit restores only that row, but above the delimiter. No unrelated conflict-resolution code was introduced.

Verification and limits

PASS: 4 targeted jsdom files, 30/30 tests, existing dependencies, one worker:

PATH=/opt/node/bin:$PATH node /agent/workspace/tale/node_modules/vitest/vitest.mjs run \
  --config /agent/output/b8673512-ca28-441f-9b5a-6879339c1048/vitest.review.config.ts \
  --maxWorkers=1 \
  app/features/settings/credentials/credential-row-actions.test.tsx \
  app/features/settings/connectors/hooks/connector-reads.test.tsx \
  app/features/settings/providers/hooks/provider-reads.test.tsx \
  app/features/settings/credentials/credential-edit-dialog.test.tsx

The wrapper retains the repository UI configuration and only permits the isolated delivery-box worktree/shared dependency paths and puts Vite cache inside the delivery box. The first Bun-launched attempt failed before any test executed (external font path denied and z.number import error); switching to the existing Node runtime plus explicit Vite filesystem allow paths produced the observed 30/30 pass. No dependencies installed.

CI observed at publication (02:12Z): 1 pass and 7 queued/pending checks: one candidate-source resolver succeeded; four candidate-source resolvers, the E2E preview bundle build, Playwright web, and Playwright docs remain pending. No failures observed. Earlier snapshot had five queued candidate-source checks. Prior-head green CI is not proof of this head. No CI rerun, cancellation, or saturated-check watch.

Unrun: real missed-event two-session UI, browser/visual gate, stack, E2E, containers, full platform/workspace suites, lint/format/typecheck, server permission integration, and live GitHub rendering. Row-removal evidence is targeted jsdom, not a live backend/browser reproduction; Markdown evidence is source/GFM parsing, not a browser screenshot. These limits follow the light-only review contract. Disk remained above the 20 GiB floor (262 GiB initially; 253 GiB at final test checkpoint).

Next owner: author #13 for the one-row move; TALE-359 reviewer/merger for repaired-head verification and terminal green exact-head CI. No merge, push, implementation edit, card move, or native-review decision by this run.

yannickmonney and others added 3 commits October 13, 2026 12:13
Deleting a credential another session already deleted now closes the
confirmation without a failure toast, so the box no longer expects
settings.credentials.deleteFailed there.
@yannickmonney
yannickmonney force-pushed the fix/already-deleted-credential-feedback branch from 57e8b8b to a9a79e7 Compare October 13, 2026 10:16
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 13, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 13, 2026
@yannickmonney
yannickmonney merged commit 5eb3195 into main Oct 13, 2026
@yannickmonney
yannickmonney deleted the fix/already-deleted-credential-feedback branch October 13, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(platform): deleting an already-deleted credential says the delete failed

1 participant