Fix user deletion with new notifications_deliveries table for real (#4473)

Maybe this will work? I dunno but users are still saying they're getting errors deleting accs. In theory it shouldn't matter if the transaction all gets committed at the same time, though, right? I can't really test this so I would like someone to tell me whether this will actually make a difference.

Co-authored-by: François-X. T <fetch@ferrous.ch>
This commit is contained in:
Emma Alexia
2025-10-03 09:03:02 -04:00
committed by GitHub
parent b96c5cd5ab
commit f874856452

View File

@@ -559,16 +559,6 @@ impl DBUser {
.try_collect::<Vec<i64>>()
.await?;
sqlx::query!(
"
DELETE FROM notifications
WHERE user_id = $1
",
id as DBUserId,
)
.execute(&mut **transaction)
.await?;
sqlx::query!(
"
DELETE FROM notifications_actions
@@ -589,6 +579,16 @@ impl DBUser {
.execute(&mut **transaction)
.await?;
sqlx::query!(
"
DELETE FROM notifications
WHERE user_id = $1
",
id as DBUserId,
)
.execute(&mut **transaction)
.await?;
let user_collections = sqlx::query!(
"
SELECT id