144 Commits
Author SHA1 Message Date
Ded 137e3d265a Revert "fix: keep IATA packet paging alive past short pages"
This reverts commit ddc6dc1ca9.
2026-08-20 08:35:23 -07:00
MrAlders0n ddc6dc1ca9 fix: keep IATA packet paging alive past short pages
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.
2026-08-19 16:21:26 -07:00
MrAlders0n 7d759d0a0f perf: known_routes retention, digest identity, and a working batched reconfirm (#98)
* fix: cascade channel_messages on packet delete

* rebuild known_routes keyed on (iata, path_key)

* add route retention delete, batch reconfirm, path_key upsert

* compute route path_key in store, add DeleteOldRoutes

* add routes retention config

* wire route retention into cleanup, batch reconfirm

* prune routes in reconfirm task, not cleanup

* expand routes retention docs in example config
2026-08-12 09:30:03 -04:00
MrAlders0n c6d23a2b52 fix: cascade channel_messages on packet delete 2026-08-11 12:59:10 -07:00
Enot (ded) Skelly b44cae89d7 add neighbor message parsing
closes #94
2026-07-30 13:19:18 -07:00
Enot (ded) Skelly ae0669ccbe enrich packet observations 2026-07-27 09:41:11 -07:00
Enot (ded) Skelly 336b734a42 feat: add stats api for new clock drift tracking
closes: #91
2026-07-24 14:01:12 -07:00
Enot (ded) Skelly d8371f04d0 feat: split top adverts into flood/direct
closes: #90
2026-07-24 13:49:40 -07:00
Enot (ded) Skelly 3cad2dfda1 feat: process messages for new channels at boot
any new channel added to config will get backfilled if there
are any messages to decrypt

closes: #68
2026-07-24 13:27:27 -07:00
Enot (ded) Skelly 99d7eb0bab feat: add node stale/delete config
closes: #93
2026-07-24 13:09:51 -07:00
Enot (ded) Skelly 3f2506fc8b feat: add geojson for iatas
closes #66
2026-07-24 12:59:48 -07:00
MrAlders0n cbde3d02da perf(stats): matview-back top talkers and advertisers 2026-07-24 12:07:05 -07:00
MrAlders0n bc3a375816 perf(stats): bucket payload & observer matviews by hour for windowed queries
The payload-breakdown and top-observers matviews stored a single 7-day
total per group, so the 24h/7d/30d selector did nothing: payload ignored
the window entirely (the store discarded `since`) and top-observers only
varied which rows cleared the last_heard cutoff, never the counts.

Bucket both views by hour over a 30-day horizon and sum the buckets in
range, mirroring mv_hourly_iata_stats. The stats endpoints now honour the
requested window while still reading a small precomputed table.
2026-07-24 12:07:05 -07:00
MrAlders0n b93ce7aba6 serve top observers from a matview instead of scanning per request 2026-07-24 12:07:05 -07:00
MrAlders0n d8ff7d0542 track payload_type on observations and serve the breakdown from a matview 2026-07-24 12:07:05 -07:00
MrAlders0n 63c0b9779d perf(routes): index known_routes(last_seen)
The routes list orders by last_seen with no index, so every page
seq-scanned and sorted ~150k rows. Same fix as the packets list got
in 008.
2026-07-24 12:07:05 -07:00
MrAlders0n 42edcdeb7b perf(scopes): stop cross-joining packets in scope stats
GetScopeStats left-joined packets, observer_scopes and nodes at once,
multiplying rows into the millions before COUNT(DISTINCT) deduped them
(~10s per call). Count each table on its own and index packets(scope_id).
2026-07-24 12:07:05 -07:00
MrAlders0n a84112f7fb fix(traces): review fixes for trace_iatas
Refresh last_heard on duplicate observations too, capped at hourly, so
steady traffic can't age a trace out of the filter (dedup key has no
heard_at). Drop the unused last_heard index column so upserts stay HOT,
and share one retention cutoff across the cleanup deletes.
2026-07-24 12:07:05 -07:00
MrAlders0n 457747b353 perf(traces): track trace activity per IATA in its own table
The trace list joined every trace packet to ~50M observations to apply
the IATA filter; the parallel hash join overran docker's 64MB /dev/shm
and the filtered list errored. Keep a small trace_iatas table at ingest
(like channel_iatas) and group packets by tag instead. Filtered stats
are now per tag rather than per matching packet.
2026-07-24 12:07:05 -07:00
MrAlders0n ba0e85c44e fix(channels): review fixes for channel_iatas
Refresh last_heard on duplicate observations too, capped at hourly, so
steady traffic can't age a channel out of the filter while its packets
stay retained (dedup key has no heard_at). Guard the seed join against
the docker /dev/shm cap like the trace one, and drop the unused
last_heard index column so the upserts stay HOT.
2026-07-24 12:07:05 -07:00
MrAlders0n dff9c6cf00 perf(channels): track channel activity per IATA in its own table
The IATA filter ran a correlated EXISTS over packets/observations with
ILIKE, which skipped the iata index and took ~7s live. Keep a small
channel_iatas table at ingest (like node_iatas) and filter against it.
Also honor the iatas= param so multi-site regions stop getting the
global list. Filter now ages out with packet retention rather than
matching any retained packet.
2026-07-24 12:07:05 -07:00
Enot (ded) Skelly b33ebc007b feat: add plural value filter params
closes #76
2026-07-23 14:26:16 -07:00
Enot (ded) Skelly 8e2798612b feat: add clock drift tracking
closes #71
2026-07-23 13:34:41 -07:00
Enot (ded) Skelly b38663d3a1 feat: add stats for top advertiser and talkers
closes #75
closes #74
2026-07-23 10:41:16 -07:00
Enot (ded) Skelly 0ca28cc6a8 feat: node prefix search
pubkeyPrefix takes any even length prefix string case-insensitive
and returns all matches
2026-07-23 10:14:47 -07:00
Enot (ded) Skelly f07edf9fb6 feat: include source and destination in path data where available
realted to #85
2026-07-23 09:44:27 -07:00
Enot (ded) Skelly 7a58a07bbd fix: trace packet paths
closes #86
2026-07-23 09:20:00 -07:00
Enot (ded) Skelly ac67308f21 fix: dont log empty status from observers
closes #79
2026-07-23 08:43:26 -07:00
MrAlders0n 30772da2c5 perf(packets): drive IATA-filtered list from the observation index
Quiet sites probed hundreds of thousands of packets to fill a page.
Walk idx_observations_iata_heard per requested site and dedup instead.
Filtered lists now order by site-local recency; the cursor follows.
2026-07-20 09:07:05 -07:00
MrAlders0n 508337b8ca perf(db): pass IATA filters as bpchar[] instead of CSV
text[] from string_to_array can't match the CHAR(3) indexes and hides
the values from the planner. Handlers already have a slice; stop
joining to CSV in the store layer and pass a typed array everywhere.
2026-07-20 09:07:05 -07:00
MrAlders0n b8665ebd66 perf(db): index packets(last_heard_at)
The packet list sorts by last_heard_at, so every page was a seq scan
plus sort over all packets. Cheap to maintain now that presence writes
are coalesced.
2026-07-20 09:07:05 -07:00
MrAlders0n 0afba79b02 perf(paths): split path hash resolution by prefix width
the CASE predicate forced postgres to replan every call; per-width queries reuse a cached plan on the (iata, prefix_n) indexes
2026-07-20 09:01:51 -07:00
MrAlders0n 5804524f0e feat(db): add batched presence touch queries
single-statement flush targets for coalesced last_seen/last_heard_at bumps
2026-07-20 08:55:18 -07:00
Enot (ded) Skelly a14a0ac658 feat(paths): included resolved path in ws observation events
changes to shared helper for resolve paths
2026-07-02 09:39:10 -07:00
Enot (ded) Skelly 4e2ee62bad feat(nodes): add ?neighbors to list nodes
inlcudes neighbor IDs in node details list
2026-07-02 09:12:23 -07:00
Enot (ded) Skelly 420a43172b fix(ingest): dedupe unknown channel hashes 2026-07-02 08:08:54 -07:00
Enot (ded) Skelly 25316a3474 fix(observations): drop heardAt from packet_observation unique constraint
this was causing duplicates and each obersver heard a given
packet hash or it didn't, there are not more observations of
the same hash from one observer
2026-06-24 08:04:04 -07:00
Enot (ded) Skelly fd24a71143 feat(neighbors): add observer neighbor snr on discovery response 2026-06-16 14:26:33 -07:00
Enot (ded) Skelly 7b39160ff5 feat(neighbors): add optional snr column 2026-06-16 12:54:31 -07:00
Enot (ded) Skelly ac54e41e49 fix(neighbors): deduplicate count in node summaries
only return the count of unique neighbors
2026-06-16 09:06:41 -07:00
Enot (ded) Skelly b4152e0e5f feat(ingest): use last seen in observer online check
now uses last seen (packet message) as well as last
status (status message) as indicators of observer
being online or not
2026-06-16 09:00:06 -07:00
Enot (ded) Skelly 16b4394b30 chore(tests): add license header to recent test files 2026-06-15 14:13:34 -07:00
Enot (ded) Skelly c03abb1f53 tests(db): finish integration db/api tests
adds nodes, observers and packets
2026-06-15 13:47:31 -07:00
Enot (ded) Skelly 64ff9fc030 maint(tests): start adding integration tests
first db <> api mapping

add filter to test coverage action to ignore generated
code like sqlc and swagger docs
2026-06-15 13:26:03 -07:00
Enot (ded) Skelly dfef16435c feat(db): change to sqlc Querier in Store
this generates an interface for our sqlc methods and
changes the db Store to hold that instead in preparation
for mocking and integration tests
2026-06-15 11:13:39 -07:00
Enot (ded) Skelly 4ebe4c869b feat: add route and neighbor reconfirmation task
prunes stale and ambiguous routes and neighbors

keep that data clean
2026-06-12 10:54:06 -07:00
Enot (ded) Skelly 8b7bc21b28 fix(neighbors): don't record neighbors that are not room or repeater 2026-06-12 09:51:06 -07:00
gadgethd 87239bd4b8 fix(seed): make UpsertIATADetails a true upsert
UpsertIATADetails was a plain UPDATE that silently affected zero rows
when the iata_codes row did not yet exist.  Adding a new IATA to the
config for the first time resulted in display_name, approx_lat, and
approx_lng remaining NULL.

Change the query to INSERT ... ON CONFLICT DO UPDATE so the row is
atomically created (if missing) or updated (if present), matching the
function's name and the pattern used by UpsertTransportScope.
2026-06-12 08:25:14 -07:00
Enot (ded) Skelly 5315af205c feat(traces): embed max-hop observation path and SNR in list response 2026-06-11 15:45:08 -07:00
Enot (ded) Skelly c3bf6d7e0d feat: add auto db migration in binary 2026-06-11 15:39:07 -07:00