Skip to content

fix: IATA-filtered packet lists stop paginating early - #100

Merged
446564 merged 1 commit into
MeshCore-Beacon:devfrom
MrAlders0n:fix/iata-packet-pagination-dead-end
Aug 19, 2026
Merged

fix: IATA-filtered packet lists stop paginating early#100
446564 merged 1 commit into
MeshCore-Beacon:devfrom
MrAlders0n:fix/iata-packet-pagination-dead-end

Conversation

@MrAlders0n

@MrAlders0n MrAlders0n commented Aug 7, 2026

Copy link
Copy Markdown
Member

What this PR does

The IATA-filtered packet list from #84 walks each site's observation log and dedups. A packet appears once per observer, so a scan of (limit+1)*8 observations can collapse to fewer distinct packets than the page asked for — and a short page was being read as end of data:

hasMore := len(rows) > int(limit)

That's a hard stop, not a display quirk. On my instance YOW (27 observers, ~8–9 hear a given packet) dead-ended after 3 pages / 292 packets with 13 hours of history still in the table and unreachable by scrolling. It flips with page size rather than failing consistently — limit=10 and limit=20 returned full pages and still said hasMore: false, while limit=100 was fine.

The query now reports whether any site's scan hit scan_depth (scan_saturated) and the timestamp above which every requested site is covered (scan_floor). A saturated short page keeps hasMore true, and the cursor is clamped to the floor so paging on can't skip the band a saturated scan never read — worst case a packet repeats and the client dedups by hash.

Scan depth itself is unchanged; this is only about not claiming the data has run out.

Same walk back through YOW, before and after:

  • limit=200: dead end at page 3 (292 packets) → reaches a 13.5h-old packet at page 15 (2988 packets)
  • limit=50: dead end at page 3 → page 59

Page latency unchanged at ~41ms.

A packet repeats once per observer in the site scan, so grouping can
collapse a scan_depth window to fewer packets than the page asked for.
That short page set hasMore=false and stranded all older history: YOW
dead-ended after 45 packets, ~6 minutes back.

Report scan saturation and the floor the scans covered, and treat a
saturated short page as more data. Clamp the cursor to the floor so
paging on cannot skip the band the scan never read.
@MrAlders0n
MrAlders0n requested a review from 446564 as a code owner August 7, 2026 14:08
@446564
446564 merged commit ddc6dc1 into MeshCore-Beacon:dev Aug 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants