mirror of
https://github.com/block/buzz.git
synced 2026-10-27 12:40:30 +00:00
fix(db): preserve canvas validation and IFC schema gates
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: jm <jm@squareup.com>
This commit is contained in:
@@ -2292,6 +2292,15 @@ mod postgres_tests {
|
||||
}
|
||||
expected_fences.extend(personal.fence_attachments);
|
||||
expected_fences.extend(["artifact_heads", "artifact_revisions"].map(str::to_owned));
|
||||
let ifc = surface(
|
||||
MIGRATOR
|
||||
.iter()
|
||||
.find(|m| m.version == 62)
|
||||
.expect("IFC policy migration")
|
||||
.sql
|
||||
.as_ref(),
|
||||
);
|
||||
expected_fences.extend(ifc.fence_attachments);
|
||||
assert_eq!(
|
||||
expected_fences, schema.fence_attachments,
|
||||
"write-fence attachment targets differ after recovery policy"
|
||||
|
||||
@@ -2096,6 +2096,12 @@ pub async fn insert_canvas_head_checked(
|
||||
channel_id: Uuid,
|
||||
precondition: ChannelHeadPrecondition<'_>,
|
||||
) -> Result<(StoredEvent, ChannelHeadWriteStatus)> {
|
||||
let kind_i32 = buzz_core::kind::event_kind_i32(event);
|
||||
if kind_i32 != KIND_CANVAS as i32 {
|
||||
return Err(DbError::InvalidData(format!(
|
||||
"insert_canvas_head_checked requires kind {KIND_CANVAS}, got {kind_i32}"
|
||||
)));
|
||||
}
|
||||
let mut tx = crate::begin_community_event_write_transaction(
|
||||
pool,
|
||||
community_id,
|
||||
|
||||
Reference in New Issue
Block a user