Ask the sources that know the place before the ones that know the area

This commit is contained in:
Maurice
2026-08-10 09:41:13 +02:00
committed by Maurice
parent 14d6f2ecc9
commit 8f9af76204
8 changed files with 1283 additions and 147 deletions
@@ -72,9 +72,16 @@ function writeSession(key: string, value: MapsPlaceEnrichmentResult): void {
}
}
/**
* Bumped with the server's CACHE_VERSION. sessionStorage outlives a deploy, so
* without it the tab that was open while the fix shipped keeps replaying the
* answer the fix was about — and reports it as still broken.
*/
const ENRICH_CACHE_V = 3
function cacheKeyFor(selection: PlaceDetailsSelection, language: string): string {
const id = selection.placeId || `coords:${selection.lat}:${selection.lng}`
return `enrich_${id}_${language}`
return `enrich_v${ENRICH_CACHE_V}_${id}_${language}`
}
type LoadState = 'idle' | 'loading' | 'ready' | 'error'