Delete cloudhook on config entry removal - #317
Merged
Merged
Conversation
async_remove_entry now calls cloud.async_delete_cloudhook once no sibling config entry still shares the removed entry's webhook_id, preventing a permanent leak in Nabu Casa cloud prefs on uninstall. Suppresses ValueError alongside CloudNotAvailable, since hass_nabucasa raises a bare ValueError when the webhook_id was never actually converted to a cloudhook - same gap mobile_app's async_remove_entry already works around. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PvyPWXq9s7xw1L3fkphDGc
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #317 +/- ##
===========================================
+ Coverage 95.97% 96.00% +0.03%
===========================================
Files 17 17
Lines 1589 1602 +13
===========================================
+ Hits 1525 1538 +13
Misses 64 64 ☔ View full report in Codecov by Harness. |
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
async_remove_entrynow callscloud.async_delete_cloudhookwhen a TTLock config entry is removed, closing a permanent leak in Nabu Casa cloud prefs for cloud userswebhook_id(entries can share one webhook per developer application, seedocs/adr/0002-shared-webhook-per-developer-application.md) before deletingValueErroralongsidecloud.CloudNotAvailable, sincehass_nabucasaraises a bareValueErrorwhen the webhook_id was never actually converted to a cloudhook — same gap HA core'smobile_appintegration already works aroundFixes #316
Test plan
script/checkpasses (lint, type-check, 251 tests)🤖 Generated with Claude Code
https://claude.ai/code/session_01PvyPWXq9s7xw1L3fkphDGc