From a1cf72642af266cc060366057c295c530d11ddc2 Mon Sep 17 00:00:00 2001 From: Emi Griffith Date: Sat, 11 Jul 2026 02:03:57 -0700 Subject: [PATCH] Fix compare place names (Nominatim burst) + weekly duplicate location name (#29) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compare was the only page loading several cells at once, so its concurrent reverse-geocode calls burst past Nominatim's ~1 req/sec limit, got rate-limited, and cached a null label — leaving those locations stuck on bare coordinates. - climate.py: serialize + rate-limit reverse_geocode behind a lock (>=1.1s between Nominatim calls, re-checking the cache under the lock), so concurrent callers resolve reliably instead of bursting. - store.py: shorten the reverse-geocode miss TTL 1 day -> 1 hour so a transient null retries soon; add a `cache` flag to put_payload. - app.py: don't persist a calendar payload whose place failed to resolve, so the coordinates fallback can't stick for the life of the token. Weekly showed the place name twice (top label beside the Find button AND the results

). Keep the

(it carries the coords + climatology context) as the single name display; the top label now only holds the transient coordinates written on selection and is hidden once the named results render. Claude-Session: https://claude.ai/code/session_01B3Q2EkHHnTUX2BfhV5q1Zc Co-authored-by: Claude Opus 4.8 --- static/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/app.js b/static/app.js index 72105f3..ccff27e 100644 --- a/static/app.js +++ b/static/app.js @@ -121,9 +121,12 @@ function placeLabel(data) { function render(data) { recentData = data; forecastData = null; // invalidate any forecast from a previous location/date - // Reflect the chosen place beside the Find button (which becomes "Change"). - locLabel.textContent = placeLabel(data); - locLabel.hidden = false; + // The place name appears once — as the results heading (

) below, which also + // carries the coordinates + climatology context. The top label only holds the + // transient coordinates written on selection, so hide it now that the named + // results have rendered (otherwise the name would show twice). + locLabel.hidden = true; + locLabel.textContent = ""; findBtn.innerHTML = `${window.LocationPicker.PIN_ICON} Change location`; const c = data.climatology; const cell = data.cell;