From bff90da60e22d4dd886fdbb57055e4f37bfacc2e Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 5 Aug 2026 17:40:58 -0500 Subject: [PATCH] fix(weather): log failed cell-tile fetches instead of swallowing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loadLayers did `if (!resp.ok) return`, so a 413 or 400 from /weather/cells left the map blank with no console error and no UI feedback — indistinguishable from "no data for this forecast hour". This is reachable in normal use: the hook sets minZoom: 4, and a z=4 viewport on a wide window clamps to ~4500 sq deg, over GridBounds' 4000 sq deg cap, so zooming all the way out silently drops the overlay. Zooming back in restores it, which makes the failure look intermittent and untraceable. Log the status, requested layers and URL so the next report is diagnosable from the browser console. --- assets/js/weather_map_hook.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/weather_map_hook.ts b/assets/js/weather_map_hook.ts index c1268d77..9a93e103 100644 --- a/assets/js/weather_map_hook.ts +++ b/assets/js/weather_map_hook.ts @@ -1142,7 +1142,18 @@ export const WeatherMap: WeatherMapHook = { try { const resp = await fetch(url, { signal: abort.signal }) - if (!resp.ok) return + if (!resp.ok) { + // Never swallow a failed tile fetch. A 413 (viewport too large — + // reachable by zooming to minZoom on a wide window) or a 400 + // leaves the map blank with no other signal, which is + // indistinguishable from "no data for this hour" when someone + // reports a missing overlay. + console.warn( + `weather cells fetch failed (${source}): HTTP ${resp.status}`, + { status: resp.status, layers, url } + ) + return + } const buf = await resp.arrayBuffer() if (cacheKey !== this.packKey) return