github Makin-Things/weather-radar-card v3.6.2
v3.6.2 — bandwidth optimisation + housekeeping

4 hours ago

Patch release. Bandwidth optimisation for mobile users via AbortController on tile + data fetches, cleanup of phantom dependencies, and a doc-block above the markercluster race workaround.

No new features, no behaviour changes for existing configs. The [3.6.1] wind-source registry stays Experimental.

Changed

AbortController on tile + data fetches (#159)

Radar tiles, wildfire perimeter fetches, NWS alerts (+ per-zone shape fetches), and the RainViewer JSON metadata call now cancel their HTTP requests when superseded by a fresh fetch, when the card tears down, or when Leaflet unloads the tile (pan-out-of-view / zoom).

Previously the generation-counter trick discarded stale responses but the browser still downloaded the full payload first. On mobile or rate-limited connections a low-zoom continental pan can trigger dozens of tile requests that immediately get superseded — those now show as (canceled) in DevTools Network instead of completing.

Steady-state playback is unchanged (tiles recycle across frames without unloading → no abort, correct). src/wind-grid-fetcher.ts intentionally not instrumented — its request-coalescing makes correct cancellation tricky and the 60 s cache TTL already provides similar bandwidth conservation. Revisit when 3.7's layer-control panel adds explicit per-card cancellation.

Internal

  • Phantom dependencies removed. randombytes, safe-buffer, tslib, tsutils were listed in dependencies but not imported anywhere in src/, tests/, or the rollup config. tslib correctly stays as a transitive (via custom-card-helpers and rollup-plugin-typescript2); the other three drop from node_modules entirely. Companion to the serialize-javascript security bump that landed in 3.6.1.
  • Markercluster init-race workaround documented. The requestAnimationFrame + try/catch in _setupResizeObserver now carries a doc-block explicitly warning future contributors not to "simplify" it. The pattern works around a framework limitation in leaflet.markercluster (no lifecycle hook for "cluster tree ready"); replacing it with a synchronous call re-triggers the _topClusterLevel._bounds undefined crash from #110 on the resize path.
  • Tests: 440 → 455. New tests/fetch-abort.test.ts pins the AbortController / AbortSignal contract the error-handler branches depend on, the abort-previous-on-supersession pattern, and wireAbortLifecycle + createFetchTile integration via minimal layer stubs (consistent with the project's "stub Leaflet, test the helpers" convention).

Code review pass

Three deferred items from a code review pass are tracked in docs/todo.md: TypeScript module augmentation for Leaflet (3.8 health pass), Web Worker for the DWD pixel filter (only after profiling shows main-thread spikes), and WindGridFetcher cancellation via consumer reference-counting (pair with 3.7 layer-control).

Upgrade notes

No config changes. Drop-in patch over 3.6.1. HACS users with auto-update will see this as a routine update.


Full Changelog: v3.6.1...v3.6.2

Don't miss a new weather-radar-card release

NewReleases is sending notifications on new releases.