diff --git a/internal/db/db_test.go b/internal/db/db_test.go index 031f90f..6e018ec 100644 --- a/internal/db/db_test.go +++ b/internal/db/db_test.go @@ -144,7 +144,9 @@ func TestTelemDb(t *testing.T) { if err != nil { t.Fatalf("error getting packets: %v", err) } - t.Log(pkt) + if len(pkt) != 1 { + t.Fatalf("expected exactly one response, got %d", len(pkt)) + } }) t.Run("test read-write packet", func(t *testing.T) { diff --git a/internal/db/getters.go b/internal/db/getters.go index 8392554..fc10e37 100644 --- a/internal/db/getters.go +++ b/internal/db/getters.go @@ -93,6 +93,9 @@ func (tdb *TelemDb) GetPackets(ctx context.Context, filter BusEventFilter, optio Name: ev.Name, } BusEv.Data, err = skylab.FromJson(ev.Name, ev.Data) + if err != nil { + return events, nil + } events = append(events, BusEv) }