···162162 if let Err(e) = state.blob_store.copy(&temp_key, &storage_key).await {
163163 let _ = state.blob_store.delete(&temp_key).await;
164164 if let Err(db_err) = state.blob_repo.delete_blob_by_cid(&cid_link).await {
165165- error!("Failed to clean up orphaned blob record after copy failure: {:?}", db_err);
165165+ error!(
166166+ "Failed to clean up orphaned blob record after copy failure: {:?}",
167167+ db_err
168168+ );
166169 }
167170 error!("Failed to copy blob to final location: {:?}", e);
168171 return Err(ApiError::InternalError(Some("Failed to store blob".into())));
···170173171174 let _ = state.blob_store.delete(&temp_key).await;
172175173173- if let Some(ref controller) = controller_did {
174174- if let Err(e) = state
176176+ if let Some(ref controller) = controller_did
177177+ && let Err(e) = state
175178 .delegation_repo
176179 .log_delegation_action(
177180 &did,
···187190 None,
188191 )
189192 .await
190190- {
191191- warn!("Failed to log delegation action for blob upload: {:?}", e);
192192- }
193193+ {
194194+ warn!("Failed to log delegation action for blob upload: {:?}", e);
193195 }
194196195197 Ok(Json(json!({
···4545 assert!(nodes.len() >= 3, "expected at least 3 cluster nodes");
46464747 let client = common::client();
4848- let results: Vec<_> = futures::future::join_all(
4949- nodes.iter().map(|node| {
5050- let client = client.clone();
5151- let url = node.url.clone();
5252- async move {
5353- client
5454- .get(format!("{url}/xrpc/com.atproto.server.describeServer"))
5555- .send()
5656- .await
5757- }
5858- })
5959- ).await;
4848+ let results: Vec<_> = futures::future::join_all(nodes.iter().map(|node| {
4949+ let client = client.clone();
5050+ let url = node.url.clone();
5151+ async move {
5252+ client
5353+ .get(format!("{url}/xrpc/com.atproto.server.describeServer"))
5454+ .send()
5555+ .await
5656+ }
5757+ }))
5858+ .await;
60596160 results.iter().enumerate().for_each(|(i, result)| {
6262- let resp = result.as_ref().unwrap_or_else(|e| panic!("node {i} unreachable: {e}"));
6161+ let resp = result
6262+ .as_ref()
6363+ .unwrap_or_else(|e| panic!("node {i} unreachable: {e}"));
6364 assert_eq!(
6465 resp.status(),
6566 StatusCode::OK,
···9192 assert_eq!(create_res.status(), StatusCode::OK);
9293 let body: serde_json::Value = create_res.json().await.expect("invalid json");
9394 let did = body["did"].as_str().expect("no did").to_string();
9494- let access_jwt = body["accessJwt"].as_str().expect("no accessJwt").to_string();
9595+ let access_jwt = body["accessJwt"]
9696+ .as_str()
9797+ .expect("no accessJwt")
9898+ .to_string();
959996100 let pool = common::get_test_db_pool().await;
97101 let body_text: String = sqlx::query_scalar!(
···132136133137 let token = match confirm_res.status() {
134138 StatusCode::OK => {
135135- let confirm_body: serde_json::Value =
136136- confirm_res.json().await.expect("invalid json from confirmSignup");
139139+ let confirm_body: serde_json::Value = confirm_res
140140+ .json()
141141+ .await
142142+ .expect("invalid json from confirmSignup");
137143 confirm_body["accessJwt"]
138144 .as_str()
139145 .unwrap_or(&access_jwt)
···164170async fn cache_convergence() {
165171 let nodes = common::cluster().await;
166172167167- let cache_a = nodes[0]
168168- .cache
169169- .as_ref()
170170- .expect("node 0 should have a cache");
171171- let cache_b = nodes[1]
172172- .cache
173173- .as_ref()
174174- .expect("node 1 should have a cache");
173173+ let cache_a = nodes[0].cache.as_ref().expect("node 0 should have a cache");
174174+ let cache_b = nodes[1].cache.as_ref().expect("node 1 should have a cache");
175175176176 let test_key = format!("ripple-test-{}", uuid::Uuid::new_v4());
177177 let test_value = "converged-value";
···407407 })
408408 .await;
409409410410- let spot_checks: Vec<Option<String>> = futures::future::join_all(
411411- [0, 99, 250, 499].iter().map(|&i| {
410410+ let spot_checks: Vec<Option<String>> =
411411+ futures::future::join_all([0, 99, 250, 499].iter().map(|&i| {
412412 let c = cache_2.clone();
413413 let p = prefix.clone();
414414 async move { c.get(&format!("{p}-{i}")).await }
415415- }),
416416- )
417417- .await;
415415+ }))
416416+ .await;
418417419418 spot_checks.iter().enumerate().for_each(|(idx, val)| {
420419 assert!(
···620619 assert_eq!(create_res.status(), StatusCode::OK, "createAccount non-200");
621620 let body: serde_json::Value = create_res.json().await.expect("invalid json");
622621 let did = body["did"].as_str().expect("no did").to_string();
623623- let access_jwt = body["accessJwt"].as_str().expect("no accessJwt").to_string();
622622+ let access_jwt = body["accessJwt"]
623623+ .as_str()
624624+ .expect("no accessJwt")
625625+ .to_string();
624626625627 let pool = common::get_test_db_pool().await;
626628 let body_text: String = sqlx::query_scalar!(
···654656655657 let token = match confirm_res.status() {
656658 StatusCode::OK => {
657657- let confirm_body: serde_json::Value =
658658- confirm_res.json().await.expect("invalid json from confirmSignup");
659659+ let confirm_body: serde_json::Value = confirm_res
660660+ .json()
661661+ .await
662662+ .expect("invalid json from confirmSignup");
659663 confirm_body["accessJwt"]
660664 .as_str()
661665 .unwrap_or(&access_jwt)
···744748 let cache_0 = cache_for(nodes, 0);
745749746750 let fake_handle = format!("cached-{}.test", uuid::Uuid::new_v4().simple());
747747- let fake_did = format!("did:plc:cached{}", &uuid::Uuid::new_v4().simple().to_string()[..16]);
751751+ let fake_did = format!(
752752+ "did:plc:cached{}",
753753+ &uuid::Uuid::new_v4().simple().to_string()[..16]
754754+ );
748755749756 cache_0
750757 .set(
···795802 let cache_1 = cache_for(nodes, 1);
796803797804 let fake_handle = format!("deltest-{}.test", uuid::Uuid::new_v4().simple());
798798- let fake_did = format!("did:plc:del{}", &uuid::Uuid::new_v4().simple().to_string()[..16]);
805805+ let fake_did = format!(
806806+ "did:plc:del{}",
807807+ &uuid::Uuid::new_v4().simple().to_string()[..16]
808808+ );
799809 let cache_key = format!("handle:{fake_handle}");
800810801811 cache_0
+5-1
crates/tranquil-pds/tests/sync_conformance.rs
···190190 assert!(takendown_repo.is_some(), "Takendown repo should be in list");
191191 let repo = takendown_repo.unwrap();
192192 assert_eq!(repo["active"], false, "repo should be inactive: {:?}", repo);
193193- assert_eq!(repo["status"], "takendown", "repo status should be takendown: {:?}", repo);
193193+ assert_eq!(
194194+ repo["status"], "takendown",
195195+ "repo status should be takendown: {:?}",
196196+ repo
197197+ );
194198}
195199196200#[tokio::test]