Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/scripts/components/exploration/analysis-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export function formatCMRResponse(statResponse: CMRStatistics): TimeseriesData {
return cmrResponse;
}

export async function requestCMRTimeseriesData({
async function requestCMRTimeseriesData({
Copy link
Contributor Author

@ifsimicoded ifsimicoded Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is not used elsewhere. if functions are exported solely for tests, I suggest we prefix with private_ or _ so we can add a eslint rule to prevent imports of these functions outside of tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup! I agree with removing the export. We generally rely on module scope (exported vs. non-exported) to signal privacy rather than using naming prefixes like private_.

I think if we ever need to reuse this logic elsewhere, we should extract it into a dedicated util file or custom hook at that point. But for now, keeping it non-exported here is perfect.

start,
end,
aoi,
Expand Down Expand Up @@ -236,7 +236,7 @@ export async function requestCMRTimeseriesData({
? datasetData.tileApiEndpoint.replace('WebMercatorQuad/tilejson.json', '')
: envApiCMREndpoint;
const statResponse = await queryClient.fetchQuery(
['analysis', datasetData.id, 'cmr', aoi],
['analysis', datasetData.id, 'cmr', aoi, start, end],
Copy link
Contributor Author

@ifsimicoded ifsimicoded Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice we don't use the formattedParamString in the query key. This leads me to believe it's desired that not all params should cache bust this query. In that case, are there any additional params I should add?

datasetData.timeInterval?

Copy link
Collaborator

@dzole0311 dzole0311 Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question!

For this dataset, the only parameters that actually vary with user interaction are start, end and the aoi.

datasetData.timeInterval?

timeInterval is a bit different. It’s a fixed prop of the dataset (eg. 'P1M' for monthly data) and comes straight from the config. With the current UI and architecture, users never change it and the backend (I think) doesn’t treat it as a dynamic input. Because of that, we don't have to include it in the key here.

async ({ signal }) => {
const { data } = await axios.post(
`${cmrTitilerEndpoint}/timeseries/statistics/?${formattedParamString}`,
Expand Down
Loading