zebra-report: sync chat page — drop self-echo frames at onRxFrame entry

This commit is contained in:
russell@unturf.com 2026-05-27 16:00:29 -04:00
parent 695b6af58f
commit b74e838d35

View file

@ -772,6 +772,15 @@ async function onRxFrame(bytes) {
logLine('err', `rx: malformed frame (type=${f.type}, ${f.error})`);
return;
}
/* same-machine PA mix echoes our own carrier back to us. drop any frame
* whose sender id matches our own so we don't double-render. loopback
* mode is unaffected because BroadcastChannel never echoes to sender. */
if (f.sid) {
const mine = await senderIdBytes();
let isSelf = true;
for (let i = 0; i < 4; i++) if (f.sid[i] !== mine[i]) { isSelf = false; break; }
if (isSelf) return;
}
if (f.type === T_OFFER) {
logLine('sys', `rx: OFFER from peer — ${f.baud} baud`);
/* respond with READY at handshake baud */