-
Notifications
You must be signed in to change notification settings - Fork 149
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
Handle errors thrown in signal client callbacks #1063
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 3e5e096 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catching those is a good call, but they should trigger an action to try to fix things. The right call would likely be a full reconnect with
this.fullReconnectOnNext = true;
this.handleDisconnect(errorDescription);
log.error(`failed to setPublisherAnswer: ${errorMessage}`, { | ||
...this.logContext, | ||
RTCSdpType: sd.type, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably trigger a reconnect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into it again, and it looks like I'm not going to catch an InvalidStateError here at all, and instead I will get a NegotiationError. Should I look for it instead? This looks like an oddly specific error to handle and to try reconnect on.
@@ -456,16 +465,30 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit | |||
return; | |||
} | |||
this.log.trace('got ICE candidate from peer', { ...this.logContext, candidate, target }); | |||
this.pcManager.addIceCandidate(candidate, target); | |||
this.pcManager.addIceCandidate(candidate, target).catch((error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case of an InvalidStateError this should probably also trigger a reconnect
try { | ||
const answer = await this.pcManager.createSubscriberAnswerFromOffer(sd); | ||
await this.client.sendAnswer(answer); | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
Added handling of |
@lukasIO, could you please take a look? I need a hint. |
No description provided.