From 35f509d7175bfd81562a23a5a5487d0cd95b9e69 Mon Sep 17 00:00:00 2001 From: atlas Date: Sun, 4 Oct 2026 08:26:54 +0200 Subject: [PATCH] swarm-controller: check the reserved matrix account is not deleted `the_agents_own_matrix_account_cannot_be_deleted` checked only the 400. It now runs against a store that holds `main` and asserts nothing was deleted. `revoke` is off so that, if the reserved check ever stopped refusing, the handler would delete the stored account and fail the test rather than call a homeserver. --- swarm-controller/src/linked_accounts.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/swarm-controller/src/linked_accounts.rs b/swarm-controller/src/linked_accounts.rs index 5debff72..eda4e846 100644 --- a/swarm-controller/src/linked_accounts.rs +++ b/swarm-controller/src/linked_accounts.rs @@ -984,10 +984,11 @@ pub(crate) mod tests { .await } - /// Refused before the store, and before any revoke. + /// Refused before the store: `main` is stored, and stays. #[tokio::test] async fn the_agents_own_matrix_account_cannot_be_deleted() { - let problem = delete_matrix(&Arc::default(), "main", true) + let store = Arc::new(every_kind()); + let problem = delete_matrix(&store, "main", false) .await .expect_err("'main' is reserved"); assert_eq!( @@ -995,6 +996,7 @@ pub(crate) mod tests { Some(axum::http::StatusCode::BAD_REQUEST), "{problem:?}" ); + assert!(deleted(&store).is_empty()); } /// The control: any other account name is deleted.