From fc05b948012faeb73d9b67bcea06a426fe746a81 Mon Sep 17 00:00:00 2001 From: you Date: Sun, 22 Mar 2026 08:03:52 +0000 Subject: [PATCH] Rain: only show drops with real raw packet bytes, no faking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Packets from companion bridge (Format 2) have no raw hex — they arrive as pre-decoded JSON. Skip them entirely instead of showing fake/random bytes. --- public/index.html | 2 +- public/live.js | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/public/index.html b/public/index.html index af7605ec..37d31ae6 100644 --- a/public/index.html +++ b/public/index.html @@ -90,7 +90,7 @@ - + diff --git a/public/live.js b/public/live.js index e70fde84..54076156 100644 --- a/public/live.js +++ b/public/live.js @@ -1795,25 +1795,16 @@ function addRainDrop(pkt) { if (!rainCanvas || !matrixRain) return; + const rawHex = pkt.raw || pkt.raw_hex || (pkt.packet && pkt.packet.raw_hex) || ''; + if (!rawHex) return; // no real packet bytes — don't fake it const decoded = pkt.decoded || {}; const hops = decoded.path?.hops || []; const hopCount = Math.max(1, hops.length); - const rawHex = pkt.raw || pkt.raw_hex || (pkt.packet && pkt.packet.raw_hex) || pkt.hash || ''; const bytes = []; for (let i = 0; i < rawHex.length; i += 2) { bytes.push(rawHex.slice(i, i + 2).toUpperCase()); } - // Pad with decoded payload fields if we only got a short hash - if (bytes.length < 8) { - const payload = decoded.payload || {}; - const extra = JSON.stringify(payload).replace(/[^0-9a-f]/gi, ''); - for (let i = 0; i < extra.length && bytes.length < 16; i += 2) { - bytes.push(extra.slice(i, i + 2).toUpperCase()); - } - } - if (bytes.length === 0) { - for (let i = 0; i < 12; i++) bytes.push(((Math.random() * 256) | 0).toString(16).padStart(2, '0').toUpperCase()); - } + if (bytes.length === 0) return; const W = rainCanvas.width; const H = rainCanvas.height;