{"record":{"id":"3e37b092ff97d9c3","repo":"block/buzz","slug":"mentions-a-replica-only","errorCode":null,"errorMessage":"mentions a-replica-only","messagePattern":"mentions a-replica-only","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/buzz-db/src/runtime/tests.rs","lineNumber":1959,"sourceCode":"            pool,\n            CommunityId::from_uuid(comm_b),\n            &b_shared,\n            Some(chan_b),\n        )\n        .await\n        .expect(\"mentions b-shared\");\n    }\n    let a_replica_only = tagged(\"a-replica-only\", base + 10);\n    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,","sourceCodeStart":1941,"sourceCodeEnd":1977,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-db/src/runtime/tests.rs#L1941-L1977","documentation":"Panic from `.expect(\"mentions a-replica-only\")` when seeding the replica database in the community-routing test. It fires if the mention insert for the replica-only community-A event fails on the replica pool.","triggerScenarios":"insert_mentions on the `replica` pool with comm_a / a_replica_only fails: replica DB not provisioned, FK missing because insert_top_level for a_replica_only failed, or connection loss.","commonSituations":"Divergence-fixture setup where the replica DB was created but the parent event insert silently skipped, or replica connection string wrong.","solutions":["Verify insert_top_level for a_replica_only succeeded before insert_mentions","Check the replica pool's connection settings","Run migrations on the replica scratch DB"],"exampleFix":"// before\n.await.expect(\"mentions a-replica-only\");\n// after\n.await.unwrap_or_else(|e| panic!(\"mentions a-replica-only: {e}\"));","handlingStrategy":"try-catch","validationCode":"sqlx::query(\"SELECT 1\").execute(&replica).await?;\nassert!(fetch_event(&replica, &a_replica_only.id).await.is_some());","typeGuard":null,"tryCatchPattern":"insert_mentions(&replica, comm_a, &a_replica_only, Some(chan_a)).await\n    .unwrap_or_else(|e| panic!(\"mentions a-replica-only: {e}\"));","preventionTips":["Provision and migrate the replica scratch DB before divergence fixtures","Check replica connection string separately from primary","Assert parent-event existence before each mention insert"],"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"}