main renamed the three routes this branch governs:
/api/opensky -> /api/flights
/api/opensky-track -> /api/flights/track
/api/adsblol/trace -> /api/military/track
The merge took main's names in the route registrations cleanly, which left the
branch's own material pointing at routes that no longer exist — including
`openSkyTrackGovernor.test.mjs`, which looks its handlers up BY path, so it
failed with "handler is not a function" rather than with anything that named
the cause. Renamed in the test, in both doc comments and in the CHANGELOG and
CURRENT-STATE entries this branch adds. The historical CHANGELOG entry that
main also carries is left alone: it records what was true at that release.
Nothing else about the change moved. The limiter, its sizing, the cooldown
read and the serve-stale path are byte-identical to the branch tip; the only
other differences from it are the two append-only bookkeeping files.
node --test src/openSkyTrackGovernor.test.mjs \
src/tooling/liveProviders.test.mjs src/proxyErrorResponses.test.mjs
tests 34 pass 34 fail 0
npm run format:check Checked 1210 source files.
npm run check:boundaries clean
npm run layer-token:check 28 published, 0 new
The flight, military and vessel feeds were named after the providers the
bundled server uses (/api/opensky, /api/adsblol/mil, /api/ais-live and
their track routes; createOpenSkySource, createAdsbLolSource,
createAisStreamSource). Any server should be able to answer a feed from
its own provider, so the feeds are now:
/api/flights /api/flights/track?icao24=
/api/military /api/military/track?hex=
/api/vessels /api/vessels/track?mmsi=
with createFlightSource, createMilitarySource and createVesselSource. The
old routes are removed. Each server names its provider in X-Feed-Source
(the bundled server sends OpenSky Network, adsb.lol and AISStream, so its
attribution is unchanged) and the military feed's cache state and age in
X-Feed-Cache and X-Feed-Age-Ms. Sources report the provider the server
names and fall back to the feed's name.
A stalled global snapshot held the request for over a minute. Each attempt
now gets 10 seconds, a timed-out or failed attempt is retried once, and a
second failure is answered from the stale cache or the regional fallback.
The OAuth token request gets the same limit.
`/api/opensky-track` costs 4 OpenSky credits per call against the same
~4000/day account as `/api/opensky`, but participated in none of that
proxy's credit governor. Its 60-second per-icao cache bounds memory, not
spend: `icao24` is six hex digits, so a caller that varies it produces a
fresh key and a fresh upstream call every time.
Both track-backfill routes now carry an always-on 30/min per-client
limiter (90 global) — the band `/api/geocode` and `/api/regional-brief`
already use, and far above the real demand, which is one backfill per
aircraft the operator selects.
`/api/opensky-track` additionally reads the 429 cooldown `/api/opensky`
already maintains. While the account is out of budget it serves any
cached track and otherwise answers 429 with the remaining cooldown,
instead of minting a token and spending four more credits. adsb.lol is
free and unmetered, so only the limiter applies there.
Keep the new 502, but store it in the 60 s cache as the proxy already does
for 404/429: /tracks/all costs OpenSky credits, so an oversized track must
not be re-downloaded on every reselect. Update the regression test and
credit the fix in CHANGELOG.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Two independent triggers turned the global status chip red while every layer
was still populated (reproduced at JFK in Cockpit; timeline in the issue).
adsb.lol proxy: a non-OK upstream status was relayed verbatim even with a
12 s-old cache in hand, and the browser layer answers a 429 with a 45 s
cooldown in which every refresh reports "adsb.lol rate limited" without a
network call. The proxy now serves its cached body as STALE on a 429/5xx and
backs off from upstream for Retry-After (bounded), mirroring the OpenSky
proxy. A failure with nothing cached is still relayed.
Mapped installations: the "zoom in" guidance was stored in `error`, so the
manager reported a refresh failure and the chip a LOAD FAILED whenever the
view could not be bounded (Cockpit looks at the horizon). The status is now
set without an error string; the row reads the prompt from `statusMessage`,
and the chip ignores `error` for guidance statuses, matching the carve-out
layerFeedState already has.