Cybersecurity-Projects/PROJECTS/advanced/monitor-the-situation-dashb.../backend/internal/collectors/coinbase
CarterPerez-dev d4995c1258 fix(monitor/collectors/coinbase): connection-global sequencer; gap is non-fatal log
Two related issues caught in live verification:

1. Coinbase's sequence_num is connection-global (not per-product). Previous
   per-product tracking flagged every cross-product frame as a gap.

2. Even after switching to global tracking, gaps still occur regularly under
   normal operation (Coinbase's exact sequencing pattern across channels is
   not strictly seq+1 frame-to-frame). Treating gaps as fatal kills the
   ReadLoop in seconds, never giving the minute aggregator a chance to cross
   a boundary, so btc_eth_minute stays empty.

Resolution: rewrite Sequencer for a single global counter and downgrade
gap-detection to a non-fatal Warn. ReadLoop continues; (symbol, ts) PK on
btc_eth_ticks is the safety net for any duplicate replay. Includes a
diagnostic log on loop exit (handleConn) for ops visibility.
2026-05-02 04:03:09 -04:00
..
testdata feat(monitor/collectors/coinbase): WS dialer + frame decoder for ticker/heartbeats/snapshot 2026-05-02 03:26:58 -04:00
aggregator.go feat(monitor/collectors/coinbase): per-product minute aggregator with rollover-emit 2026-05-02 03:30:24 -04:00
aggregator_test.go feat(monitor/collectors/coinbase): per-product minute aggregator with rollover-emit 2026-05-02 03:30:24 -04:00
client.go fix(monitor/collectors/coinbase): parse Coinbase's Go-style time format in heartbeat current_time 2026-05-02 04:02:49 -04:00
client_test.go feat(monitor/collectors/coinbase): WS dialer + frame decoder for ticker/heartbeats/snapshot 2026-05-02 03:26:58 -04:00
collector.go fix(monitor/collectors/coinbase): connection-global sequencer; gap is non-fatal log 2026-05-02 04:03:09 -04:00
collector_test.go feat(monitor/collectors/coinbase): collector Run loop ties dial+readloop+aggregator+repo+throttled-emit 2026-05-02 03:32:16 -04:00
readloop.go fix(monitor/collectors/coinbase): connection-global sequencer; gap is non-fatal log 2026-05-02 04:03:09 -04:00
readloop_test.go fix(monitor/collectors/coinbase): connection-global sequencer; gap is non-fatal log 2026-05-02 04:03:09 -04:00
reconnect.go feat(monitor/collectors/coinbase): reconnect-with-backoff helper (1s init, 60s max, ctx-aware) 2026-05-02 03:28:24 -04:00
reconnect_test.go feat(monitor/collectors/coinbase): reconnect-with-backoff helper (1s init, 60s max, ctx-aware) 2026-05-02 03:28:24 -04:00
repo.go feat(monitor/collectors/coinbase): ticks + minute OHLC repo with 1h history reads 2026-05-02 03:24:55 -04:00
repo_test.go fix(monitor/collectors/coinbase): exhaustive switches, %w double-wrap, require.ErrorIs (lint) 2026-05-02 03:42:59 -04:00
sequencer.go fix(monitor/collectors/coinbase): connection-global sequencer; gap is non-fatal log 2026-05-02 04:03:09 -04:00
sequencer_test.go fix(monitor/collectors/coinbase): connection-global sequencer; gap is non-fatal log 2026-05-02 04:03:09 -04:00