fix(simulation): address bridge review feedback

Replace .lock().unwrap() with .expect("mutex poisoned") in LocalBridge
for clearer panic messages. Document 16MB MAX_MESSAGE_SIZE rationale
in framing.rs with entity count sizing analysis.

Addresses Hoshe PR review suggestions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 19:32:35 +01:00
co-authored by Claude Opus 4.6
parent 78e0c71c6d
commit 9860fc0857
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -4,7 +4,10 @@
use std::io::{self, Read, Write};
/// Maximum message size: 16 MB
/// Maximum message size: 16 MB.
/// Sized for ObserverSnapshot with ~1000 entities (each ~40 bytes serialized),
/// plus generous headroom for future field additions. A full-map dump of 10k
/// entities would be ~400 KB, well within this limit.
const MAX_MESSAGE_SIZE: u32 = 16 * 1024 * 1024;
/// Write a length-prefixed message to a writer.