1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-19 01:25:21 -04:00

fix(weather): robust location resolution with parallel fetch and multi-tier fallback (#2638)

Decouple weather data fetching from reverse geocoding so that
weather loads as soon as coordinates are available, even when
Nominatim is unreachable (e.g. mainland China).

- Fetch Open-Meteo weather immediately once lat/lon are known.
- Resolve city name in parallel via Nominatim -> Photon -> BigDataCloud.
- If all reverse geocoding fails, keep displaying weather with a
  placeholder city name.
- Skip reverse geocoding entirely when the user has configured a
  city name.
- Fall back to ip-api.com when GeoClue2 is unavailable or returns
  zero coordinates.
- Add request-generation tracking to discard stale geocoding
  responses after location changes.
- Hold explicit WeatherService refs in bar widget and dashboard tab.

Co-authored-by: lingdiansr <2077258365@qq.com>
This commit is contained in:
lingdianshiren
2026-06-17 02:42:01 +08:00
committed by GitHub
parent ca1a45ccf8
commit 2692777707
3 changed files with 261 additions and 29 deletions
@@ -9,9 +9,8 @@ BasePill {
visible: SettingsData.weatherEnabled
Ref {
service: WeatherService
}
Component.onCompleted: WeatherService.addRef()
Component.onDestruction: WeatherService.removeRef()
content: Component {
Item {