You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
Fix race in creating calls (#2662)
* Fix race in creating calls We ran an async function between checking for an existing call and adding the new one to the map, so it would have been possible to start creating another call while we were placing the first call. This changes the code to add the call to the map as soon as we've created it. Also adds more logging. * Switch to logger.debug * Fix unit tests
This commit is contained in:
@ -533,6 +533,7 @@ describe('Group Call', function() {
|
||||
let newCall: MatrixCall;
|
||||
while (
|
||||
(newCall = groupCall1.getCallByUserId(client2.userId)) === undefined ||
|
||||
newCall.peerConn === undefined ||
|
||||
newCall.callId == oldCall.callId
|
||||
) {
|
||||
await flushPromises();
|
||||
@ -643,6 +644,7 @@ describe('Group Call', function() {
|
||||
groupCall.localCallFeed.setAudioVideoMuted = jest.fn();
|
||||
const setAVMutedArray = groupCall.calls.map(call => {
|
||||
call.localUsermediaFeed.setAudioVideoMuted = jest.fn();
|
||||
call.localUsermediaFeed.isVideoMuted = jest.fn().mockReturnValue(true);
|
||||
return call.localUsermediaFeed.setAudioVideoMuted;
|
||||
});
|
||||
const tracksArray = groupCall.calls.reduce((acc, call) => {
|
||||
|
Reference in New Issue
Block a user