fix(firms): record source success after aggregation (#181)

Record FIRMS source success after appending its rows so aggregation failures do not produce contradictory source status. Cover large feeds, filtering, ordering and source failures with regression tests.
This commit is contained in:
mwilliamsGH authored and GitHub committed 2026-09-10 21:13:46 -07:00
1 parent 87a92c8bc4
commit e7cb08f5f6
4 files changed
+90 -1

No files matched your search

+1 -1
View File
@@ -2094,11 +2094,11 @@ function firmsProxy() {
for (const source of SOURCES) {
try {
const records = filterTrailing24h(await fetchSource(key, source), now);
sources.push({ source, count: records.length, ok: true });
// 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);
sources.push({ source, count: records.length, ok: true });
} catch (err) {
console.warn(`[firms-proxy] ${source} fetch failed:`, err?.message || err);
sources.push({ source, count: 0, ok: false });