Files
meshcore-analyzer/tools
Kpa-clawbot b97fe5758c fix(ci): freshen observer timestamps so RemoveStaleObservers doesn't prune them on startup (#960)
## Bug

Master CI failing on `Map page loads with markers: No map
markers/overlays found` since #954 (observer filter) merged.

## Root cause chain

1. Fixture has 31 observers, all dated `2026-03-26` to `2026-03-29` (33+
days old)
2. PR #957's `tools/freshen-fixture.sh` shifts `nodes`, `transmissions`,
`neighbor_edges` timestamps but NOT `observers.last_seen`
3. Server startup runs `RemoveStaleObservers(14)` per
`cmd/server/main.go:382` — marks all 33-day-old observers `inactive=1`
4. PR #954's `GetObservers` filter then excludes them
5. `/api/observers` returns 0 → map has no observer markers → test
asserts >0 → fails

Server log line confirms: `[db] transmissions=499 observations=500
nodes=200 observers=0`

## Fix

Extend `freshen-fixture.sh` to also shift `observers.last_seen` (same
algorithm — preserve relative ordering, max anchored to now). Also
defensively clear any stale `inactive=1` flags from prior failed runs.
The `inactive` column may not exist on a fresh fixture (server adds via
migration); script silently no-ops if column absent.

## Verification

```
$ bash tools/freshen-fixture.sh /tmp/test.db
nodes: min=2026-05-01T11:07:29Z max=2026-05-01T18:49:02Z
observers: count=31 max=2026-05-01T18:49:02Z
```

After: 31 observers, oldest 3 days old, within the 14d retention window.
Server's startup prune won't touch them.

Co-authored-by: Kpa-clawbot <bot@example.invalid>
2026-05-01 16:55:25 -07:00
..