Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'isNetworkFailure' argument to PageReloadOverlay #1176

Merged
merged 3 commits into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ class ConferenceConnector {
// the app. Both the errors above are unrecoverable from the library
// perspective.
room.leave().then(() => connection.disconnect());
APP.UI.showPageReloadOverlay(err);
APP.UI.showPageReloadOverlay(
false /* not a network type of failure */, err);
break;

case ConferenceErrors.CONFERENCE_MAX_USERS:
Expand Down Expand Up @@ -545,20 +546,34 @@ export default {
*/
_bindConnectionFailedHandler (connection) {
const handler = function (error, errMsg) {
if (ConnectionErrors.OTHER_ERROR === error) {
// - item-not-found
// - connection dropped(closed by Strophe unexpectedly
// possible due too many transport errors)
logger.error("XMPP connection error: " + errMsg);
APP.UI.showPageReloadOverlay(
"xmpp-conn-dropped:" + errMsg);
connection.removeEventListener(
ConnectionEvents.CONNECTION_FAILED, handler);
// FIXME it feels like the conference should be stopped
// by lib-jitsi-meet
if (room)
room.leave();
/* eslint-disable no-case-declarations */
switch (error) {
case ConnectionErrors.CONNECTION_DROPPED_ERROR:
case ConnectionErrors.OTHER_ERROR:
case ConnectionErrors.SERVER_ERROR:

logger.error("XMPP connection error: " + errMsg);

// From all of the cases above only CONNECTION_DROPPED_ERROR
// is considered a network type of failure
const isNetworkFailure
= error === ConnectionErrors.CONNECTION_DROPPED_ERROR;

APP.UI.showPageReloadOverlay(
isNetworkFailure,
"xmpp-conn-dropped:" + errMsg);

connection.removeEventListener(
ConnectionEvents.CONNECTION_FAILED, handler);

// FIXME it feels like the conference should be stopped
// by lib-jitsi-meet
if (room)
room.leave();

break;
}
/* eslint-enable no-case-declarations */
};
connection.addEventListener(
ConnectionEvents.CONNECTION_FAILED, handler);
Expand Down
7 changes: 3 additions & 4 deletions logging_config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Logging configuration
var loggingConfig = { // eslint-disable-line no-unused-vars
//default log level for the app and lib-jitsi-meet
//defaultLogLevel: 'trace',
defaultLogLevel: 'trace',
// Option to disable LogCollector (which stores the logs on CallStats)
//disableLogCollector: true,
// Examples:
//'modules/version/ComponentsVersions.js': 'info',
//'modules/xmpp/ChatRoom.js': 'log'
// Logging level adjustments for verbose modules:
'modules/xmpp/strophe.util.js': 'log'
};
7 changes: 5 additions & 2 deletions modules/UI/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -1093,12 +1093,15 @@ UI.notifyFocusDisconnected = function (focus, retrySec) {
* Notify the user that the video conferencing service is badly broken and
* the page should be reloaded.
*
* @param {boolean} isNetworkFailure <tt>true</tt> indicates that it's caused by
* network related failure or <tt>false</tt> when it's the infrastructure.
* @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 (reason) {
UI.showPageReloadOverlay = function (isNetworkFailure, reason) {
// Reload the page after 10 - 30 seconds
PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20), reason);
PageReloadOverlay.show(
10 + RandomUtil.randomInt(0, 20), isNetworkFailure, reason);
};

/**
Expand Down
5 changes: 4 additions & 1 deletion modules/UI/reload_overlay/PageReloadOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ export default {
*
* @param {number} timeoutSeconds how many seconds before the conference
* reload will happen.
* @param {boolean} isNetworkFailure <tt>true</tt> indicates that it's
* caused by network related failure or <tt>false</tt> when it's
* the infrastructure.
* @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, reason) {
show(timeoutSeconds, isNetworkFailure, reason) {

if (!overlay) {
overlay = new PageReloadOverlayImpl(timeoutSeconds);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"redux": "^3.5.2",
"redux-thunk": "^2.1.0",
"retry": "0.6.1",
"strophe": "^1.2.2",
"strophejs-plugins": "^0.0.6",
"strophe": "1.2.4",
"strophejs-plugins": "0.0.7",
"toastr": "^2.0.3",
"url-polyfill": "github/url-polyfill",
"xmldom": "^0.1.27"
Expand Down