dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.21k stars 163 forks source link

onDoorbellPressed not sending updates #1404

Closed rscheurman closed 6 months ago

rscheurman commented 7 months ago

Is there an existing issue for this?

Describe The Bug

I have been using the 'ring-client-api' for several projects, particularly the onDoorbellPressed observable. It was working fine, but now, a few weeks later, the onDoorbellPressed observable has stopped functioning entirely.

I've tried some basic troubleshooting using alternative methods, such as onNewNotification, but this observable isn't working either. I've also confirmed that my authentication and connection to my devices are valid by logging metadata (like device health), and this aspect is functioning correctly, suggesting the issue might be on Ring's end.

To Reproduce

Authenticate and observe onDoorbellPressed, then ring your Ring doorbell...

Expected behavior

We should receive an event from the onDoorbellPressed observable when a Ring doorbell is rung.

Relevant log output

No response

Screenshots

No response

Additional context

No response

OS

Windows, linux

Node.js Version

v18.17.1

NPM Version

v0.2.4

ring-client-api

12.1.0

Operating System

Windows 11 and Ubuntu

tsightler commented 7 months ago

This problem is discussed multiple times in various issues and discussions, most recently here:

https://github.com/dgreif/ring/discussions/1403

Almost certainly the token was used to connect to the Ring API without capturing the immediately updated token, which includes additional information required for registering for push notifications on future connections. The token will work fine the first time, but as the Ring API does not allow for changing the destination of push notifications during future startups, if you don't save this updated token immediately after first connect, future connections to the Ring API will not be able to receive push notifications.

The only solution after that point is to delete the connection from Ring Control Center, re-authenticate, and be 100% to capture the updated token immediately on connection:

https://github.com/dgreif/ring/wiki/Refresh-Tokens#refresh-token-expiration