diff --git a/conference.js b/conference.js index bc7d87cf9..66c83858e 100644 --- a/conference.js +++ b/conference.js @@ -387,7 +387,7 @@ class ConferenceConnector { // the app. Both the errors above are unrecoverable from the library // perspective. room.leave().then(() => connection.disconnect()); - APP.UI.showPageReloadOverlay(); + APP.UI.showPageReloadOverlay(err); break; case ConferenceErrors.CONFERENCE_MAX_USERS: @@ -550,7 +550,8 @@ export default { // - connection dropped(closed by Strophe unexpectedly // possible due too many transport errors) logger.error("XMPP connection error: " + errMsg); - APP.UI.showPageReloadOverlay(); + APP.UI.showPageReloadOverlay( + "xmpp-conn-dropped:" + errMsg); connection.removeEventListener( ConnectionEvents.CONNECTION_FAILED, handler); // FIXME it feels like the conference should be stopped @@ -1736,14 +1737,16 @@ export default { * @param {string} name the event name * @param {int} value the value (it's int because google analytics supports * only int). + * @param {string} label short text which provides more info about the event + * which allows to distinguish between few event cases of the same name * NOTE: Should be used after conference.init */ - logEvent(name, value) { + logEvent(name, value, label) { if(JitsiMeetJS.analytics) { - JitsiMeetJS.analytics.sendEvent(name, {value}); + JitsiMeetJS.analytics.sendEvent(name, {value, label}); } if(room) { - room.sendApplicationLog(JSON.stringify({name, value})); + room.sendApplicationLog(JSON.stringify({name, value, label})); } }, /** diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 65386d712..dbd30fdd1 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -1092,10 +1092,13 @@ UI.notifyFocusDisconnected = function (focus, retrySec) { /** * Notify the user that the video conferencing service is badly broken and * the page should be reloaded. + * + * @param {string} a label string identifying the reason for the page reload + * which will be included in details of the log event. */ -UI.showPageReloadOverlay = function () { +UI.showPageReloadOverlay = function (reason) { // Reload the page after 10 - 30 seconds - PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20)); + PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20), reason); }; /** diff --git a/modules/UI/reload_overlay/PageReloadOverlay.js b/modules/UI/reload_overlay/PageReloadOverlay.js index d5d37cc52..856f53f65 100644 --- a/modules/UI/reload_overlay/PageReloadOverlay.js +++ b/modules/UI/reload_overlay/PageReloadOverlay.js @@ -113,8 +113,10 @@ export default { * * @param {number} timeoutSeconds how many seconds before the conference * reload will happen. + * @param {string} reason a label string identifying the reason for the page + * reload which will be included in details of the log event */ - show(timeoutSeconds) { + show(timeoutSeconds, reason) { if (!overlay) { overlay = new PageReloadOverlayImpl(timeoutSeconds); @@ -124,7 +126,8 @@ export default { // FIXME (CallStats - issue) this event will not make it to // the CallStats, because the log queue is not flushed, before // "fabric terminated" is sent to the backed - APP.conference.logEvent('page.reload'); + APP.conference.logEvent( + 'page.reload', undefined /* value */, reason /* label */); } overlay.show(); }