home-assistant / home-assistant/iOS
App opens the first configured server instead of restoring the last-used server
- Dominant language
- Swift
- Stars
- 2.4k
- Forks
- 520
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 264
Description
**iOS device model, version and app version**
Model Name: Not device-specific
Software Version: Not known to be version-specific
App version: 2026.7.0 or later
**Home Assistant Core Version**
Not Core-specific
**Describe the bug**
When multiple servers are configured, restoring or relaunching the app opens the first server in the order shown in Settings rather than the server that was last in use.
This appears to be a regression in 2026.7.0. Before the SwiftUI app lifecycle migration in #4748, the active server was included in scene restoration and used when restoring the app.
**To Reproduce**
1. Configure at least two Home Assistant servers, with server A ordered before server B in Settings.
2. Switch to server B and use it as the active server.
3. Terminate the app so it must restore on the next launch.
4. Launch the app again.
5. Observe that server A opens instead of server B.
**Expected behavior**
The app should restore the last-used server and page. The order of servers in Settings should not determine which server opens after restoration.
**Screenshots**
N/A
**Additional context**
The issue is limited to restoration/cold launch. Switching servers while the app remains running works normally.
Contributor guide
Research direction
Start by reviewing the SwiftUI app lifecycle migration in #4748 and the scene-restoration entry points used when the app is relaunched. Reproduce the issue with two configured servers, then verify that a cold launch restores the last-used server and page rather than the first server in Settings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100