mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-03-30 20:35:40 +00:00
Use s.store (in-memory PacketStore) instead of direct packets_v SQL query, matching how the Node.js handler iterates pktStore.packets. This fixes the endpoint returning empty buckets when packets_v view is missing or the DB query fails silently. Key changes: - Group by decoded_json.type first, fall back to payloadTypeNames - Evenly-spaced sampling (up to 8 per type) sorted by raw_hex length - Use actual ObservationCount instead of hardcoded 1 - Reuse payloadTypeNames from store.go instead of duplicating - Retain DB fallback path when store is nil fixes #170 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>