From 340ca56d36e29610a17c0169b9ee8ae98fa12d1d Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 28 Sep 2026 22:23:38 +0000 Subject: [PATCH] test: cover aborted owner quota reservation Signed-off-by: Codex Co-authored-by: Codex --- crates/buzz-db/src/store/community.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/buzz-db/src/store/community.rs b/crates/buzz-db/src/store/community.rs index 01eea25459..8acd359dad 100644 --- a/crates/buzz-db/src/store/community.rs +++ b/crates/buzz-db/src/store/community.rs @@ -1169,6 +1169,26 @@ mod postgres_tests { "membership and request deduplicate" ); + sqlx::query("UPDATE community_deletion_requests SET stage = 'aborted' WHERE id = $1") + .bind(request_id) + .execute(&db.pool) + .await + .expect("abort quota fixture"); + let aborted = db + .list_communities_owned_by(&owner) + .await + .expect("aborted quota"); + assert_eq!(aborted.communities.len(), 1, "abort restores the live row"); + assert_eq!( + aborted.quota_used, 1, + "abort must fall back to the preserved membership" + ); + sqlx::query("UPDATE community_deletion_requests SET stage = 'submitted' WHERE id = $1") + .bind(request_id) + .execute(&db.pool) + .await + .expect("restore pending quota fixture"); + sqlx::query("DELETE FROM relay_members WHERE community_id = $1") .bind(created.id.as_uuid()) .execute(&db.pool)