You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
The main bug here was a race on the callee side because we await-ed on setRemoteDescription before setting the opponent party ID, and while we were await-ing, the callEventHandler could give us candidate events which we'd duly ignore because we thought the party ID didn't match. This also meant that any candidates that arrived before the answer would have been ignored. Save these up by party ID and then add the ones from the party ID that we pick once the answer comes in. Also fix the confusion on party IDs where we weren't sure whether we hadn't picked an opponent or we'd picked an opponent without a party ID. It's now undefined for the former and null for the latter, as it claims to be in the comment.