Skip to content

Commit 3145f09

Browse files
authored
fix: update cmr query key to cache bust on start and end date (#1928)
**Related Ticket:** Closes: #1897 ### Description of Changes Updated the query key on the CMR time series stats endpoint to include start and end date for cache bust. This will refetch, even if the new date range stats was included in the prior fetch, so this isn't as optimized as it could be for caching. But this was the simplest approach without adding additional logic to check if the dates were exclusive of the previously set range. ### Notes & Questions About Changes Curious if there are other parameters missing in this query key that should be added? ### Validation / Testing This would impact any CMR dataset available for timeseries analysis. I tested using the [original branch the bug was reported on](#1896) as this branch provided the CMR dataset for testing. When going through every dataset available on veda-ui in my local env, I was unable to find a valid CMR dataset. I suggest pulling in the commit`46eb610bd5d0e3f6eef29b8cf62a74d05e1b7ad8` from the bug report branch into your local to test.
2 parents 442d24b + 67f796d commit 3145f09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/scripts/components/exploration/analysis-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function formatCMRResponse(statResponse: CMRStatistics): TimeseriesData {
167167
return cmrResponse;
168168
}
169169

170-
export async function requestCMRTimeseriesData({
170+
async function requestCMRTimeseriesData({
171171
start,
172172
end,
173173
aoi,
@@ -236,7 +236,7 @@ export async function requestCMRTimeseriesData({
236236
? datasetData.tileApiEndpoint.replace('WebMercatorQuad/tilejson.json', '')
237237
: envApiCMREndpoint;
238238
const statResponse = await queryClient.fetchQuery(
239-
['analysis', datasetData.id, 'cmr', aoi],
239+
['analysis', datasetData.id, 'cmr', aoi, start, end],
240240
async ({ signal }) => {
241241
const { data } = await axios.post(
242242
`${cmrTitilerEndpoint}/timeseries/statistics/?${formattedParamString}`,

0 commit comments

Comments
 (0)