perf(browser): return only forwarding fields used by the client

The only JavaScript consumer already declares and reads pairs, files and watchBytes plus commands and capacity. Seven paired emitted-WASM runs over 200 updates and 20 identities reduced active return bytes by 88.0 percent and idle bytes by 98.9 percent; consumed outputs match across forwarding-limit transitions. Real WASM compilation, focused Core checks, TypeScript and 701 client tests pass. This measurement is serialization cost, not end-to-end media throughput.
This commit is contained in:
AAA committed 2026-11-25 06:07:53 -05:00
1 parent 4c08b3166e
commit 1deaf7bc1b
1 file changed
+9 -1
+9 -1
View File
@@ -480,7 +480,15 @@ impl ForwardingBudget {
Uuid::parse_str(user_id).map_err(|_| error("invalid_user"))?,
&mut snapshot,
);
encode(&serde_json::json!({ "snapshot": snapshot, "commands": commands, "capacity": capacity }))
encode(&serde_json::json!({
"snapshot": {
"pairs": snapshot.pairs,
"files": snapshot.files,
"watchBytes": snapshot.watch_bytes,
},
"commands": commands,
"capacity": capacity,
}))
}
}