Handle a batch of delta messages from a Lite peer. Returns one outcome per op. If decoding fails for an op, that op yields a reject; subsequent ops are still attempted.
(
&self,
msg: &ArrayDeltaBatchMsg,
)
| 184 | /// Returns one outcome per op. If decoding fails for an op, that op |
| 185 | /// yields a reject; subsequent ops are still attempted. |
| 186 | pub async fn handle_delta_batch( |
| 187 | &self, |
| 188 | msg: &ArrayDeltaBatchMsg, |
| 189 | ) -> Vec<Result<InboundOutcome, Option<ArrayRejectMsg>>> { |
| 190 | let mut outcomes = Vec::with_capacity(msg.op_payloads.len()); |
| 191 | for payload in &msg.op_payloads { |
| 192 | let outcome = match op_codec::decode_op(payload) { |
| 193 | Ok(op) => self.apply_op(op, payload).await, |
| 194 | Err(e) => { |
| 195 | warn!(array = %msg.array, error = %e, "array_inbound: batch decode failed"); |
| 196 | Err(Some(build_reject( |
| 197 | &msg.array, |
| 198 | Hlc::ZERO, |
| 199 | ArrayRejectReason::ShapeInvalid, |
| 200 | format!("batch decode error: {e}"), |
| 201 | ))) |
| 202 | } |
| 203 | }; |
| 204 | outcomes.push(outcome); |
| 205 | } |
| 206 | outcomes |
| 207 | } |
| 208 | |
| 209 | // ─── Schema ────────────────────────────────────────────────────────────── |
| 210 |
no test coverage detected