From 86033046ae5ad5a209c289c0a291bc4fd52b6370 Mon Sep 17 00:00:00 2001 From: Kartios Date: Mon, 24 Aug 2026 16:50:26 -0700 Subject: [PATCH] fix: the merged board asked for weather in the middle of the state, and got a 400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `carriesMetroDetail` is true of it, so it watched at `entry.city.center` — 37.30, -119.25, which is Sierra foothills five hundred kilometres from either station this deployment serves. Found by loading the deployed build and reading the network log, not by any test. Aircraft from two regions merge because they are disjoint objects in one sky; two weather observations do not. A board cannot be foggy at the Golden Gate and clear over Riverside at once, and applying either one statewide is a worse lie than the climatology model. So the merged board takes the model, which is the rule the comment above it already stated. --- src/main.ts | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 65ea711..01d8808 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2465,8 +2465,39 @@ function activateBoard(record: MountedBoard): void { // are: one honest station cannot describe a 600 km corridor. California uses // the local climatology model; the detailed SF and SoCal boards keep their // live observations. + // + /* + * And the merged board uses climatology too, which took a 400 in production + * to notice. + * + * `carriesMetroDetail` is true of it — it carries both metros' districts — + * so it asked, at `entry.city.center`, which is the middle of the *state*: + * `GET /api/v1/weather?lat=37.30&lng=-119.25` → `400 bad_request, "Nothing + * this deployment serves is near 37.3,-119.25"`. The API is right. What it + * serves is San Francisco and the Southland, five hundred and sixty + * kilometres apart, and the point midway between them is farm country in the + * Sierra foothills that no station on this deployment describes. + * + * The sky already had this problem and solved it by asking per source + * (`skyRegions`, above). Weather does not get the same answer, because the + * two feeds are not the same shape: aircraft from two regions *merge* — they + * are disjoint sets of objects in one sky — and two observations do not. One + * board cannot be simultaneously foggy at the Golden Gate and clear over + * Riverside, and picking either one and applying it statewide is a worse lie + * than the climatology model, which at least varies with latitude and season. + * + * So this follows the rule the comment above already states rather than + * inventing an exception to it: a board that spans more than one served + * region takes the model. The metros keep their live observations on their + * own boards, and the day the atmosphere is regional rather than per board, + * this is the line that changes. + */ + const spansManyWeatherRegions = ONE_CALIFORNIA && id === "california"; weatherWatch = - carriesMetroDetail(entry.city) && access.can.liveEnvironment && access.feeds?.weather + carriesMetroDetail(entry.city) && + !spansManyWeatherRegions && + access.can.liveEnvironment && + access.feeds?.weather ? tera.watchWeather(entry.city.center, () => { updateSun(); renderChrome();