Repository navigation
Stop using a private Home Assistant helper for Bouncie tokens (v0.8.1) - #12
Merged
Merged
Conversation
Map token endpoint failures with Home Assistant's public OAuth2TokenRequest errors, as the HACS reviewer asked, so a change to its internals can't break Bouncie token refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Addresses the HACS reviewer's note on hacs/default#13369: the Bouncie token request called Home Assistant's private
config_entry_oauth2_flow._raise_mapped_token_error, which could change in any release and break token refresh.The mapping now lives in
application_credentials.py, with the same outcomes as before:OAuth2TokenRequestReauthErrorOAuth2TokenRequestTransientErrorOAuth2TokenRequestConnectionErrorDiffers from the note: it suggested raising
ConfigEntryAuthFailedandConfigEntryNotReady. I used Home Assistant's publicOAuth2TokenRequest*errors, which inherit from those two. Raising the plain ones would skip theClientResponseErrorhandling inBouncieClientand the error handling in Home Assistant's sign-in flow, so a failed sign-in would show an unknown error rather than a clear abort.A search found no other private Home Assistant helpers in the integration. The version is bumped to 0.8.1, and nothing is tagged yet.
Tested: 220 tests pass and ruff is clean, with new tests for 400, 401, 429, 503 and no response against a mocked token endpoint.
Not tested: a real Bouncie token refresh.
🤖 Generated with Claude Code