Fixing PgnInstances Tracking In SignalK Source UX
When TypeBox v2 merged into SignalK’s source-priority-ux, a silent but vital feature vanished: real-time tracking of pgnInstances per data instance via FullSignalK. This wasn’t just a bug - it was a cornerstone of conflict resolution, letting devices log every NMEA 2000 data instance they received. The lost code, tucked in handleNmea2000Source, ran on every N2K delta, building a live map of which devices used which instances. Without it, pgnDataInstances in sourceLabels.ts now just holds a snapshot - no ongoing visibility. But here’s the fix: restore the original logic, line by line. packages/server-api/src/fullsignalk.ts already had a precise pattern - accumulating instances by PGN using source.instance and pgn keys - no extra hooks needed. The REST API already surfaces pgnInstances via /signalk/v1/api/sources, so no API change is required. The real risk? Untracked conflicts slipping through when devices sync new instances. Don’t skip this: even small instance shifts matter. When in doubt, check the pgnInstances field on device n2k - it’s your conflict radar. Are you trusting snapshots or real-time data?