{"record":{"id":"542e4fec2610f914","repo":"block/buzz","slug":"mentions-b-shared","errorCode":null,"errorMessage":"mentions b-shared","messagePattern":"mentions b-shared","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/buzz-db/src/runtime/tests.rs","lineNumber":1947,"sourceCode":"    for pool in [&writer, &replica] {\n        insert_top_level(pool, comm_a, chan_a, &a_shared).await;\n        insert_mentions(\n            pool,\n            CommunityId::from_uuid(comm_a),\n            &a_shared,\n            Some(chan_a),\n        )\n        .await\n        .expect(\"mentions a-shared\");\n        insert_top_level(pool, comm_b, chan_b, &b_shared).await;\n        insert_mentions(\n            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),","sourceCodeStart":1929,"sourceCodeEnd":1965,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-db/src/runtime/tests.rs#L1929-L1965","documentation":"Same failure family as error 71 but for community B: `.expect(\"mentions b-shared\")` panics when insert_mentions fails to insert the mention row for `b_shared` into community B's scoped tables.","triggerScenarios":"insert_mentions(pool, CommunityId::from_uuid(comm_b), &b_shared, Some(chan_b)) fails — pool connection error, missing parent event row, or channel h-tag constraint failure.","commonSituations":"Shared-fixture setup running against an unreachable or un-migrated Postgres; wrong channel id for community B causing a scoping constraint failure.","solutions":["Confirm Postgres is reachable and migrations applied","Insert the parent event (insert_top_level) before its mentions","Inspect the underlying sqlx error rather than panicking on expect"],"exampleFix":"// before\n.await.expect(\"mentions b-shared\");\n// after\n.await.unwrap_or_else(|e| panic!(\"mentions b-shared: {e}\"));","handlingStrategy":"try-catch","validationCode":"sqlx::query(\"SELECT 1\").execute(pool).await?;\nassert!(fetch_event(pool, &b_shared.id).await.is_some(), \"b_shared must exist first\");","typeGuard":null,"tryCatchPattern":"insert_mentions(pool, comm_b, &b_shared, Some(chan_b)).await\n    .unwrap_or_else(|e| panic!(\"mentions b-shared: {e}\"));","preventionTips":["Keep fixture ordering: top-level event, then mentions","Verify each community's channel id matches its community scope","Confirm scratch DB migrations before seeding"],"tags":["postgres","test-setup","insert","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-14T00:17:10.932Z"}