[Bug 898] UDP (local) spots can show an incorrect location of the spotter#907
[Bug 898] UDP (local) spots can show an incorrect location of the spotter#907alanhargreaves wants to merge 1 commit intoaccius:Stagingfrom
Conversation
accius
left a comment
There was a problem hiding this comment.
Review — UDP spotter location fallback (draft)
Minimal, targeted fix. The one-line change is sensible for the local-UDP case: the "spotter" in a local UDP feed is effectively the operator themselves, so falling back to the server's CONFIG.gridSquare (which in self-hosting mode = the operator's grid) is reasonable when the upstream program doesn't supply one.
Concerns / questions
-
CONFIG.gridSquaresemantics in a multi-tenant deployment. On the public server atopenhamclock.com,CONFIG.gridSquareis the server operator's grid, not the individual user's — if this code path is ever reached in the hosted deployment, we'd be tagging every UDP spot with the server's location. Can you confirm thisudpSessioncode path is only hit in self-hosted mode? If there's any chance it runs for hosted users, please guard with anisLocal/isSelfHostedcheck or pass the user's own grid in via the session. -
CONFIGin scope: please double-check thatCONFIGis imported/available at the top of this route, and thatCONFIG.gridSquareis the field name (vsCONFIG.locator— the frontend config useslocator). A grep for otherCONFIG.gridSquarereferences inserver/would be reassuring. -
Nit: consider falling back to
CONFIG.locatorifCONFIG.gridSquareisn't set — same source, different name on the frontend config, and either could be the canonical field depending on how the server reads the user's config. -
PR description typos ("teh", "preoblematical", "gris") — tidy up before marking ready.
Happy to re-review when out of draft.
What does this PR do?
When using Local UDP for a DX Cluster source, some programs do not list a lat/lon or grid square. When this happens,
s.spotterGridis set tonulland the hooks code tries to find teh location based purely on teh callsign prefix, which can be preoblematical.This fix uses
CONFIG.gridSquareinstead of just defaulting tonullif no gridSquare is offered.Type of change
How to test
curl localhost:3000/api/dxcluster/pathsspotterGridis set to the local gris squareChecklist
server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)var(--accent-cyan), etc.).bak,.old,console.logdebug lines, or test scripts included