From 6b7bca2913d3ecd16f91f9bd83224ad856af2ba8 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Mon, 31 Aug 2026 16:50:49 -0700 Subject: [PATCH] =?UTF-8?q?fix(firms):=20drop=20argument=20spread=20in=20f?= =?UTF-8?q?ires.push=20=E2=80=94=20RangeError=20silently=20dropped=202=20o?= =?UTF-8?q?f=203=20VIIRS=20sources=20(#93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(firms): drop spread in fires.push — RangeError silently killed 2 of 3 VIIRS sources fires.push(...records) passes every record as a function argument. A world/2 VIIRS pull returns ~131k records for NOAA20 and SNPP, over V8's ~125k argument limit, so both threw RangeError: Maximum call stack size exceeded. The throw landed after sources.push({ok:true}), so each failed source was listed twice — once ok:true with its real count, once ok:false — while its records were dropped entirely. Only NOAA21 (114k, under the limit) survived, making the layer look healthy at a third of the data. Global fire count goes 113,996 -> 377,169. * docs(changelog): record the FIRMS multi-source merge fix * docs(changelog): move the FIRMS fix into a new Unreleased section above 0.1.0 --------- Co-authored-by: Bilawal Sidhu <106619546+bilawalsidhu@users.noreply.github.com> Co-authored-by: Bilawal Sidhu --- CHANGELOG.md | 10 ++++++++++ vite.config.js | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e2cf1b22..944bffed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ This changelog records public product changes. For the authoritative description of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md). +## [Unreleased] + +### Fixed + +- All three VIIRS sources now reach the Active Fires layer. Merging a source's + detections used argument spread, which exceeds the engine's argument limit on + the two largest sources and dropped them entirely — leaving roughly a third of + global detections while reporting each dropped source twice, once as + successful with its real count and once as failed. + ## [0.1.0] — 2026-08-31 — One-click install, keyless boot, Provider Settings ### Added diff --git a/vite.config.js b/vite.config.js index 788749862..7a7e6c012 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2086,7 +2086,10 @@ function firmsProxy() { try { const records = filterTrailing24h(await fetchSource(key, source), now); sources.push({ source, count: records.length, ok: true }); - fires.push(...records); + // NOT fires.push(...records): spread passes each record as an argument, + // and a world/2 VIIRS pull exceeds V8's argument limit (~125k) at + // ~131k records — RangeError, and the whole source is silently dropped. + for (const record of records) fires.push(record); } catch (err) { console.warn(`[firms-proxy] ${source} fetch failed:`, err?.message || err); sources.push({ source, count: 0, ok: false });