Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Réinitialiser la cache client de la recherche quand on change les options de recherche #928

Closed
ameliebernier opened this issue Apr 20, 2023 · 3 comments · Fixed by infra-geo-ouverte/igo2-lib#1262
Assignees
Labels
enhancement New features and improvements // Nouvelles fonctionnalités et améliorations to test Issues that need testing by PO // Demandes qui ont besoin d'être testées par un pilote

Comments

@ameliebernier
Copy link

Si l'utilisateur fais une recherche -> ne trouve pas ce qu'il veut -> va changer les options de recherche, par exemple pour cibler une nouvelle catégorie qui n'était pas cochée -> refait une recherche avec le même terme pour voir si de nouveaux résultats sont disponibles, les résultats de sa première recherche sont restés en cache. Il ne voit donc pas l'effet de son changement.

@ameliebernier
Copy link
Author

https://github.com/infra-geo-ouverte/igo2-lib/blame/master/packages/geo/src/lib/search/shared/sources/icherche.ts#L357

la 2e partie " refait une recherche sur le clique de options", c'est déjà le cas (c'était le cas avant et selon le code aussi)

ça ne fonctionne pas à cause de la cache 'projet' ajouté sur les recherches

Solutions possibles : retirer la cache complètement, ou vider la cache sur le changement de type (idéalement, sur le changement d'user aussi) ?

il y a une observable searchSettingsChange qui pourrait aider pour supprimer la cache

@pelord
Copy link
Member

pelord commented Apr 20, 2023

valider le décorateur

@Cacheable({
maxCacheCount: 20
})

@ameliebernier ameliebernier added the enhancement New features and improvements // Nouvelles fonctionnalités et améliorations label Apr 20, 2023
@ameliebernier ameliebernier added this to the 2 - Urgent milestone Apr 20, 2023
@ameliebernier ameliebernier added the in progress In progress // Développement en cours label May 24, 2023
@alecarn alecarn self-assigned this May 24, 2023
alecarn added a commit to infra-geo-ouverte/igo2-lib that referenced this issue Sep 13, 2023
)

* feat(SearchBar): add a way to invalidate the cache on setting change
infra-geo-ouverte/igo2#928

* fix(ICherche): add a custom cache hash to account for http settings

* fix(Request): bust the cache on params changes.
fix(OsrmDirection): route
fix(Cadastre): search
fix(iLayer): search
fix(Nominatim): search
fix(StoredQueries): search and reverseSearch

* remove projects
@alecarn alecarn added to test Issues that need testing by PO // Demandes qui ont besoin d'être testées par un pilote and removed in progress In progress // Développement en cours labels Oct 11, 2023
@ameliebernier
Copy link
Author

Testé et c'est ok

@alecarn alecarn closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features and improvements // Nouvelles fonctionnalités et améliorations to test Issues that need testing by PO // Demandes qui ont besoin d'être testées par un pilote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants