From 9c35e14ae87223e08196c8e811911c86ecaadb51 Mon Sep 17 00:00:00 2001 From: CarterPerez-dev Date: Sat, 2 May 2026 03:36:26 -0400 Subject: [PATCH] fix(monitor/collectors/coinbase): use envelope timestamp (per-ticker time field is not in real Coinbase frames) --- .../backend/internal/collectors/coinbase/collector.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/collectors/coinbase/collector.go b/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/collectors/coinbase/collector.go index 457a51aa..5682b576 100644 --- a/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/collectors/coinbase/collector.go +++ b/PROJECTS/advanced/monitor-the-situation-dashboard/backend/internal/collectors/coinbase/collector.go @@ -103,10 +103,14 @@ func (c *Collector) handleConn(ctx context.Context, conn *Conn) error { loopErr := ReadLoop(ctx, conn, seq, func(hctx context.Context, f Frame) error { switch f.Kind { case FrameTypeTicker, FrameTypeSnapshot: + ts := f.Timestamp.UTC() + if ts.IsZero() { + ts = time.Now().UTC() + } for _, tk := range f.Tickers { tick := Tick{ Symbol: tk.ProductID, - TS: tk.Time.UTC(), + TS: ts, Price: tk.Price, Volume24h: tk.Volume24h, }