Skip to content

Instantly share code, notes, and snippets.

View rkhamilton's full-sized avatar

Ryan Hamilton rkhamilton

View GitHub Profile
@rkhamilton
rkhamilton / WeatherKitTroubleshootingScreen.swift
Last active February 22, 2024 14:10
A SwiftUI View that demonstrates several 404 failures from valid WeatherKit requests
// We have an app that allows users to fetch historical weather data for their selected locations.
// We are seeing users report failures for specific latitudes and longitudes that come back as
// WeatherDaemon.WDSClient<WeatherDaemon.WeatherResource>.Errors.responseFailed
// If you change the date, the query works. If you change the location, the query works.
// It's just specific lat/long/date combos that fail. There are other specific lat/long/date combos that also fail like this.
//
// I haven't figured out how to handle these errors since the error type is internal to WeatherKit and not exposed.
//
// I ALSO have a common problem that sometimes a dayWeather query will fail with 404, but if I retry a few times,
// or the next day, it will eventually succeed. I can't see a way to distinguish those scenarios.