Merge pull request #1169 from jitsi/page_reload_reason

Log more details on page reload
This commit is contained in:
Дамян Минков 2016-11-30 15:25:09 -06:00 committed by GitHub
commit 9f26270a98
3 changed files with 18 additions and 9 deletions

View File

@ -387,7 +387,7 @@ class ConferenceConnector {
// the app. Both the errors above are unrecoverable from the library // the app. Both the errors above are unrecoverable from the library
// perspective. // perspective.
room.leave().then(() => connection.disconnect()); room.leave().then(() => connection.disconnect());
APP.UI.showPageReloadOverlay(); APP.UI.showPageReloadOverlay(err);
break; break;
case ConferenceErrors.CONFERENCE_MAX_USERS: case ConferenceErrors.CONFERENCE_MAX_USERS:
@ -550,7 +550,8 @@ export default {
// - connection dropped(closed by Strophe unexpectedly // - connection dropped(closed by Strophe unexpectedly
// possible due too many transport errors) // possible due too many transport errors)
logger.error("XMPP connection error: " + errMsg); logger.error("XMPP connection error: " + errMsg);
APP.UI.showPageReloadOverlay(); APP.UI.showPageReloadOverlay(
"xmpp-conn-dropped:" + errMsg);
connection.removeEventListener( connection.removeEventListener(
ConnectionEvents.CONNECTION_FAILED, handler); ConnectionEvents.CONNECTION_FAILED, handler);
// FIXME it feels like the conference should be stopped // FIXME it feels like the conference should be stopped
@ -1736,14 +1737,16 @@ export default {
* @param {string} name the event name * @param {string} name the event name
* @param {int} value the value (it's int because google analytics supports * @param {int} value the value (it's int because google analytics supports
* only int). * 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 * NOTE: Should be used after conference.init
*/ */
logEvent(name, value) { logEvent(name, value, label) {
if(JitsiMeetJS.analytics) { if(JitsiMeetJS.analytics) {
JitsiMeetJS.analytics.sendEvent(name, {value}); JitsiMeetJS.analytics.sendEvent(name, {value, label});
} }
if(room) { if(room) {
room.sendApplicationLog(JSON.stringify({name, value})); room.sendApplicationLog(JSON.stringify({name, value, label}));
} }
}, },
/** /**

View File

@ -1092,10 +1092,13 @@ UI.notifyFocusDisconnected = function (focus, retrySec) {
/** /**
* Notify the user that the video conferencing service is badly broken and * Notify the user that the video conferencing service is badly broken and
* the page should be reloaded. * 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 // Reload the page after 10 - 30 seconds
PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20)); PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20), reason);
}; };
/** /**

View File

@ -113,8 +113,10 @@ export default {
* *
* @param {number} timeoutSeconds how many seconds before the conference * @param {number} timeoutSeconds how many seconds before the conference
* reload will happen. * 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) { if (!overlay) {
overlay = new PageReloadOverlayImpl(timeoutSeconds); overlay = new PageReloadOverlayImpl(timeoutSeconds);
@ -124,7 +126,8 @@ export default {
// FIXME (CallStats - issue) this event will not make it to // FIXME (CallStats - issue) this event will not make it to
// the CallStats, because the log queue is not flushed, before // the CallStats, because the log queue is not flushed, before
// "fabric terminated" is sent to the backed // "fabric terminated" is sent to the backed
APP.conference.logEvent('page.reload'); APP.conference.logEvent(
'page.reload', undefined /* value */, reason /* label */);
} }
overlay.show(); overlay.show();
} }