-
Notifications
You must be signed in to change notification settings - Fork 39
fix: voice chat undefined setremotedescription #1887
Conversation
This branch can be previewed at https://explorer.decentraland.zone/branch/fix/VoiceChatUndefinedSetRemoteDescription/index.html |
This is unrelated to the issue. I think the issue is related to the use of an unsupported browser or something similar. In any case, in theory there is code that should reduce the noise generated by the issue. See here: https://github.com/decentraland/catalyst/pull/244/files And peer library has in theory been updated, so it shouldn't show up anymore: See for instance that the stack trace in rollbar is not the same as the latest code. For some reason, those who are experiencing the issue seem to not be running the latest code. |
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'd recommend to close this PR since it adds no functionality
let retryNumber = currentRetryNumber | ||
// Apparently the RTCPeerConnection can be 'undefined' until the user accepts/blocks the microphone usage in the browser (https://github.com/webRTC-io/webrtc.io-client/issues/30#issuecomment-15991572) | ||
// @ts-ignore | ||
if (!dst || !src) { |
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 condition will always return false.
There is NO WAY in that calling new X
returns other than an object. It was a misinterpretation of the comment in the link.
That if
should be removed
@@ -317,20 +316,26 @@ export class VoiceCommunicator { | |||
|
|||
const offer = await src.createOffer() | |||
|
|||
await src.setLocalDescription(offer) | |||
await src.setLocalDescription(offer).catch((err) => { | |||
return Promise.reject(err) |
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.
The following two snippets are exactly the same:
await src.setLocalDescription(offer)
await src.setLocalDescription(offer).catch((err) => {
return Promise.reject(err)
})
We should remove the .catch
to avoid confussions
await dst.setRemoteDescription(offer) | ||
await dst.setRemoteDescription(offer).catch((err) => { | ||
return Promise.reject(err) | ||
}) |
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 here
await src.setRemoteDescription(answer) | ||
await src.setRemoteDescription(answer).catch((err) => { | ||
return Promise.reject(err) | ||
}) |
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.
and here too
error: https://rollbar.com/decentraland/World/items/11398/?item_page=4&item_count=100&#traceback
possible hint of a solution: webRTC-io/webrtc.io-client#30 (comment)