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(visitors): Leave and disconnect before connecting. (#13362)

Дамян Минков475c2f4606ce
diff --git a/conference.js b/conference.js
index d9d3e4edf8..0695c216e5 100644
--- a/conference.js
+++ b/conference.js
@@ -361,11 +361,11 @@ class ConferenceConnector {
const [ vnode ] = params;
APP.store.dispatch(overwriteConfig(newConfig))
- .then(this._conference.leaveRoom())
- .then(APP.store.dispatch(setIAmVisitor(Boolean(vnode))))
+ .then(() => this._conference.leaveRoom())
+ .then(() => APP.store.dispatch(setIAmVisitor(Boolean(vnode))))
// we do not clear local tracks on error, so we need to manually clear them
- .then(APP.store.dispatch(destroyLocalTracks()))
+ .then(() => APP.store.dispatch(destroyLocalTracks()))
.then(() => {
// Reset VideoLayout. It's destroyed in features/video-layout/middleware.web.js so re-initialize it.
VideoLayout.initLargeVideo();
@@ -418,7 +418,7 @@ class ConferenceConnector {
if (newConfig) {
APP.store.dispatch(overwriteConfig(newConfig))
- .then(this._conference.leaveRoom())
+ .then(() => this._conference.leaveRoom())
.then(() => {
_connectionPromise = connect(this._conference.roomName);
@@ -2620,17 +2620,22 @@ export default {
async leaveRoom(doDisconnect = true, reason = '') {
APP.store.dispatch(conferenceWillLeave(room));
+ const maybeDisconnect = () => {
+ if (doDisconnect) {
+ return disconnect();
+ }
+ };
+
if (room && room.isJoined()) {
- return room.leave(reason).finally(() => {
- if (doDisconnect) {
- return disconnect();
- }
+ return room.leave(reason).then(() => maybeDisconnect())
+ .catch(e => {
+ logger.error(e);
+
+ return maybeDisconnect();
});
}
- if (doDisconnect) {
- return disconnect();
- }
+ return maybeDisconnect();
},
/**
diff --git a/package-lock.json b/package-lock.json
index 9bd8a06484..00363c97e6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -60,7 +60,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
- "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1635.0.0+152fdb21/lib-jitsi-meet.tgz",
+ "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1636.0.0+f429c05f/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
@@ -12742,8 +12742,8 @@
},
"node_modules/lib-jitsi-meet": {
"version": "0.0.0",
- "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1635.0.0+152fdb21/lib-jitsi-meet.tgz",
- "integrity": "sha512-zihPwmE0lO/dFKVQBO12w2ojJST6h/tpxT3ShyvKZUFUUAWa0MfFQx7HvuyEUAOjKmzeivFLSCsvGOyBMSbMqA==",
+ "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1636.0.0+f429c05f/lib-jitsi-meet.tgz",
+ "integrity": "sha512-Au4t6wJu8j4TX9ndgkLdwAqdWC6D0jhM8Q1LEKKZGAO/DLJSqenSggjQaR8eu8E8E+M/0sFsISeqpsxkjC6FbA==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
@@ -29128,8 +29128,8 @@
}
},
"lib-jitsi-meet": {
- "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1635.0.0+152fdb21/lib-jitsi-meet.tgz",
- "integrity": "sha512-zihPwmE0lO/dFKVQBO12w2ojJST6h/tpxT3ShyvKZUFUUAWa0MfFQx7HvuyEUAOjKmzeivFLSCsvGOyBMSbMqA==",
+ "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1636.0.0+f429c05f/lib-jitsi-meet.tgz",
+ "integrity": "sha512-Au4t6wJu8j4TX9ndgkLdwAqdWC6D0jhM8Q1LEKKZGAO/DLJSqenSggjQaR8eu8E8E+M/0sFsISeqpsxkjC6FbA==",
"requires": {
"@jitsi/js-utils": "2.0.0",
"@jitsi/logger": "2.0.0",
diff --git a/package.json b/package.json
index 14d0fae4de..6806d5a46f 100644
--- a/package.json
+++ b/package.json
@@ -65,7 +65,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
- "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1635.0.0+152fdb21/lib-jitsi-meet.tgz",
+ "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1636.0.0+f429c05f/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",