mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 11:24:00 +00:00
fix(firms): drop argument spread in fires.push — RangeError silently dropped 2 of 3 VIIRS sources (#93)
* 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 <[email protected]>
Co-authored-by: Bilawal Sidhu <[email protected]>
This commit is contained in:
2 files changed
+14
-1
No files matched your search
+4
-1
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user