cultmesh-rs tests: answer a subscribe by editing the vector's snapshot

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-28 05:06:17 +01:00
commit 61381338ac

View file

@ -171,13 +171,11 @@ fn vector_selection() -> Selection {
}
/// The vector's snapshot, answering `message_id`.
fn snapshot_answering(message_id: &str) -> CultNetMessage {
match decode(&session()[1]) {
CultNetMessage::SnapshotResponseRawV1 { matched, as_of, next, headers, documents, .. } => {
CultNetMessage::SnapshotResponseRawV1 { message_id: message_id.into(), matched, as_of, next, headers, documents }
}
other => panic!("{other:?}"),
}
fn snapshot_answering(answered: &str) -> CultNetMessage {
let mut message = decode(&session()[1]);
let CultNetMessage::SnapshotResponseRawV1 { message_id, .. } = &mut message else { panic!("{message:?}") };
*message_id = answered.into();
message
}
fn change_part(message_id: &str, subscription: &str, commit: &str) -> CultNetMessage {