Skip to content

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

Delete old session ID and retry on 'session-invalid' response. Updates app.bundle.js.

paweldomase16cee418747
diff --git a/index.html b/index.html
index 865b32cc79..0418088c02 100644
--- a/index.html
+++ b/index.html
@@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script>
- <script src="libs/app.bundle.js?v=12"></script>
+ <script src="libs/app.bundle.js?v=13"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=6"/>
diff --git a/libs/app.bundle.js b/libs/app.bundle.js
index ddedea3785..dbf47f218b 100644
--- a/libs/app.bundle.js
+++ b/libs/app.bundle.js
@@ -627,7 +627,7 @@ var DataChannels =
// selections so that it can do adaptive simulcast,
// we want the notification to trigger even if userJid is undefined,
// or null.
- var userJid = APP.UI.getLargeVideoState().userJid;
+ var userJid = APP.UI.getLargeVideoState().userResourceJid;
// we want the notification to trigger even if userJid is undefined,
// or null.
onSelectedEndpointChanged(userJid);
@@ -785,6 +785,8 @@ function onSelectedEndpointChanged(userResource)
_dataChannels.some(function (dataChannel) {
if (dataChannel.readyState == 'open')
{
+ console.log('sending selected endpoint changed '
+ + 'notification to the bridge: ', userResource);
dataChannel.send(JSON.stringify({
'colibriClass': 'SelectedEndpointChangedEvent',
'selectedEndpoint':
@@ -14695,7 +14697,7 @@ module.exports = TraceablePeerConnection;
},{}],53:[function(require,module,exports){
-/* global $, $iq, config, connection, UI, messageHandler,
+/* global $, $iq, APP, config, connection, UI, messageHandler,
roomName, sessionTerminated, Strophe, Util */
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
var Settings = require("../settings/Settings");
@@ -14964,45 +14966,49 @@ var Moderator = {
}
},
function (error) {
+ // Invalid session ? remove and try again
+ // without session ID to get a new one
+ var invalidSession
+ = $(error).find('>error>session-invalid').length;
+ if (invalidSession) {
+ console.info("Session expired! - removing");
+ localStorage.removeItem("sessionId");
+ }
// Not authorized to create new room
if ($(error).find('>error>not-authorized').length) {
console.warn("Unauthorized to start the conference", error);
-
- if ($(error).find('>error>session-invalid').length) {
- // FIXME: just retry
- console.info("Session expired! - removing");
- localStorage.removeItem("sessionId");
- }
-
var toDomain
= Strophe.getDomainFromJid(error.getAttribute('to'));
if (toDomain === config.hosts.anonymousdomain) {
// we are connected with anonymous domain and
// only non anonymous users can create rooms
// we must authorize the user
-
self.xmppService.promptLogin();
} else {
-
- eventEmitter.emit(XMPPEvents.AUTHENTICATION_REQUIRED, // External authentication mode
+ // External authentication mode
+ eventEmitter.emit(
+ XMPPEvents.AUTHENTICATION_REQUIRED,
function () {
Moderator.allocateConferenceFocus(
roomName, callback);
});
-
}
return;
}
var waitMs = getNextErrorTimeout();
console.error("Focus error, retry after " + waitMs, error);
// Show message
- APP.UI.messageHandler.notify( null, "notify.focus",
- 'Conference focus', 'disconnected',"notify.focusFail",
- Moderator.getFocusComponent() +
- ' not available - retry in ' +
- (waitMs / 1000) + ' sec',
- {component: Moderator.getFocusComponent(),
- ms: (waitMs / 1000)});
+ var focusComponent = Moderator.getFocusComponent();
+ var retrySec = waitMs / 1000;
+ // FIXME: message is duplicated ?
+ // Do not show in case of session invalid
+ // which means just a retry
+ if (!invalidSession) {
+ APP.UI.messageHandler.notify(
+ null, "notify.focus",
+ 'Conference focus', 'disconnected', "notify.focusFail",
+ {component: focusComponent, ms: retrySec});
+ }
// Reset response timeout
getNextTimeout(true);
window.setTimeout(
diff --git a/modules/xmpp/moderator.js b/modules/xmpp/moderator.js
index 322815ca0a..ed8ebdb71b 100644
--- a/modules/xmpp/moderator.js
+++ b/modules/xmpp/moderator.js
@@ -1,4 +1,4 @@
-/* global $, $iq, config, connection, UI, messageHandler,
+/* global $, $iq, APP, config, connection, UI, messageHandler,
roomName, sessionTerminated, Strophe, Util */
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
var Settings = require("../settings/Settings");
@@ -267,45 +267,49 @@ var Moderator = {
}
},
function (error) {
+ // Invalid session ? remove and try again
+ // without session ID to get a new one
+ var invalidSession
+ = $(error).find('>error>session-invalid').length;
+ if (invalidSession) {
+ console.info("Session expired! - removing");
+ localStorage.removeItem("sessionId");
+ }
// Not authorized to create new room
if ($(error).find('>error>not-authorized').length) {
console.warn("Unauthorized to start the conference", error);
-
- if ($(error).find('>error>session-invalid').length) {
- // FIXME: just retry
- console.info("Session expired! - removing");
- localStorage.removeItem("sessionId");
- }
-
var toDomain
= Strophe.getDomainFromJid(error.getAttribute('to'));
if (toDomain === config.hosts.anonymousdomain) {
// we are connected with anonymous domain and
// only non anonymous users can create rooms
// we must authorize the user
-
self.xmppService.promptLogin();
} else {
-
- eventEmitter.emit(XMPPEvents.AUTHENTICATION_REQUIRED, // External authentication mode
+ // External authentication mode
+ eventEmitter.emit(
+ XMPPEvents.AUTHENTICATION_REQUIRED,
function () {
Moderator.allocateConferenceFocus(
roomName, callback);
});
-
}
return;
}
var waitMs = getNextErrorTimeout();
console.error("Focus error, retry after " + waitMs, error);
// Show message
- APP.UI.messageHandler.notify( null, "notify.focus",
- 'Conference focus', 'disconnected',"notify.focusFail",
- Moderator.getFocusComponent() +
- ' not available - retry in ' +
- (waitMs / 1000) + ' sec',
- {component: Moderator.getFocusComponent(),
- ms: (waitMs / 1000)});
+ var focusComponent = Moderator.getFocusComponent();
+ var retrySec = waitMs / 1000;
+ // FIXME: message is duplicated ?
+ // Do not show in case of session invalid
+ // which means just a retry
+ if (!invalidSession) {
+ APP.UI.messageHandler.notify(
+ null, "notify.focus",
+ 'Conference focus', 'disconnected', "notify.focusFail",
+ {component: focusComponent, ms: retrySec});
+ }
// Reset response timeout
getNextTimeout(true);
window.setTimeout(