Skip to content

Update ProgressiveSearch to cancel requests if facet/search state changes #559

@camdendotlol

Description

@camdendotlol

On Pan African Data, we noticed an issue where newly fetched pages would populate in the results even if the user had selected a facet that should filter them out while they were loading.

It seems like there's some code (hasStateChange) that checks for either this situation or something similar:

if (isFirstPage && hasStateChanged(results._state, lastSearchState.current, true)) {
But it does not seem to be handling the case above. Ideally, the fetch request should be canceled, but if that's too tricky we should at least not append the newly loaded results to the list if they don't match the current facets.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions