Closed mrbythatmuch closed 4 years ago
You would want to add this to the beta branch since it is in the process of being converted to typescript.
Happy to added it there as well. Can you go ahead and add it to the existing master though.
The beta branch published to git has several of bugs and is non-functional. I spent some time trying to address them but could not figure out how to get the subscription connection to function as SSE using the Microsoft typed rest client to keep the connection open. I'm thinking your intending to not add the sever side event library as it uses request. But I couldn't find any examples or discussion on how to achieve SSE client using the typed reset client.
On Mon, Aug 24, 2020, 7:34 PM Donavan Becker notifications@github.com wrote:
You would want to add this to the beta branch since it is in the process of being converted to typescript.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EpicKris/node-arlo/pull/31#issuecomment-679466663, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC74RTXWU7MSYMINAPYLOYLSCMPKVANCNFSM4QJCQAYQ .
The Arlo.subscribe function does not emit all messages it receives. Two key messages which this pull request will provide are subscribe and media upload notification.
The Arlo service requires call to subscribe every ~1min to keep the connection alive and also stops responding after about ~30min. The Arlo service does not close the connection when it stops sending events it just stops sending replies. To know that the connection is still active you need to hit the service with a subscribe call and then confirm the subscribe message is returned/pushed on the Server-Sent Event connection. Adding an emit for all messages is one way to achieve this, at the same time this message could also be used to monitor media upload notifications.