From f8748564525dbc57622cb4567c59f904acd461c3 Mon Sep 17 00:00:00 2001 From: Emma Alexia Date: Fri, 3 Oct 2025 09:03:02 -0400 Subject: [PATCH] Fix user deletion with new notifications_deliveries table for real (#4473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../labrinth/src/database/models/user_item.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/labrinth/src/database/models/user_item.rs b/apps/labrinth/src/database/models/user_item.rs index 3a73aa41..090d99e4 100644 --- a/apps/labrinth/src/database/models/user_item.rs +++ b/apps/labrinth/src/database/models/user_item.rs @@ -559,16 +559,6 @@ impl DBUser { .try_collect::>() .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