mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-15 18:51:14 -05:00
## Summary Custom widget AppIntents (`CustomWidgetToggle/Activate/PressButton/UpdateWidgetItemConfirmationStateAppIntent`) used a single combined `guard` block with a silent `return .result()` on failure. When a tap bailed out — wrong domain, missing parameters, server lookup miss, no active URL — nothing was logged anywhere, which made user reports like [#4488](https://github.com/home-assistant/iOS/issues/4488) ("widget taps do nothing on iOS 26.4+") impossible to triage. Changes: - Split each guard into separate checks with an `Current.Log.error(...)` line per failure mode, so the widget-extension log now shows *which* precondition failed. - Extract the server/connection lookup into a small `CustomWidgetIntentHelper.resolveConnection` so the three intents don't duplicate the same boilerplate. - When `Current.api(for: server)` returns nil (i.e. `activeURL()` is nil — server unreachable from this network), dispatch a local notification ("Home Assistant could not be reached…") so the tap no longer silently does nothing. No behavior change for the success path. Failure paths still `return .result()` — they just now leave evidence behind.