Skip to content

fix: DestroyUser should only delete the target user's preauthkeys#3166

Closed
gkuga wants to merge 1 commit into
juanfont:mainfrom
gkuga:fix/destroy-user-delete-only-own-preauthkeys
Closed

fix: DestroyUser should only delete the target user's preauthkeys#3166
gkuga wants to merge 1 commit into
juanfont:mainfrom
gkuga:fix/destroy-user-delete-only-own-preauthkeys

Conversation

@gkuga
Copy link
Copy Markdown

@gkuga gkuga commented Apr 2, 2026

ListPreAuthKeys(tx) was called without filtering by user ID, causing all preauthkeys in the database to be deleted when any single user was destroyed.

Replace with ListPreAuthKeysByUser(tx, uid) to scope deletion.

Fixes: #3154

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

ListPreAuthKeys(tx) was called without filtering by user ID, causing
all preauthkeys in the database to be deleted when any single user
was destroyed.

Replace with ListPreAuthKeysByUser(tx, uid) to scope deletion.

Fixes: juanfont#3154
@gkuga
Copy link
Copy Markdown
Author

gkuga commented Apr 2, 2026

Closing — I missed that #3155 already addresses this. Thanks!

@gkuga gkuga closed this Apr 2, 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

Development

Successfully merging this pull request may close these issues.

[Bug] DestroyUser deletes ALL pre-auth keys in the database, not just the target user's key

1 participant