Repository navigation
Handle FCM events without ding IDs - #540
danielcolquitt wants to merge 1 commit into
Conversation
|
Brief follow-up after a couple of weeks: this fix remains in production use and ID-less FCM events are being handled correctly without the repeated callback failures. It has also since been referenced from Home Assistant Core issue #177118. Happy to adjust the fallback-ID approach if preferred. |
|
Seeing this too on Home Assistant Container 2026.9.1 with ring-doorbell 0.9.14 and Python 3.14. Same +1 for this fix. Keeping those notifications flowing through to HA would be useful so motion/doorbell events don't get dropped. I haven't tested the patch yet. |
|
Another confirmation from Home Assistant 2026.9.1 with What happened here on 2026-09-11: three notifications from the previous morning were still sitting unacked in the FCM queue. They were replayed on every connect, Two things that may save someone else time:
That second point is the reason the crash loop and the loss of delivery need separate fixes today. This PR removes the first one, which is the one that matters: it would have turned a day and a half of silence into a handful of ignored notifications. |
…0101) (#1241) * feat(home-assistant): patch ring_doorbell's push parser locally (ADR-0101) ring_doorbell 0.9.14's RingEventListener._get_ring_event raises KeyError on Ring pushes with no ding.id, and firebase_messaging shuts the push receiver down after three in a row. After that no Ring motion or doorbell event reaches Home Assistant. On trinity that happened at 13:12 and again seconds after the 14:09 restart (python-ring-doorbell/python-ring-doorbell#537. Upstream PRs python-ring-doorbell/python-ring-doorbell#540 and #556 are open, with no release since February.) custom_components/ring_push_guard, mounted read-only and loaded by packages/ring_push_guard.yaml, replaces that one method for 0.9.14 only. The id falls back to eventito.timestamp, then created_at in ms, and anything unparseable is skipped instead of raised. Any other version is left alone, with a warning. If Ring set up first, its entry is reloaded once so the listener restarts patched. Tested in the pinned image: the original raises on an id-less push. The patch handles normal, id-less (both fallbacks), malformed and non-Ring pushes. Three id-less pushes and a malformed one through the real _on_notification raise nothing, and repeat detection still works. ruff 0.17.0 (the pinned version) and check_config pass. Refs #1240 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(home-assistant): reload a Ring entry that is still setting up Ring starts its push receiver during platform setup, while its entry reads SETUP_IN_PROGRESS. A replayed bad push can stop the receiver in that window, and the LOADED-only check then skipped the reload for good. The guard now also reloads entries in SETUP_IN_PROGRESS and SETUP_RETRY. async_reload takes the entry's setup lock, so a reload asked for mid-setup waits for setup to finish. Tested across every ConfigEntryState. ADR-0101 says the same. Refs #1240 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
event.ding.id.created_at.KeyErrorcallback failures from shutting down real-time events for all devices.Fixes #537
Testing
uv run pre-commit run --files ring_doorbell/listen/eventlistener.py tests/test_listen.py --verboseuv run pytest tests/ --force-enable-socket --cov=ring_doorbell --cov-report=xml --cov-report=term-missing --import-mode importlib