Skip to content

fix(keys): remove stale user update on delete#128

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/keys-delete-remove-stale-user-update
Jul 1, 2026
Merged

fix(keys): remove stale user update on delete#128
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/keys-delete-remove-stale-user-update

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Summary

  • remove the stale users table update from /api/keys/delete
  • keep key deletion scoped to the authenticated user's user_public_keys row
  • add regression coverage for successful deletion and delete failures

Why

The current endpoint tries to clear users.ml_kem_public_key with an eq('user_id', ...) filter after deleting user_public_keys. The migrations define users.id/auth_user_id, and user_public_keys.user_id references auth.users(id), so the extra users update is stale and can make key deletion report success incorrectly.

Validation

  • corepack pnpm exec vitest run --config %TEMP%/qryptchat-vitest-no-react.config.mjs src/app/api/keys/delete/route.test.js
  • corepack pnpm exec oxlint src/app/api/keys/delete/route.js src/app/api/keys/delete/route.test.js

@ralyodio ralyodio merged commit d1cf290 into profullstack:master Jul 1, 2026
8 checks passed
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.

2 participants