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.
This commit is contained in:
you
2026-03-21 20:54:59 +00:00
parent e1590c6242
commit 9eb4bcc088

View File

@@ -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);