fix(drone-airspace): show stale FAA snapshots as stale and cap them at a day

The source dropped the proxy's stale flag and fetch time, so the layer row
read nominal and freshly updated through an outage, and the proxy served its
last snapshot indefinitely. Carry stale and fetchedAt through the source as
Fire Perimeters does, date a stale snapshot by its fetch, and stop serving a
snapshot more than 24 hours old.
This commit is contained in:
Sameh Khamis committed 2026-11-03 14:34:01 -08:00
1 parent 6bdedd8523
commit 8e63420f06
7 files changed
+129 -18

No files matched your search

+14
View File
@@ -103,3 +103,17 @@ test('a malformed successful response is never accepted as an empty snapshot', a
);
}
});
test('the snapshot detail carries the proxy staleness and fetch time', async () => {
const fetchedAt = Date.UTC(2026, 10, 3, 12);
const rows = normalizeDroneAirspaceSnapshot(validPayload);
const source = createDroneAirspaceSource({
fetchImpl: async () => Response.json({ rows, stale: true, fetchedAt }),
});
assert.deepEqual(await source.getSnapshotDetail(), {
rows,
stale: true,
fetchedAt,
});
assert.deepEqual(await source.getSnapshot(), rows);
});