Repository navigation
Recover weather sooner, and say when it isn't for where you are - #37
Open
edward-mcnair wants to merge 2 commits into
Open
edward-mcnair wants to merge 2 commits into
edward-mcnair wants to merge 2 commits into
Conversation
A failed fetch (a fetch at wake that runs before Wi-Fi joins, say) left the
error on screen for the full 15-minute refresh, and a missing location
silently showed London.
- Retries after 30 s, 2 min and 5 min, then the regular refresh takes over.
- Fetches again as soon as the network comes back (NWPathMonitor) after a
failure.
- Uses your last known location before falling back to London, and the tile
says which ("Last known location", "London (location off)") and when it's
showing an earlier reading offline.
- LocationProvider is main-actor isolated (its delegate callbacks arrive on
main); a request times out after 15 s, resumes its continuation exactly
once, and ends when its fetch is cancelled. Callbacks queued when the
service stops do nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fallback location isn't a failed fetch, so nothing retried it: after you allowed location (in the prompt or System Settings) the tile kept showing London until the next 15-minute refresh. LocationProvider now reports authorization changes, and the service fetches again straight away while it's showing a fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A failed fetch, such as one at wake that runs before Wi-Fi joins, left the error on screen for the full 15-minute refresh. A missing location silently showed London.
NWPathMonitor) after a failure.LocationProvideris now main-actor isolated, since its delegate callbacks arrive on main; it was@unchecked Sendablewith unsynchronised continuation access.Tests:
WeatherRetryTests, covering the retry schedule.Screenshots
A small caption in the corner of the Weather tile, only when the reading is offline or from a fallback location.
Checklist
swift-formatlint clean)🤖 Generated with Claude Code