Skip to content

Commit

Permalink
Catch to prevent push-receiver crash on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sightler committed Nov 25, 2024
1 parent 0fec12e commit 5f6e91c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/ring-client-api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5f6e91c

Please sign in to comment.