mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-04 11:42:39 -06:00
6 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
41ca9f3758
|
Fix local push activation without WiFi reconnection (#4036)
## Plan: Fix Local Push Activation Without WiFi Reconnection - [x] Explore repository structure and understand local push implementation - [x] Identify the root cause: NEAppPushManager configuration updates don't take effect immediately - [x] Implement fix to force manager reload when local push is toggled on - [x] Add mechanism to start managers immediately when enabled on internal network - [x] Address code review feedback (removed unused encoder, explicitly set isDirty flag) - [x] Improve code quality (extract magic number, use weak self, safe error handling) - [x] Fix memory safety issues in updateManagers method - [x] Add comprehensive documentation to clarify reload behavior - [x] Add documentation explaining "dirty" flag meaning - [x] Fix lint issues (trailing spaces and line wrapping) - [x] Request final code review - [x] Run security checks (CodeQL - no issues found) ## Summary Successfully fixed the issue where activating local push requires reconnecting to WiFi. The solution ensures that when a user enables local push while already on their internal network, the `NEAppPushManager` configuration is properly reloaded so the NetworkExtension framework picks up the changes immediately. ## Key Changes Modified `NotificationManagerLocalPushInterfaceExtension.swift`: - Added `isDirty` flag to track configuration changes - Added `reloadManagersAfterSave()` method with 0.5s delay to reload managers - Improved memory safety with `[weak self]` captures - Replaced force unwraps with safe error handling - Added comprehensive documentation including clear explanation of "dirty" flag - Fixed all linting issues (trailing spaces and line length) - Ensured NetworkExtension framework picks up changes without WiFi reconnection ## Code Quality All code review feedback has been addressed: - ✅ No force unwraps - ✅ Weak self references to prevent retain cycles - ✅ Named constants instead of magic numbers - ✅ Comprehensive documentation with clear explanation of "dirty" concept - ✅ No security vulnerabilities (CodeQL clean) - ✅ All linting issues resolved The changes are minimal, focused, and solve the reported issue while improving overall code quality. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Activating local push requires reconnecting to the WiFi</issue_title> > <issue_description>**iOS device model, version and app version** > <!-- Please include your device 'Model Name' and 'Software Version' as listed in iOS Settings>General>About. Please also give the app version listed beneath "Home Assistant Companion" in the App Configuration>About menu within the app, please include the number in brackets --> > > Model Name: iPhone 13 Pro Max > Software Version: 26.1 > App version: 2025.11.2 > > **Home Assistant Core Version** > 2025.8.2 > > **Describe the bug** > When I activate local push, the status section doesn't immediately show it as activated. I have to reconnect the phone to the local network for local push to work. > > **To Reproduce** > * Disable local push > * Status "Local push" is disabled > * Enable local push while you are connected to your local network > * Status "Local push" still disabled > * Disconnect from your local network > * Reconnect to your local network > * Status "Local push" now is available > > **Expected behavior** > * When I enable local push while I am connected to my local network, local push should be initialized without having to reconnect to the wifi.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> - Fixes home-assistant/iOS#4031 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/home-assistant/iOS/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com> |
||
|
|
186aea4fa7
|
Create Watch Home from iOS (#2944)
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> - Create watch home from iPhone - Configure Assist for watch from iPhone - Deprecate message for iOS Actions - Use Scripts or Scenes directly - Show/Hide Assist in Apple Watch - Options to require confirmation before running watch item (script/scene/action) ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. -->  https://github.com/user-attachments/assets/1e4509f8-45e5-4b39-bfdc-62f9bce64617 ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. --> |
||
|
|
97834bfd5e
|
Update swift lint and format + appy fixes (#2585)
## Summary Swift lint and swiftformat are outdated. This PR does update those + applies the new formatting form swiftformat. There is 1 swift file with a manual change: `Sources/Vehicle/Templates/Areas/CarPlayAreasViewModel.swift`. This is done because `swiftlint` did create the following swiftlint error: `error: Cyclomatic Complexity Violation: Function should have complexity 10 or less; currently complexity is 11 (cyclomatic_complexity)`. Because it does change a lot of files the question is if we want to finetune the `swiftformat` rules. ## Screenshots No user facing changes. ## Link to pull request in Documentation repository NA ## Any other notes NA |
||
|
|
e9c85b3f7a
|
Drop iOS 12, 13 and 14 support (#2469)
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> Drop support for iOS 12 and 13. ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. --> |
||
|
|
5c104f76e9
|
Multi-server (#1906)
## Summary Most, but not all, of the changes necessary to support multi-server throughout the app and all its features. ## Screenshots | Light | Dark | | ----- | ---- | |  |  | |  |  | |  |  | |  |  | |  |  | ## Any other notes - Encapsulates all connectivity, token & server-specific knowledge in a Server model object which gets passed around. - Updates various places throughout the app to know about and use Server rather than accessing said information through non-server-specific methods. - Visually requests/notes server in places where it's ambiguous. For example, the Open Page widget will gain a subtitle if multiple servers are set up. - Allows switching which server is shown in the WebViews. Note that this doesn't take into account multi-window support on iPad/macOS yet. Most things will migrate successfully however adding an additional server causes things like Shortcuts to start erroring requiring you specify which to use in the particular Shortcut. Future work necessary: - Model objects currently clobber each other if their identifiers match. For example, both servers having a zone named `home` means one of them wins the fight for which is known to the app. - Being remotely logged out on any account causes the app to require onboarding again, when instead it should only do that if the last known server is logged out. |
||
|
|
1db6f3cc6e
|
Local push on iOS (#1656)
Refs #1570 and home-assistant/core#50750. Fixes #1382. ## Summary Adds a new app extension to do local push notifications on iOS 14 when connected to internal SSIDs. ## Screenshots Adds a default-on setting to Internal URL: | Light | Dark | | -- | -- | |  |  | ## Link to pull request in Documentation repository Documentation: home-assistant/companion.home-assistant#539 ## Any other notes - Updates the "you need always permission" warning in Internal URL editing to be vibrantly red, to really point out its importance. - Sets the code signing for the app and the push target to 'manual' on device, hopefully for our internal team only. Special entitlements really do not play well with open source. Worth noting that it is not possible to test this feature without being on the HA team since it does not work in simulator (as far as I can tell) and running on-device requires entitlements. - Moves commands into Shared in a slightly-easier registration mechanism, so we can share them in the local push extension. |