From 0e8bcdc5fdbf9d10691d84c8445c3f48fe08fa9b Mon Sep 17 00:00:00 2001 From: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Date: Fri, 2 Oct 2026 14:49:24 -0400 Subject: [PATCH] test(relay): rebuild state when switching private-read auth mode Ingest can leave other references to the shared AppState alive, so Arc::get_mut panicked in CI. Clone the cheap-clone state and rewrap it, as other relay tests do. Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> --- crates/buzz-relay/src/api/private_read_postgres_tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/buzz-relay/src/api/private_read_postgres_tests.rs b/crates/buzz-relay/src/api/private_read_postgres_tests.rs index 1d0f1c391f..09c68cb407 100644 --- a/crates/buzz-relay/src/api/private_read_postgres_tests.rs +++ b/crates/buzz-relay/src/api/private_read_postgres_tests.rs @@ -116,7 +116,11 @@ async fn existing_private_reads_preserve_visible_pages_and_counts() { // Exercise the existing production NIP-98 contract and development X-Pubkey // contract. Both must page/count using the reader selected by that mode. for strict in [false, true] { - Arc::make_mut(&mut Arc::get_mut(&mut state).unwrap().config).require_auth_token = strict; + // Ingest may leave background clones of the shared state alive, so + // rebuild the cheap-clone state instead of requiring a unique Arc. + let mut next = (*state).clone(); + Arc::make_mut(&mut next.config).require_auth_token = strict; + state = Arc::new(next); for route in ["/query", "/count"] { if strict { let (status, result) = post(&state, &host, route, &owner, own.clone(), false).await;