Page MenuHomePhabricator

[keyserver] Update deleters to look at new user_container column
ClosedPublic

Authored by ashoat on May 10 2024, 8:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 12:05 AM
Unknown Object (File)
Mon, Jun 24, 3:37 PM
Unknown Object (File)
Sat, Jun 22, 8:34 PM
Unknown Object (File)
Sat, Jun 22, 2:04 AM
Unknown Object (File)
Fri, Jun 21, 4:39 PM
Unknown Object (File)
Fri, Jun 21, 7:23 AM
Unknown Object (File)
Tue, Jun 18, 12:16 AM
Unknown Object (File)
Tue, Jun 18, 12:16 AM
Subscribers
None

Details

Summary

This diff updates the keyserver code for several deleters:

  1. For deleting an upload, we'll check to make sure it's not assigned to a user
  2. For deleting unassigned uploads, we'll check to make sure they're not assigned to a user
  3. For deleting an account, we'll make sure to delete any corresponding avatar upload

Depends on D11988

Test Plan

I tested the whole stack with the following steps:

  1. Ran the migration on a backup of my production keyserver database from September 2023. Confirm that the uploads table has the new column, that it has an index, and that it's populated for all cases where the old column matched a user. Confirm that only 32 rows were updated, which matched the number of users with avatars in a prior query
  2. Create a brand new database. Confirm that the Confirm that the uploads table has the new column, and that it has an index. Make sure DESCRIBE uploads; matches what it looked like in step 1
  3. Run the migration on my local multi-keyserver testing database. Make sure I'm still able to log in with an existing user. Confirm I can change the existing user's avatar to a photo and that there are no errors in the logs. Confirm that the avatar is still there if I log out and back in
  4. On the same database, try creating a new user with a photo avatar and confirm that it works, and that there are no errors in the logs. Confirm that the avatar is still there if I log out and back in
  5. Ran git grep container in the keyserver folder and reviewed every result to consider whether it needs to be updated

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable