Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail gracefully when live view is force quit #157

Closed
dxdc opened this issue Oct 21, 2019 · 4 comments
Closed

Fail gracefully when live view is force quit #157

dxdc opened this issue Oct 21, 2019 · 4 comments
Labels
bug Something isn't working Ring An issue caused by Ring

Comments

@dxdc
Copy link

dxdc commented Oct 21, 2019

Live stream looks great, and if I click the 'X' to close it, I get nice, expected behavior like this:

[10/21/2019, 1:14:46 AM] [Ring] Preparing Live Stream for Front Door
[10/21/2019, 1:14:47 AM] [Ring] Waiting for stream data from Front Door (0.653s)
[10/21/2019, 1:14:48 AM] [Ring] Received stream data from Front Door (1.643s)
[10/21/2019, 1:14:48 AM] [Ring] Streaming active for Front Door
[10/21/2019, 1:14:53 AM] [Ring] Stopped Live Stream for Front Door

However, if I use the app switcher to either force quit or change apps while the stream is in progress, I see this. Maybe it would be more helpful to indicate this in the response and/or catch the error so as to not necessarily provide the trace?

[10/21/2019, 1:09:08 AM] [Ring] sip INVITE request failed with status 480
[10/21/2019, 1:09:08 AM] [Ring] Failed to prepare stream for Front Door (0.491s)
[10/21/2019, 1:09:08 AM] [Ring] Error: sip INVITE request failed with status 480
    at sipClient.send (/usr/lib/node_modules/homebridge-ring/lib/api/sip-session.js:169:28)
    at searching (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:1313:5)
    at /usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:1294:41
    at Object.message (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:1113:7)
    at Object.signal (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:979:55)
    at /usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:1341:24
    at onMessage (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:555:9)
    at content (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:490:7)
    at headers (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:477:9)
    at TLSSocket.<anonymous> (/usr/lib/node_modules/homebridge-ring/node_modules/sip/sip.js:501:27)
    at TLSSocket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:265:13)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
    at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
@dgreif dgreif added bug Something isn't working Ring An issue caused by Ring labels Nov 13, 2019
@matthewvelie
Copy link

I see another crash doing the same thing:

[2019-12-13 20:52:57] TypeError: process.off is not a function
    at SafeSubscriber.exitHandler [as _next] (/usr/lib/node_modules/homebridge-ring/lib/api/sip-session.js:262:25)
    at SafeSubscriber.__tryOrUnsub (/usr/lib/node_modules/homebridge-ring/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/usr/lib/node_modules/homebridge-ring/node_modules/rxjs/internal/Subscriber.js:143:22)
    at Subscriber._next (/usr/lib/node_modules/homebridge-ring/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/usr/lib/node_modules/homebridge-ring/node_modules/rxjs/internal/Subscriber.js:66:18)
    at ReplaySubject.Subject.next (/usr/lib/node_modules/homebridge-ring/node_modules/rxjs/internal/Subject.js:60:25)
    at ReplaySubject.nextInfiniteTimeWindow (/usr/lib/node_modules/homebridge-ring/node_modules/rxjs/internal/ReplaySubject.js:48:31)
    at SipSession.callEnded (/usr/lib/node_modules/homebridge-ring/lib/api/sip-session.js:299:33)
    at SipSession.stop (/usr/lib/node_modules/homebridge-ring/lib/api/sip-session.js:307:14)
    at CameraSource.handleStreamRequest (/usr/lib/node_modules/homebridge-ring/lib/homebridge/camera-source.js:202:21)
    at StreamController._handleStopStream (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/StreamController.js:452:23)
    at StreamController._handleSelectedStreamConfigurationWrite (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/StreamController.js:306:12)
    at Characteristic.SelectedRTPStreamConfiguration.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/StreamController.js:262:12)
    at emitMany (events.js:147:13)
    at Characteristic.SelectedRTPStreamConfiguration.emit (events.js:224:7)
    at Characteristic.SelectedRTPStreamConfiguration.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Accessory.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:880:22)
    at Array.forEach (<anonymous>)
    at Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:820:8)
    at emitMany (events.js:147:13)
    at HAPServer.emit (events.js:224:7)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)

@dgreif
Copy link
Owner

dgreif commented Dec 14, 2019

@matthewvelie what version of node are you running?

@matthewvelie
Copy link

I'm using v8.16.2

@dgreif
Copy link
Owner

dgreif commented Dec 16, 2019

@matthewvelie try upgrading to the latest version. That was an issue with node 8 compatibility, but I fixed it several months ago.

@dxdc sorry for not commenting originally, but the Error: sip INVITE request failed with status 480 message come from creating one call right after another and the Ring servers respond with a 480 error. I spent hours trying to work around it when you originally opened this issue but eventually gave up. I can't nail down exactly what Ring is doing to avoid these errors from their app. I'm going to close this issue for now and keep it in the back of my mind, but it's possible it will never get fixed unless Ring releases an official API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Ring An issue caused by Ring
Projects
None yet
Development

No branches or pull requests

3 participants