From 9eb4bcc088f84d9f59db604b855e4e32a9f87696 Mon Sep 17 00:00:00 2001 From: you Date: Sat, 21 Mar 2026 20:54:59 +0000 Subject: [PATCH] fix: use transmissionId for packet lookup after insert packets_v view uses transmission IDs, not packets table IDs. insertPacket returns a packets table ID which doesn't exist in packets_v, so getPacket returned null and new packets never got indexed in memory. Use transmissionId from insertTransmission instead. --- packet-store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packet-store.js b/packet-store.js index d7553f1..93f9e9c 100644 --- a/packet-store.js +++ b/packet-store.js @@ -308,7 +308,9 @@ class PacketStore { // Also write to normalized tables and get the transmission ID const txResult = this.dbModule.insertTransmission ? this.dbModule.insertTransmission(packetData) : null; const transmissionId = txResult ? txResult.transmissionId : null; - const row = this.dbModule.getPacket(id); + // Use transmissionId to fetch from packets_v (which is based on transmissions+observations) + const lookupId = transmissionId || id; + const row = this.dbModule.getPacket(lookupId); if (row && !this.sqliteOnly) { // Update or create transmission in memory let tx = this.byHash.get(row.hash);