Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
49dd4ee
List my claimed repeaters on My account (#2430)
anieto Nov 20, 2026
9a57b2f
test(server): set the local zone in a child process, not via time.Loc…
zfouts Nov 21, 2026
01d2bbb
fix(account): keep Unclaim and Unlink disabled until the list reloads…
anieto Nov 21, 2026
1a6322a
feat(map): more tile providers (topo, satellite, gray, vector), hills…
zfouts Nov 21, 2026
900bffb
refactor(schema): give observers an explicit idx primary key (#2407)
zfouts Nov 21, 2026
c834997
Allow mobile clients to manage repeater claims and details (#2429)
anieto Nov 21, 2026
ae7179e
fix(analytics): node SNR from direct receptions only, drop SNR that b…
efiten Nov 22, 2026
481a33e
fix(neighbors): build edges and SNR only from what the observer heard…
efiten Nov 22, 2026
3d83654
fix(server): one shared rule for Heard By, direct (no 1-byte hop, TRA…
efiten Nov 22, 2026
6ab97f5
feat(node-analytics): signal from direct receptions only, Heard by ob…
efiten Nov 22, 2026
46d6f31
Repeater info: restored drafts keep the saved-meanwhile block; bearer…
anieto Nov 23, 2026
007ba78
Map deep links: shortest observer path, All writes paths=all; og:url …
CoderNemesis26 Nov 23, 2026
42e73e4
feat(users): plain SMTP as a mail provider, plus a test mail (#2463) …
efiten Nov 23, 2026
70dc445
fix(dbschema): observers rebuild keeps local objects, requires a rowi…
zfouts Nov 24, 2026
c5b2d5d
docs(release): notes for v3.19.0 (#2476)
efiten Nov 24, 2026
febddc4
Merge upstream v3.19.0 into the SACMesh fork
kesh33w Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ jobs:
suite 2 test-issue-1639-observers-sort-e2e.js BASE_URL=$B
suite 2 test-issue-748-node-analytics-coverage-e2e.js BASE_URL=$B
suite 2 test-issue-2218-node-analytics-stale-e2e.js BASE_URL=$B
suite 2 test-node-analytics-heard-by-e2e.js BASE_URL=$B
suite 2 test-issue-661-airtime-e2e.js BASE_URL=$B
suite 1 test-health-status-e2e.js BASE_URL=$B
suite 2 test-issue-1268-rf-params-e2e.js BASE_URL=$B
Expand Down Expand Up @@ -796,6 +797,7 @@ jobs:
suite 2 test-issue-1274-legend-coverage-e2e.js BASE_URL=$B
suite 3 test-issue-1648-m5-icons-e2e.js CHROMIUM_REQUIRE=1 BASE_URL=$B
suite 2 test-issue-1997-distance-building-e2e.js CHROMIUM_REQUIRE=1 BASE_URL=$B
suite 3 test-analytics-direct-snr-e2e.js CHROMIUM_REQUIRE=1 BASE_URL=$B
suite 1 test-channel-modal-e2e.js CHROMIUM_REQUIRE=1 BASE_URL=$B
suite 1 test-issue-1522-trace-url-sync-e2e.js CHROMIUM_REQUIRE=1 BASE_URL=$B
suite 2 test-marker-outline-weight.js CHROMIUM_REQUIRE=1 BASE_URL=$B
Expand All @@ -809,6 +811,13 @@ jobs:
# The lint rule that keeps network calls on CSApi (needs eslint).
suite 1 test-lint-network-calls.js
suite 3 test-table-sort.js
# jsdom suites for the map teardown races and vector zoom limits (#2428).
suite 2 test-map-teardown-races.js
suite 2 test-map-vector-leaflet-zoom.js
# The #2428 tile providers and the harness that serves their tiles: every
# tile host is stubbed in the browser, so the fixture server is enough.
suite 3 test-map-providers-e2e.js BASE_URL=$B
suite 3 test-map-providers-harness-e2e.js BASE_URL=$B
suite 1 test-touch-targets.js CHROMIUM_REQUIRE=1 BASE_URL=$B
suite 3 test-live-dedup.js BASE_URL=$B
suite 1 test-nodes-export-e2e.js BASE_URL=$B
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ docs/superpowers/
# Environment-specific deploy scripts — live only on the deploy host, not tracked
deploy-live.sh
deploy-staging.sh
test-results/map-perf/
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
- Region filter frequency mode now shows a Region dropdown beside the Frequency one, so a deployment can be narrowed to one region of a network (`?region=910.525,SJC`). Choosing a frequency limits the Region list to regions with observers on it; quick picks work again in this mode. A frequency on its own gives the same results as before; IATA mode is unchanged.
- Add region filter frequency mode (`regionFilter.mode: "frequency"`): the region dropdown on every page lists observer frequencies instead of IATA codes, so a multi-network deployment can be viewed one network at a time. Off by default; IATA mode is unchanged.
- Add configurable observer-region reception frequency policy and admin Frequency panel, with per-radio status tracking, bounded freshness, unknown policy and no historical deletion.
- Merge upstream v3.19.0. Fork code now joins observers on the explicit `idx` key. Grouped writer commits (`db.batchCommitMs`) pass through a transaction the caller opens with its own `BEGIN` statement, so the v3.19 observers rebuild runs on a batched writer (before this the ingestor refused to start). Observation-cleanup archives name their columns and gain any column the source table gained (such as `observers.idx`), instead of refusing every cleanup after the rebuild.

## [3.19.0] - 2026-11-24

See [docs/release-notes/v3.19.0.md](docs/release-notes/v3.19.0.md) for the full notes. 32 commits since v3.18.0: 14 fix, 8 feat, 5 test, 2 ci, 2 docs, 1 refactor.

### Highlights
- **The ingestor rebuilds the analyzer `observers` table once** (#2407, #2445) - an explicit `idx` primary key; local indexes, triggers and views are kept. It refuses, and ingestor and server stop, on a column CoreScope did not create or a NULL `id`; v3.18.0 still starts then. **Check before upgrading if you changed `observers` by hand.**
- **The content-hash migration from #787 now runs, in the ingestor** (#2409) - only changes old installs with data from before April 18; restart the server if its log line asks.
- **`users.db` migrates to schema v10 with user accounts on** (#2429) - a v3.18.x binary refuses it afterwards, so keep the pre-upgrade copy for a rollback.
- **SNR per node from direct receptions only** (#2451, #2452, #2453, #2454) - Avg SNR, signal grade and "Heard By, direct" change; nodes nobody heard directly show no SNR. `topHops[].bestSnr`, `topHops[].medianSnr` and `hopsVsSnr` are removed from the API.
- **Planner Coverage tab** (#2406), **more map providers and your own tile servers** (#2434), **plain SMTP for account mail plus a test mail** (#2466), **repeater claims from mobile apps** (#2429, #2430). All opt-in.
- **Rows lost at startup** (#2408) and **ingest stopping after a broker restart** (#2413) are fixed.

## [3.18.0] - 2026-11-17

Expand Down
5 changes: 4 additions & 1 deletion Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ COPY scripts/static/ scripts/static/
COPY deploy/static/ deploy/static/
# GIT_COMMIT is the cache buster on every asset (?v=); without one, the build
# time, as the server does at start. CHANNEL beta, next or dev shows a badge.
# CORESCOPE_URL is the public URL for link previews (og:url, og:image); a
# static image cannot read it from requests, so without one og:url is left out.
ARG GIT_COMMIT=
ARG CHANNEL=static
ARG CORESCOPE_URL=
RUN COMMIT="$(printf '%.12s' "${GIT_COMMIT:-$(date +%s)}")" \
API_BASE=same-origin AUTH=true CHANNEL="$CHANNEL" OUT=/srv \
API_BASE=same-origin AUTH=true CHANNEL="$CHANNEL" CORESCOPE_URL="$CORESCOPE_URL" OUT=/srv \
bash scripts/static/build.sh && \
rm /srv/_headers

Expand Down
2 changes: 1 addition & 1 deletion cmd/ingestor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ go test -v ./...
The Go ingestor creates the same v3 schema as the Node.js server:

- `transmissions` — deduplicated by content hash
- `observations` — per-observer sightings with `observer_idx` (rowid reference)
- `observations` — per-observer sightings with `observer_idx` (references `observers.idx`)
- `nodes` — mesh nodes discovered from adverts
- `observers` — MQTT feed sources

Expand Down
4 changes: 2 additions & 2 deletions cmd/ingestor/advert_evidence_migration_race_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func seedUnbackfilledAdvert(t *testing.T, canonical, observed string) (*Store, s
t.Fatal(err)
}
if _, err := s.db.Exec(`INSERT INTO transmissions(id,hash,raw_hex,first_seen,payload_type,route_type) VALUES(1,'legacy-advert',?,'2026-01-01T00:00:00Z',4,?);
INSERT INTO observations(id,transmission_id,observer_idx,raw_hex,path_json,timestamp) VALUES(1,1,(SELECT rowid FROM observers WHERE id='fixture-observer'),?,'[]',1)`, canonical, int(canonical[1]-'0')&3, observed); err != nil {
INSERT INTO observations(id,transmission_id,observer_idx,raw_hex,path_json,timestamp) VALUES(1,1,(SELECT idx FROM observers WHERE id='fixture-observer'),?,'[]',1)`, canonical, int(canonical[1]-'0')&3, observed); err != nil {
s.Close()
t.Fatal(err)
}
Expand Down Expand Up @@ -142,7 +142,7 @@ func BenchmarkAdvertEvidenceLegacyPreservation(b *testing.B) {
b.Fatal(err)
}
var observerIdx int64
if err := s.db.QueryRow(`SELECT rowid FROM observers WHERE id='fixture-observer'`).Scan(&observerIdx); err != nil {
if err := s.db.QueryRow(`SELECT idx FROM observers WHERE id='fixture-observer'`).Scan(&observerIdx); err != nil {
b.Fatal(err)
}
for _, state := range []string{"pending", "checkpointed", "complete"} {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ingestor/advert_route_evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestAdvertRouteEvidenceBackfillResumeAndLiveUnion(t *testing.T) {
if _, err := tx.Exec(`INSERT INTO transmissions(id,hash,raw_hex,first_seen,payload_type,route_type) VALUES(?,?, '1100aa','2026-01-01T00:00:00Z',4,1)`, id, fmt.Sprintf("history-%d", id)); err != nil {
t.Fatal(err)
}
if _, err := tx.Exec(`INSERT INTO observations(transmission_id,observer_idx,raw_hex,path_json,timestamp) VALUES(?,(SELECT rowid FROM observers WHERE id='fixture-observer'),'1200aa','[]',1)`, id); err != nil {
if _, err := tx.Exec(`INSERT INTO observations(transmission_id,observer_idx,raw_hex,path_json,timestamp) VALUES(?,(SELECT idx FROM observers WHERE id='fixture-observer'),'1200aa','[]',1)`, id); err != nil {
t.Fatal(err)
}
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/ingestor/batch_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ func (b *batchConn) before(ctx context.Context, kind stmtKind) error {
if b.depth > 0 {
return nil // inside an application transaction: run as-is
}
if !b.outer && !b.c.AutoCommit() {
// The caller opened its own transaction with a plain BEGIN statement
// (e.g. dbschema's observers rebuild on a pinned connection): run
// as-is until its own COMMIT or ROLLBACK ends it.
return nil
}
switch {
case kind == kindControl:
return b.commit()
Expand Down
52 changes: 52 additions & 0 deletions cmd/ingestor/batch_commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,55 @@ func TestBatchCommitClassify(t *testing.T) {
}
}
}

// A transaction the caller opens with a plain BEGIN statement on a pinned
// connection (dbschema's observers rebuild does this) runs as-is: its writes
// do not open the shared batch, and its own ROLLBACK or COMMIT ends it.
func TestBatchCommitCallerBeginStatementRunsAsIs(t *testing.T) {
s, path := openBatchTestStore(t, maxBatchCommit)
defer s.Close()
ctx := context.Background()
if _, err := s.db.Exec("INSERT INTO batch_probe VALUES (1)"); err != nil {
t.Fatal(err) // leaves the shared batch open
}
conn, err := s.db.Conn(ctx)
if err != nil {
t.Fatal(err)
}
for _, end := range []string{"ROLLBACK", "COMMIT"} {
for _, q := range []string{"BEGIN IMMEDIATE", "INSERT INTO batch_probe VALUES (2)", end} {
if _, err := conn.ExecContext(ctx, q); err != nil {
t.Fatalf("%s: %v", q, err)
}
}
}
conn.Close()
// BEGIN committed the open batch first; ROLLBACK dropped only its own row.
if n := committed(t, path); n != 2 {
t.Fatalf("committed rows = %d, want 2", n)
}
}

// A pre-v3.19 observers table (implicit rowid only) is rebuilt when the
// ingestor opens with grouped commits, as the WAN aggregate does.
func TestBatchCommitOpenRebuildsLegacyObservers(t *testing.T) {
path := filepath.Join(t.TempDir(), "legacy.db")
raw, err := sql.Open("sqlite3", path)
if err != nil {
t.Fatal(err)
}
if _, err := raw.Exec(`CREATE TABLE observers (id TEXT PRIMARY KEY, name TEXT, iata TEXT, last_seen TEXT, first_seen TEXT, packet_count INTEGER DEFAULT 0);
INSERT INTO observers (id, name) VALUES ('a', 'A'), ('b', 'B'); DELETE FROM observers WHERE id = 'a'`); err != nil {
t.Fatal(err)
}
raw.Close()
s, err := OpenStoreWithBatchCommit(path, 300, "NORMAL", time.Second, 0)
if err != nil {
t.Fatalf("open legacy DB with grouped commits: %v", err)
}
defer s.Close()
var idx int64
if err := s.db.QueryRow("SELECT idx FROM observers WHERE id = 'b'").Scan(&idx); err != nil || idx != 2 {
t.Fatalf("observer b idx = %d, %v; want its old rowid 2", idx, err)
}
}
52 changes: 17 additions & 35 deletions cmd/ingestor/client_reception.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,54 +172,36 @@ type ClientReception struct {
// deriveHeardKey applies the RX capture HARD RULE: record only what the
// companion heard itself and directly.
// - direction must be "rx".
// - payload type must not repurpose the header path bytes (TRACE stores
// per-hop SNR there, not node hashes — packetpath.PathBytesAreHops).
// - hops present AND a FLOOD route → the directly-heard node is the LAST hop
// (path[len-1] = the forwarder that just transmitted; each FLOOD forwarder
// appends its hash to the end). 1-byte (2 hex char) prefixes are rejected.
// - hops present on a DIRECT route → NOT attributable: direct forwarders
// consume the next hop from the FRONT (firmware Mesh.cpp removeSelfFromPath),
// so path[len-1] is the route's destination-side end, not who was heard.
// - hops empty + isAdvert → the 0-hop advertiser, by its full pubkey.
// - hops empty + isDiscoverResp → the 0-hop responder, by its pubkey (8 or
// 32 bytes — CTL_TYPE_NODE_DISCOVER_RESP always carries an 8-byte prefix
// or the full 32-byte key; anything else is rejected outright, not
// truncated). A node-discover reply is always a direct, zero-hop RX —
// - the path and advert part is the shared rule, packetpath.HeardKey: last
// hop of a flood route (at least 2 bytes), or the 0-hop advertiser; never
// a direct route with a path, never TRACE.
// - hops empty + isDiscoverResp: the 0-hop responder, by its pubkey (8 or
// 32 bytes; CTL_TYPE_NODE_DISCOVER_RESP always carries an 8-byte prefix
// or the full 32-byte key, anything else is rejected outright, not
// truncated). A node-discover reply is always a direct, zero-hop RX,
// stronger identification than a path hash, since it carries the
// responder's own identity rather than an inferred forwarder.
// - otherwise → not attributable (ok=false).
// - otherwise: not attributable (ok=false).
//
// Returns (heardKey lowercased, keylenBytes, src, ok).
func deriveHeardKey(direction string, routeType, payloadType int, hops []string, advertPubkey string, isAdvert bool, isDiscoverResp bool, discoverPubkey string) (string, int, string, bool) {
if !strings.EqualFold(direction, "rx") {
return "", 0, "", false
}
if !packetpath.PathBytesAreHops(byte(payloadType)) {
return "", 0, "", false
}
last, pk := "", ""
if len(hops) > 0 {
// FLOOD routes (TRANSPORT_FLOOD 0, FLOOD 1) APPEND each forwarder's hash to
// the END of the path, so path[last] is the immediate RF transmitter. DIRECT
// routes (2, 3) consume the next hop from the FRONT, so path[last] is the
// route's destination-side end, NOT who was heard.
if routeType != packetpath.RouteTransportFlood && routeType != packetpath.RouteFlood { // direct route: path[last] is not the transmitter
return "", 0, "", false
}
last := strings.ToLower(strings.TrimSpace(hops[len(hops)-1]))
keylen := len(last) / 2
if keylen < 2 { // exclude 1-byte (collision-prone), matching Reach
return "", 0, "", false
}
return last, keylen, "rxlog", true
last = hops[len(hops)-1]
}
if isAdvert {
pk = advertPubkey
}
if isAdvert && advertPubkey != "" {
pk := strings.ToLower(strings.TrimSpace(advertPubkey))
return pk, len(pk) / 2, "advert", true
if key, src, ok := packetpath.HeardKey(routeType, byte(payloadType), last, pk); ok {
return key, len(key) / 2, src, true
}
if isDiscoverResp && discoverPubkey != "" {
if len(hops) == 0 && isDiscoverResp && discoverPubkey != "" && packetpath.PathBytesAreHops(byte(payloadType)) {
pk := strings.ToLower(strings.TrimSpace(discoverPubkey))
keylen := len(pk) / 2
if keylen != 8 && keylen != 32 { // discover pubkeys are always 8B (prefix) or 32B (full) — no floor, an exact set
if keylen != 8 && keylen != 32 { // discover pubkeys are always 8B (prefix) or 32B (full), no floor, an exact set
return "", 0, "", false
}
return pk, keylen, "discover", true
Expand Down
37 changes: 37 additions & 0 deletions cmd/ingestor/client_reception_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,3 +823,40 @@ func TestHandleClientPacketRejectsNonHexPubkey(t *testing.T) {
t.Fatalf("non-hex pubkey must write nothing, got %d receptions, %d observers", nRecept, nObs)
}
}

// TestDeriveHeardKey_MatchesPacketpath pins deriveHeardKey to the shared
// packetpath.HeardKey rule for every case that rule covers.
func TestDeriveHeardKey_MatchesPacketpath(t *testing.T) {
cases := []struct {
name string
routeType int
payloadType int
lastHop string
advertPubkey string
}{
{"flood, 2-byte last hop", packetpath.RouteFlood, 0x05, "BB11", ""},
{"transport flood counts as flood", packetpath.RouteTransportFlood, 0x05, "bb11", ""},
{"3-byte last hop", packetpath.RouteFlood, 0x05, "bbccdd", ""},
{"1-byte last hop refused", packetpath.RouteFlood, 0x05, "BB", ""},
{"direct route with a path refused", packetpath.RouteDirect, 0x05, "bb11", ""},
{"transport direct with a path refused", packetpath.RouteTransportDirect, 0x05, "bb11", ""},
{"TRACE refused even on flood", packetpath.RouteFlood, packetpath.PayloadTRACE, "bb11", ""},
{"0-hop advert on flood", packetpath.RouteFlood, 0x04, "", "ABCDEF01"},
{"0-hop advert on direct (sendZeroHop)", packetpath.RouteDirect, 0x04, "", "abcdef01"},
{"empty path, no advert pubkey", packetpath.RouteFlood, 0x05, "", ""},
{"TRACE with empty path refused", packetpath.RouteFlood, packetpath.PayloadTRACE, "", "abcdef01"},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
var hops []string
if c.lastHop != "" {
hops = []string{"aa", c.lastHop}
}
wantKey, wantSrc, wantOK := packetpath.HeardKey(c.routeType, byte(c.payloadType), c.lastHop, c.advertPubkey)
key, keylen, src, ok := deriveHeardKey("rx", c.routeType, c.payloadType, hops, c.advertPubkey, c.advertPubkey != "", false, "")
if key != wantKey || src != wantSrc || ok != wantOK || keylen != len(wantKey)/2 {
t.Errorf("deriveHeardKey = (%q, %d, %q, %v), HeardKey = (%q, %q, %v)", key, keylen, src, ok, wantKey, wantSrc, wantOK)
}
})
}
}
Loading