diff --git a/crates/odin-daemon/src/main.rs b/crates/odin-daemon/src/main.rs index b16a736..2e4c490 100644 --- a/crates/odin-daemon/src/main.rs +++ b/crates/odin-daemon/src/main.rs @@ -1362,14 +1362,19 @@ fn peer_document(envelope: &CultCacheEnvelope) -> Option payload.len(), + // Kept: the catalog meets the same failure when it serves + // the record, and logs it there. + Err(error) => { + eprintln!( + "Odin cannot size {} {} as a snapshot response; kept: {error:#}", + envelope.r#type, envelope.key + ); + return None; + } + }; (size > limit).then(|| (envelope.r#type.clone(), envelope.key.clone(), size)) }) .collect(); @@ -3274,7 +3288,7 @@ mod tests { } /// A peer document whose single-document snapshot response, encoded as the - /// server encodes one with an empty message id, is `response_bytes` long. + /// server encodes one with a one-byte message id, is `response_bytes` long. fn document_answering_in(key: &str, response_bytes: usize) -> Result { let document = |payload_bytes: usize| -> Result { Ok(CultCacheEnvelope { @@ -3298,7 +3312,7 @@ mod tests { tags: None, }; let message = CultNetMessage::SnapshotResponseRaw { - message_id: String::new(), + message_id: "m".into(), documents: vec![served], }; Ok(encode_cultnet_message_to_vec(&message, CultNetWireContract::CultNetSchemaV0)?.len())