Skip to content

App transfer to the Open Home Foundation account - #6113

Draft
bgoncal wants to merge 82 commits into
mainfrom
feature/app-account-migration
Draft

bgoncal wants to merge 82 commits into
mainfrom
feature/app-account-migration

Conversation

@bgoncal

@bgoncal bgoncal commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

AI Policy

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

Summary

The app moves to the Open Home Foundation Apple account under a new bundle identifier, so users end up with two apps side by side. This adds an in-app transfer between them: the existing app packages its servers, sign-ins, settings and mTLS identities into an encrypted payload, hands it over through the pasteboard and a custom URL scheme, and the new app imports it. The existing app then refuses to set up new servers, points at the new app, and can erase itself once the transfer is verified.

The Apple account is selected through configuration (Configuration/Account.xcconfig) instead of a branch, so the same code builds either app.

Screenshots

Snapshot references for every transfer screen, light and dark, are under Tests/App/Onboarding/Migration/__Snapshots__/AppMigrationScreens.test/.

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Draft while the remaining pieces land:

  • Apple has not yet granted these capabilities to the new App IDs, so their flags stay off in Configuration/Accounts/ohf.xcconfig: push provider (app-push-provider, needed on io.home-assistant.app and io.home-assistant.app.PushProvider, blocks the TestFlight upload), Critical Alerts on the PushProvider App ID (it currently carries Critical Messaging), Thread network credentials, user-assigned device name. CarPlay is granted.
  • Documentation PR in companion.home-assistant still to be opened.
  • The transfer strings exist in English only; translations go through Lokalise.
  • Snapshot references for the transfer screens, the alert component, the QR components and the connection URL screen were recorded locally on iOS 27.x and may need re-recording on the CI runtime.
  • The migration E2E tests (Tests/UI/MigrationE2ETests.swift) run only locally with two installed builds and a reachable server; they are not wired into CI.
  • The Xcode 27.2 RC simulator cannot show the "Allow Paste" prompt, so the local E2E run pre-authorises the pasteboard permission in the simulator.
  • Replace the custom URL schemes used for the hand-off (homeassistant-ohf, homeassistant-nc) with Universal Links.
  • Open product decision: confirm before a transfer wipes a new app that already has servers.
  • Follow-up when Let a restored device register as a new device #6088 merges: keep the imported registrations through RegistrationOwnership after the import.
  • The PushProvider xcscheme still carries the OHF debug bundle identifier; xcscheme files cannot read build settings.

# Conflicts:
#	Sources/App/Frontend/IncomingURLHandler.swift
#	Sources/App/Resources/en.lproj/Localizable.strings
#	Sources/App/Settings/Kiosk/KioskView.swift
#	Sources/Shared/Resources/Swiftgen/Strings.swift

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test coverage of this pull request is below 90%

The unit tests run 86.57% of the lines this pull request
adds or changes (1714 of 1980 coverable lines).

The per-file breakdown, and the changed lines no test runs, are in the
job summary. Adding tests for those lines and pushing dismisses this
review automatically.

Lines that carry no executable code, and files the unit test targets do not
build, are not counted. If the new code genuinely cannot be unit tested, a
maintainer can dismiss this review.

@github-actions
github-actions Bot dismissed stale reviews from themself October 22, 2026 17:46

Patch coverage is now 90.95%, at or above the 90% threshold.

The announcement drops its "What this means" section and is titled
"Home Assistant has moved". The welcome notice explains the new App
Store listing, the overview's second list is "Set up again manually",
the open check asks "Did the old app open?", and the erased screen's
button reads "Open the new app".
Brings in the registration ownership from #6088. A transfer carries the
existing app's registration records, which name that app's vendor
identifier as their owner, so the Open Home Foundation app would treat
every transferred server as a restored device's registration, hold back
its reports and ask whether to replace the old device. After the import
the coordinator now takes those registrations over, keeping the same
mobile_app device; the reconnect stays with the push token adoption so
the new token is what reaches Home Assistant. The E2E vendor override is
left out of the transferred preferences, and the migration UI test's
build file gets an ID of its own after colliding with E2EFlow.swift.
…ion E2E

With location undecided and an HTTP-only server the app covers the
frontend with its location decision, also on a relaunch after
onboarding, so the sidebar underneath never opened. The driver now
closes that cover first and reaches Settings the way E2EFlow does.
# Conflicts:
#	Sources/App/Resources/hu.lproj/Localizable.strings
# Conflicts:
#	Sources/App/Container/OnboardingStateObservable.swift
#	Sources/App/Settings/Sensors/Permissions/SensorPermissionsViewModel.swift
When the existing app starts the transfer and the new app already holds
servers, the new app now opens and verifies the payload, then shows a
"Replace this app's setup?" screen instead of wiping itself. Replacing
wipes and applies as before; keeping sends /declined to the existing
app, which leaves its handed-off screen, reconnects and registers for
push again.
# Conflicts:
#	Sources/HADesignSystem/Sources/Gallery/DesignSystemComponent.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants