openaq-fetch
openaq-fetch copied to clipboard
Review arpalazio adapter date logic
We need to review the data consuming logic in the air quality data fetching module to ensure that it's correctly handling older data. The current implementation appears to fetch data from the past 4 days, but it's unclear if this is the desired behavior or if there are any potential issues related to consuming older data.
Concerns
The current implementation in the getStream function defines a fewDaysAgo constant, which is used to filter out data older than 4 days.
const fewDaysAgo = +parseFloat(
DateTime.local().setZone(timezone).minus({ days: 4 }).ordinal
);
Later in the function, this constant is used to filter out older data:
.filter((x) => x[dayPosition] >= fewDaysAgo)
Is the current 4-day window for fetching data appropriate?