{"record":{"id":"30dbb8432666abdc","repo":"block/buzz","slug":"mentions-b-replica-only","errorCode":null,"errorMessage":"mentions b-replica-only","messagePattern":"mentions b-replica-only","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/buzz-db/src/runtime/tests.rs","lineNumber":1968,"sourceCode":"    let b_replica_only = tagged(\"b-replica-only\", base + 11);\n    insert_top_level(&replica, comm_a, chan_a, &a_replica_only).await;\n    insert_mentions(\n        &replica,\n        CommunityId::from_uuid(comm_a),\n        &a_replica_only,\n        Some(chan_a),\n    )\n    .await\n    .expect(\"mentions a-replica-only\");\n    insert_top_level(&replica, comm_b, chan_b, &b_replica_only).await;\n    insert_mentions(\n        &replica,\n        CommunityId::from_uuid(comm_b),\n        &b_replica_only,\n        Some(chan_b),\n    )\n    .await\n    .expect(\"mentions b-replica-only\");\n\n    // Needs-action fixtures: approval kind, replica-only in BOTH\n    // communities, so the assertion below is replica-served on A and\n    // must still not see B's.\n    let a_approval = tagged_kind(46010, \"a-approval-replica-only\", base + 20);\n    let b_approval = tagged_kind(46010, \"b-approval-replica-only\", base + 21);\n    insert_top_level(&replica, comm_a, chan_a, &a_approval).await;\n    insert_mentions(\n        &replica,\n        CommunityId::from_uuid(comm_a),\n        &a_approval,\n        Some(chan_a),\n    )\n    .await\n    .expect(\"mentions a-approval\");\n    insert_top_level(&replica, comm_b, chan_b, &b_approval).await;\n    insert_mentions(\n        &replica,","sourceCodeStart":1950,"sourceCodeEnd":1986,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-db/src/runtime/tests.rs#L1950-L1986","documentation":"Panic from `.expect(\"mentions b-replica-only\")` seeding community B's replica-only mention fixture on the replica pool. Err indicates the mention insert failed on the replica database.","triggerScenarios":"insert_mentions(&replica, CommunityId::from_uuid(comm_b), &b_replica_only, Some(chan_b)) returns Err — replica connection failure, missing parent event, or schema/constraint mismatch.","commonSituations":"Replica scratch DB missing migrations or unreachable; fixture ordering issue where b_replica_only's top-level event insert failed first.","solutions":["Ensure b_replica_only's top-level event was inserted before its mention","Confirm the replica pool connects and is migrated","Log the sqlx error via unwrap_or_else for diagnosis"],"exampleFix":"// before\n.await.expect(\"mentions b-replica-only\");\n// after\n.await.unwrap_or_else(|e| panic!(\"mentions b-replica-only: {e}\"));","handlingStrategy":"try-catch","validationCode":"sqlx::query(\"SELECT 1\").execute(&replica).await?;\nassert!(fetch_event(&replica, &b_replica_only.id).await.is_some());","typeGuard":null,"tryCatchPattern":"insert_mentions(&replica, comm_b, &b_replica_only, Some(chan_b)).await\n    .unwrap_or_else(|e| panic!(\"mentions b-replica-only: {e}\"));","preventionTips":["Same replica-health and ordering checks as other replica fixtures","Isolate replica bootstrap in a helper that fails fast","Surface sqlx error details instead of bare expect messages"],"tags":["postgres","test-setup","replica","panic"],"backgroundTag":"expect-panic-on-result","analyzedSha":"dad5a33865fc81a2e55b3b60746632f615ec1e3a","analyzedAt":"2026-08-30T13:49:18.474Z","contentChangedAt":"2026-08-30T13:49:18.474Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}