Skip to content

fix(plugins): fail the delete action when no row was removed - #443

Closed
deanrie wants to merge 1 commit into
cursor:mainfrom
deanrie:fix/delete-plugin-zero-rows
Closed

deanrie wants to merge 1 commit into
cursor:mainfrom
deanrie:fix/delete-plugin-zero-rows

Conversation

@deanrie

@deanrie deanrie commented Oct 8, 2026

Copy link
Copy Markdown

Summary

deletePluginAction runs .delete().eq("id", id).eq("owner_id", userId) through the user-scoped Supabase client and only checks error. PostgREST does not treat a delete that matches zero rows as an error, so when the row survives (RLS refusing the delete, or any other reason the filter matches nothing), the action still returns success, the UI shows "Plugin deleted." and navigates home, and the listing stays live with its slug and repository URL. That is the sequence in #413, #429 and #438, and #429 already points at this code.

This adds .select("id") to the delete and throws an ActionError when nothing came back, so the owner sees a real error toast instead of a false success. It does not change which rows the policy allows to be deleted; the stuck listings in those issues still need the backend cleanup, this just stops the UI from lying about it.

togglePluginListingAction already has the equivalent guard through .select("slug").single(), so unpublish is not touched.

Fixes #413, fixes #429, fixes #438.

Verification

  • bun x biome ci . and bun run typecheck (apps/cursor) pass, same commands as ci.yml.
  • The error message surfaces through handleServerError (ActionError is passed through) and plugin-owner-menu.tsx already renders error.serverError in the onError toast.

@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

@deanrie is attempting to deploy a commit to the Anysphere Team on Vercel.

A member of the Team first needs to authorize it.

@deanrie

deanrie commented Oct 14, 2026

Copy link
Copy Markdown
Author

Superseded by #449, which carries this commit together with the other plugin-page fix as one reviewable PR.

@deanrie deanrie closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant