Skip to content

Fix stale weather temp — fetch independently of weather card#582

Merged
asim merged 1 commit intomainfrom
claude/add-wallet-transfers-74PHC
Apr 25, 2026
Merged

Fix stale weather temp — fetch independently of weather card#582
asim merged 1 commit intomainfrom
claude/add-wallet-transfers-74PHC

Conversation

@asim
Copy link
Copy Markdown
Member

@asim asim commented Apr 25, 2026

The weather summary next to the date was reading from localStorage but only the weather card ever wrote to it. Since we removed the card, the cached value was frozen at whatever it was last time the card rendered.

Now the date-line weather script runs its own fetch cycle:

  1. Show cached value immediately (no flash of empty)
  2. If cache is older than 1 hour, fetch fresh data from /weather
  3. Uses the same lat/lon localStorage keys the card used
  4. If no cached location, requests geolocation (same as card did)
  5. Updates localStorage and the displayed temp on success

Works whether or not the weather card is visible. The card and the date-line share the lat/lon keys but the summary has its own cache key (mu_weather_now + mu_weather_now_ts) so they don't conflict.

The weather summary next to the date was reading from localStorage
but only the weather card ever wrote to it. Since we removed the
card, the cached value was frozen at whatever it was last time the
card rendered.

Now the date-line weather script runs its own fetch cycle:
1. Show cached value immediately (no flash of empty)
2. If cache is older than 1 hour, fetch fresh data from /weather
3. Uses the same lat/lon localStorage keys the card used
4. If no cached location, requests geolocation (same as card did)
5. Updates localStorage and the displayed temp on success

Works whether or not the weather card is visible. The card and the
date-line share the lat/lon keys but the summary has its own cache
key (mu_weather_now + mu_weather_now_ts) so they don't conflict.
@asim asim merged commit aea08b0 into main Apr 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants