Repository navigation
feat: estimated positions for repeaters known only from their reported name (map) - #18
Merged
Merged
Conversation
…stimated position A repeater that told a mobile companion its name (client_node_names) but never sent an advert has no nodes row and no position, so the UI could not show it anywhere. This endpoint lists every such repeater and adds an estimate when the receptions allow one (cmd/server/reported_nodes.go). - Receptions that count: discover/advert rows keyed by the full pubkey or its 8-byte prefix, and rxlog rows whose 2-3 byte path hash resolves uniquely to the repeater (lookupPrefixes). geo rows are left out. - Receptions within 100 m form one spot with the best SNR. - Estimate only from 3 spots at least 200 m apart: SNR-weighted centroid, weight 10^(snr/20), radius to the farthest spot, at least 500 m. - A repeater with an advert position in nodes or inactive_nodes is left out; blacklist and hidden name prefixes apply. - Cached 5 minutes, compute time logged. List capped at 500 repeaters. - Documented in openapi.go. Tests: spot merging, threshold, weighted centroid, radius and floor, the endpoint with discover/rxlog/geo rows, an ambiguous path hash, blacklist, hidden name, advert position, missing table. Full server suite passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repeaters from /api/nodes/reported with an estimate get their own layer (public/map-estimated.js), never clustered with advert markers: - a hollow dashed marker with "≈", in the repeater colour - a dashed, non-interactive circle with the uncertainty radius - a popup with an "Estimated position" badge, "No advert position", the radius, receptions and spots, first/last heard, who reported the name, the one-sided-driving caveat, and a link to the coverage map there - an "Estimated positions" toggle under Display, on by default and stored in localStorage; hidden too when repeaters are filtered out or a route is shown The map keeps working against a server without the route (fetch failure leaves the list empty). Method and limits in docs/client-rx-coverage.md. Tests: tests/unit/test-map-estimated.js (vm sandbox, Leaflet stub) and tests/e2e/test-map-estimated-e2e.js (mocked API: marker, dashed circle, popup text, toggle and its stored state, no page errors), registered in test-all.sh, scripts/non-unit-tests.json and the E2E workflow. All frontend unit suites pass; the new E2E and test-map-nodes-pagination-e2e pass against a static server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A repeater that told a CoreDrive companion its name (
client_node_names, #17) but never sent an advert has nonodesrow and no position. This PR makes it visible on the map at an estimated position, drawn so it cannot be mistaken for an advert position. Part 1 of 2: the nodes list, search and a detail view follow in a separate PR.45127c91Server:GET /api/nodes/reported(cmd/server/reported_nodes.go) lists every repeater inclient_node_nameswithout an advert position innodes/inactive_nodes.discover/advertrows keyed by the full pubkey or its 8-byte prefix, plusrxlogrows whose 2-3 byte hash resolves uniquely to it.georows are left out.10^(snr/20)), with radius = distance to the farthest spot, minimum 500 m.openapi.go.587f4634Map:public/map-estimated.jsdraws each estimate on its own layer:Performance
client_node_names, onelookupPrefixescall for the short hashes, and oneINquery per 400 keys onclient_receptions, which uses theidx_client_recept_heard_geoindex.Test plan
go test ./...incmd/server: pass. New tests cover spot merging, threshold, weighted centroid, radius floor, discover/rxlog/geo handling, an ambiguous path hash, blacklist, hidden name, advert position, and a missing table.test-all.shfrontend unit suites: pass. New:tests/unit/test-map-estimated.js.tests/e2e/test-map-estimated-e2e.js(new) andtest-map-nodes-pagination-e2e.jsagainst a static server with mocked API: pass.public/map-estimated.js: pass.Not done: customizer exposure of the thresholds (100 m, 3 spots / 200 m, 500 m, 5 min TTL). They are hardcoded for now, per rule 8.