Skip to content

Follow re-paired mobile apps, and raise a repair rather than snooze a missing notify action - #272

Merged
jeyrb merged 3 commits into
rhizomatics:mainfrom
lollox80:fix/mobile-app-refresh
Oct 7, 2026
Merged

jeyrb merged 3 commits into
rhizomatics:mainfrom
lollox80:fix/mobile-app-refresh

Conversation

@lollox80

@lollox80 lollox80 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Points 2 and 3 of #268, separate from #269 (point 1).

2. Mobile apps followed at runtime, not only at startup

  • HomeAssistantAPI.subscribe_mobile_app_changes() listens to EVENT_DEVICE_REGISTRY_UPDATED, limited to mobile_app devices, and to notify.mobile_app_* actions being registered or removed. Both are debounced into a single callback, because HA registers a re-paired phone's new action a little after the device itself.
  • build_mobile_app_cache() now starts from empty, so a device that has gone, or has been re-paired under a new name, drops out of the cache.
  • Recipient.resolve_mobile_devices() is the existing discovery code moved out of initialize(). It starts again from the configured mobile_devices each time and swaps the recipient's mobile_app_id targets accordingly. PeopleRegistry.refresh_mobile_devices() runs it for everyone, and the engine calls that, plus purge_snoozes(), on a change.

3. A missing action gets a repair, not a snooze

  • When a push to a device fails and the device has no notify action (neither the legacy action nor a notify entity), mobile_push raises the recipient_mobile_app_not_found repair from 13a2c9e for that recipient instead of snoozing the device for a day. Other failures still snooze, as before.
  • Recipient.check_mobile_actions() is the startup check from 13a2c9e, made reusable. It now also clears the repair once the action is back, on the next refresh.
  • purge_snoozes() also drops MOBILE snoozes whose action no longer exists, so a "paused" device left over from before a re-pair doesn't stay around for a day. It runs nightly and after a mobile app change.

Tests

  • test_people.py: a watch re-paired under a new name while a configured iPad's app turns up. After a refresh the recipient has the iPad and the new watch, the targets match, and the iPad's repair is cleared.
  • test_hass_api.py: the change subscription ignores other devices and other notify actions, and fires once for a phone paired together with its action, and once for it going away. The cache drops a removed device.
  • test_snoozer.py: purge drops the snooze for a gone device and keeps the other one.
  • test_engine.py: the change handler refreshes recipients and purges snoozes.
  • test_transport_mobile_push.py::test_missing_mobile_action_is_not_an_error now expects the repair and no snooze.

All of them fail on main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HpGm4J89JSyWt3WC6CTe27

… action

- Rebuild the mobile app cache and each recipient's discovered devices when a
  mobile_app device or its notify action comes or goes (debounced), instead of
  only at startup.
- A failed push to a device whose notify action no longer exists raises the
  recipient_mobile_app_not_found repair instead of a one day snooze, and the
  repair is cleared once the action is back.
- Purging snoozes also drops device snoozes whose action has gone.

Points 2 and 3 of rhizomatics#268.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HpGm4J89JSyWt3WC6CTe27
@jeyrb
jeyrb merged commit a1fd408 into rhizomatics:main Oct 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants