From 0edca7fdd7369513b907a4a0c06cf150640ef10f Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Fri, 9 Oct 2026 18:18:14 +0100 Subject: [PATCH] Return empty rows (not null) for filtered pages with no matches --- internal/capture/query.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/capture/query.go b/internal/capture/query.go index 378b452..c3e185c 100644 --- a/internal/capture/query.go +++ b/internal/capture/query.go @@ -55,7 +55,7 @@ func (e *Engine) Packets(ctx context.Context, id, filter string, offset, limit i if offset < 0 { offset = 0 } - p := Page{Offset: offset} + p := Page{Offset: offset, Rows: []Row{}} if strings.TrimSpace(filter) == "" { var first, last sql.NullInt64 e.DB.QueryRow(`SELECT MIN(num),MAX(num) FROM packets WHERE session_id=?`, id).Scan(&first, &last) @@ -98,6 +98,7 @@ func (e *Engine) Packets(ctx context.Context, id, filter string, offset, limit i for _, n := range p.Nums { want[n] = true } + p.Rows = []Row{} for _, r := range all { if want[r.Num] { p.Rows = append(p.Rows, r)