Conversation
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the app’s user/profile fetching to use REST endpoints (not cache/WebSocket-derived values), addressing mTLS-related issues on macOS and adding unit coverage for the new behavior.
Changes:
- Add
HATypedRequest.fetchCurrentUser()and exposeHomeAssistantAPI.currentUser()plus user-scoped profile picture helpers. - Update multiple UI surfaces to load usernames/avatars via the new REST-backed APIs.
- Add a new Shared test suite validating REST request usage for current user and profile picture URL.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Shared/HomeAssistantAPIIdentity.test.swift | Adds tests asserting auth/current_user and states are fetched via REST and that profile URL resolution is correct. |
| Sources/Shared/HATypedRequest+App.swift | Adds a typed REST request builder for auth/current_user. |
| Sources/Shared/API/HAAPI.swift | Implements REST-based current user/profile picture fetching and refactors profile URL resolution. |
| Sources/App/Settings/Settings/HomeAssistantAccountRowView.swift | Switches username/avatar loading to currentUser + profilePicture(for:). |
| Sources/App/Settings/Eureka/AccountRow.swift | Refactors avatar fetching to use the new API helpers (removing previous cancellation/dedup logic). |
| Sources/App/Settings/Connection/ConnectionSettingsViewModel.swift | Populates loggedInUser using the new currentUser method. |
| Sources/App/Servers/ServerSelectView.swift | Switches username/avatar loading to currentUser + profilePicture(for:). |
| HomeAssistant.xcodeproj/project.pbxproj | Registers the new test file in the Xcode project/test target. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4555 +/- ##
=======================================
Coverage ? 43.18%
=======================================
Files ? 275
Lines ? 16694
Branches ? 0
=======================================
Hits ? 7209
Misses ? 9485
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes