Show distinct message when Thread sync requires admin account#6816
Draft
agners wants to merge 2 commits intohome-assistant:mainfrom
Draft
Show distinct message when Thread sync requires admin account#6816agners wants to merge 2 commits intohome-assistant:mainfrom
agners wants to merge 2 commits intohome-assistant:mainfrom
Conversation
When a non-admin account tried to sync Thread credentials, the app showed "The Home Assistant server does not support Thread", which is misleading. Surface a dedicated result and message indicating that managing Thread credentials requires an administrator account. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Improves Thread credential sync feedback when the Home Assistant server supports Thread but the signed-in user lacks admin privileges, avoiding misleading “server unsupported” messaging.
Changes:
- Add a new
ThreadManager.SyncResult.ServerUserNotAdminresult to distinguish permission failures from true server incompatibility - Split the Thread “component present” check into a separate helper and use it in
syncPreferredDataset - Surface a dedicated developer settings message when the user is not an admin
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| common/src/main/res/values/strings.xml | Adds a new string for the “admin required” Thread sync result |
| app/src/main/kotlin/io/homeassistant/companion/android/thread/ThreadManager.kt | Extends the sync result sealed class with ServerUserNotAdmin |
| app/src/main/kotlin/io/homeassistant/companion/android/settings/developer/DeveloperSettingsPresenterImpl.kt | Displays the new “admin required” message for Thread debug sync |
| app/src/full/kotlin/io/homeassistant/companion/android/thread/ThreadManagerImpl.kt | Separates server capability check from user/admin gating inside sync logic |
- Make coreSupportsThread strictly a server-capability check; gate admin separately at call sites so the contract matches the function name and KDoc. - Surface ServerUserNotAdmin in the WebView/frontend Thread export flow via a new MatterThreadStep so users see a dedicated admin-required dialog instead of the generic Thread error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
|
No objections to merge from me once ktlint is addressed (Note in #3417 I simply used the existing 'server doesn't support' state out of convenience, not assuming this would be around for so long and the APIs would improve but unfortunately not) |
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
When syncing Thread credentials as a non-admin user on the Home Assistant server, the app showed "The Home Assistant server does not support Thread", which is misleading.
This change splits the admin check out of
coreSupportsThreadsosyncPreferredDatasetcan return a newServerUserNotAdminresult distinct fromServerUnsupported, and surfaces a dedicated message:Checklist
🤖 Generated with Claude Code