diff --git a/.changeset/shy-needles-stare.md b/.changeset/shy-needles-stare.md new file mode 100644 index 00000000..801978f3 --- /dev/null +++ b/.changeset/shy-needles-stare.md @@ -0,0 +1,6 @@ +--- +'homebridge-ring': patch +'ring-client-api': patch +--- + +Handle errors when connecting to push notification service diff --git a/packages/ring-client-api/api.ts b/packages/ring-client-api/api.ts index 88a4ceb6..377ed1b5 100644 --- a/packages/ring-client-api/api.ts +++ b/packages/ring-client-api/api.ts @@ -291,6 +291,17 @@ export class RingApi extends Subscribed { } }), ) + pushReceiver.on('ON_DISCONNECT', () => { + pushReceiver.whenReady.catch((e) => { + logError( + 'Connection to the push notification server has failed unexpectedly', + ) + logError( + 'If this happens repeatedly, verify connections to TCP/5228 are allowed and that DNS Adblock rules allow gtalk.google.com', + ) + logError(e.message) + }) + }) try { await pushReceiver.connect()