Skip to content

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

Closed

Description

@yannickmonney

Summary

On Settings › Connectors, a tab that missed another admin's delete still lists the credential. Deleting it there ends as the person wanted: the row drops in 0.26 s. Even so, they are told the delete failed, with a destructive toast "Could not delete the credential: Credential not found." The credential is gone, which is exactly what they asked for.

This follow-up was left open after #3712's repair (#3895, TALE-91), which already refetches and drops the vanished row. It is confirmed here on current main.

Source and environment

  • Source: origin/main at 09d0b20d2 (2026-10-02), in a detached worktree with no local changes.
  • Stack: an isolated local stack started with bun scripts/dev.ts and TALE_DEV_SKIP_DOCKER=1 TALE_E2E=1. Vite runs on localhost:3631, the backend on 127.0.0.1:3636, and the occurrence has its own PostgreSQL cluster on 127.0.0.1:55363. All egress goes to a dead proxy.
  • Browser: headless Chromium 1208 (playwright-core 1.58.2) at 1280×900, en-US.
  • Data: a synthetic organization with its owner (browser) and an admin (another session using the app routes), plus four synthetic Tavily credentials.

Reproduction

  1. As the owner, open Settings › Connectors with the credential "Tavily gone" listed. Cut that tab's /events stream to simulate a missed live update (Playwright routing aborts /events).
  2. As the admin, from another session, delete "Tavily gone" (DELETE /api/app/connector-credentials/‹id› answers 204). The owner's table still lists it.
  3. As the owner, open Actions for Tavily gone › Delete › Delete.

Observed

Control, same page: deleting a credential that still exists shows "Credential deleted" and drops the row in 450 ms.

Expected

Deleting something that is already gone is the outcome the person asked for. It shouldn't read as a failure. Treat CREDENTIAL_NOT_FOUND on delete as done: drop the row, and either say nothing extra or use a neutral line such as "This credential was already deleted". Keep the destructive toast for real refusals.

Root cause

services/platform/app/features/settings/credentials/credential-row-actions.tsx:114–131: handleDelete toasts credentials.deleteFailed (destructive) for every rejection of remove.mutateAsync, including the CREDENTIAL_NOT_FOUND whose refetch already drops the row.

The same row actions serve AI providers credentials, so that page very likely behaves the same. It wasn't driven.

Acceptance checks

  • In a tab that missed the delete, Delete on the vanished row shows no destructive toast, and the row drops.
  • A real refusal still shows its reason in a destructive toast, for example a write the server refuses for permissions.
  • Deleting an existing credential still shows Credential deleted (the control).
  • A credential-row-actions test covers a CREDENTIAL_NOT_FOUND rejection.

Retained evidence

Evidence is retained locally under /agent/workspace/.tale358/r20261002T1215/, and attached as a tarball to Tale task TALE-358:

  • evidence/c1-credential-leads.log (L1 case and control, toasts, HTTP 404);
  • evidence/c1-L1-after-delete.png;
  • scripts/c1-credential-leads.ts.

Limits

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions