mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-29 21:14:06 +00:00
8e96b29859
advert_count was incremented on every upsertNode call, meaning each observation of the same ADVERT packet inflated the count. Node N6NU showed 4191 'adverts' but only had 77 unique ADVERT transmissions. Changes: - db.js: Remove advert_count increment from upsertNode SQL. Add separate incrementAdvertCount() called only for new transmissions. insertTransmission() now returns isNew flag. - server.js: All three ADVERT processing paths (MQTT format 1, companion bridge, API) now check isNew before incrementing. - cmd/ingestor/db.go: Same fix in Go — UpsertNode no longer increments, new IncrementAdvertCount method added. InsertTransmission returns (bool, error) with isNew flag. - cmd/ingestor/main.go: Check isNew before calling IncrementAdvertCount. - One-time startup migration recalculates advert_count from transmissions table (payload_type=4 matching node public_key). Fixes #200 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>