From 863a6d8fd4448f834ebb58883b56782a9fc542ba Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Mon, 3 Aug 2026 18:39:13 +0200 Subject: [PATCH] [fix](trx-frontend-http): restore decode history from the stored records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replay required every restored record to carry a string `type`, and stored records do not have one: an AIS entry holds mmsi, lat, lon, crc_ok and its decoder's own fields, nothing more. The filter therefore discarded all of them, and did it silently — the fetch returned its full payload, the worker decoded it, and no error was logged, so the history simply never appeared. That field identifies live SSE frames, which do carry it, which is why only replay was affected. History arrives already grouped and the group's kind is delivered alongside the messages, so `type` was never needed to route them. Require only that a record is an object. Confirmed against a live server: the first restored group is AIS, and its records expose their decoder fields with `type` undefined. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz Signed-off-by: Stan Grams --- .../trx-frontend-http/assets/web/generated/app.js | 2 +- .../trx-frontend/trx-frontend-http/frontend/src/app.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/generated/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/generated/app.js index e3ccf263..7f15e6ab 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/generated/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/generated/app.js @@ -7424,7 +7424,7 @@ function connectDecode() { return; } if (data.type === "group") { - const messages = Array.isArray(data.messages) ? data.messages.filter((message) => isRecord2(message) && typeof message.type === "string") : []; + const messages = Array.isArray(data.messages) ? data.messages.filter((message) => isRecord2(message)) : []; enqueueDecodeHistoryGroup(typeof data.kind === "string" ? data.kind : "", messages); return; } diff --git a/src/trx-client/trx-frontend/trx-frontend-http/frontend/src/app.ts b/src/trx-client/trx-frontend/trx-frontend-http/frontend/src/app.ts index 2d04143a..0c8bde2e 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/frontend/src/app.ts +++ b/src/trx-client/trx-frontend/trx-frontend-http/frontend/src/app.ts @@ -6366,7 +6366,12 @@ function connectDecode() { } if (data.type === "group") { const messages = Array.isArray(data.messages) - ? data.messages.filter((message): message is DecodeMessage => isRecord(message) && typeof message.type === "string") + // Stored records carry only decoder fields — an AIS entry has mmsi, + // lat, lon and so on, and no `type`. That field identifies live SSE + // frames; history is already grouped, and the group's kind is + // delivered alongside these messages, so requiring it here discarded + // every restored record silently. + ? data.messages.filter((message): message is DecodeMessage => isRecord(message)) : []; enqueueDecodeHistoryGroup(typeof data.kind === "string" ? data.kind : "", messages); return; -- 2.55.0