mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-03-30 18:15:47 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user