You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: auto-backup silently skipped capture on several write paths
The pre-write auto-backup (#1288) silently skipped a snapshot whenever the
id handed to a domain's fetch handler could not be resolved to the existing
entity: the fetch returns None and maybe_snapshot skips with no error. Each
affected path is fixed so the realistic caller id form resolves.
- automation: automation_backup_target stripped the "automation." prefix,
yielding a bare slug that _resolve_automation_id mis-treats as a numeric
unique_id -> GET 404. The recommended python_transform edit path hit this
on every UI-created automation. Pass the identifier unchanged so the
resolver maps it to the real unique_id (also fixes a latent wrong-target
restore the strip would have caused).
- todo_item: _fetch_todo_item matched only on uid, but set/remove pass the
item summary (the documented form). Match uid OR summary.
- dashboard: _fetch_dashboard did not lazy-resolve HA's internal
(underscored) dashboard id, so that form 404'd. Pre-resolve to the
canonical url_path like the set/delete tools already do.
- helper: _fetch_helper missed storage helpers after an entity_id rename
(object_id != collection id). Fall back to the registry unique_id.
Coverage gaps closed (the feature promises a snapshot before destructive
writes, so the absence was a bug):
- ha_remove_entity had no @with_auto_backup -> snapshot entity state before
the registry delete.
- ha_set_device / ha_remove_device had no coverage -> add a device
DomainHandler (capture + restore of name_by_user/area_id/disabled_by/
labels) and decorate both tools.
Regression tests added for every fetch path (todo summary-match, helper
rename fallback, device fetch/restore, dashboard internal-id resolve,
automation target prefix preservation, device handler registration).
0 commit comments