Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix: leave the conference after it is destroyed (#13182)

Gabriel Borleacf97ff724c51
diff --git a/react/features/base/conference/constants.ts b/react/features/base/conference/constants.ts
index ced7c15393..4a4c5f0e54 100644
--- a/react/features/base/conference/constants.ts
+++ b/react/features/base/conference/constants.ts
@@ -39,3 +39,8 @@ export const CONFERENCE_LEAVE_REASONS = {
SWITCH_ROOM: 'switch_room',
UNRECOVERABLE_ERROR: 'unrecoverable_error'
};
+
+/**
+ * Timeout for properly leaving the conference if it was destroyed.
+ */
+export const CONFERENCE_DESTROYED_LEAVE_TIMEOUT = 10000;
diff --git a/react/features/base/conference/middleware.any.js b/react/features/base/conference/middleware.any.js
index f3886b0bbd..b956dca5ff 100644
--- a/react/features/base/conference/middleware.any.js
+++ b/react/features/base/conference/middleware.any.js
@@ -43,10 +43,15 @@ import {
conferenceFailed,
conferenceWillLeave,
createConference,
+ leaveConference,
setLocalSubject,
setSubject
} from './actions';
-import { CONFERENCE_LEAVE_REASONS, TRIGGER_READY_TO_CLOSE_REASONS } from './constants';
+import {
+ CONFERENCE_DESTROYED_LEAVE_TIMEOUT,
+ CONFERENCE_LEAVE_REASONS,
+ TRIGGER_READY_TO_CLOSE_REASONS
+} from './constants';
import {
_addLocalTracksToConference,
_removeLocalTracksFromConference,
@@ -152,6 +157,7 @@ function _conferenceFailed({ dispatch, getState }, next, action) {
} else {
APP.API.notifyReadyToClose();
}
+ setTimeout(() => dispatch(leaveConference()), CONFERENCE_DESTROYED_LEAVE_TIMEOUT);
}
break;