feat: distinguish between network and infra... failure
This commit is contained in:
parent
2352811c20
commit
44beed6216
|
@ -387,7 +387,8 @@ 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(err);
|
APP.UI.showPageReloadOverlay(
|
||||||
|
false /* not a network type of failure */, err);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ConferenceErrors.CONFERENCE_MAX_USERS:
|
case ConferenceErrors.CONFERENCE_MAX_USERS:
|
||||||
|
@ -545,12 +546,16 @@ export default {
|
||||||
*/
|
*/
|
||||||
_bindConnectionFailedHandler (connection) {
|
_bindConnectionFailedHandler (connection) {
|
||||||
const handler = function (error, errMsg) {
|
const handler = function (error, errMsg) {
|
||||||
if (ConnectionErrors.OTHER_ERROR === error) {
|
if (ConnectionErrors.OTHER_ERROR === error ||
|
||||||
|
ConnectionErrors.SERVER_ERROR === error) {
|
||||||
// - item-not-found
|
// - item-not-found
|
||||||
// - connection dropped(closed by Strophe unexpectedly
|
// - connection dropped(closed by Strophe unexpectedly
|
||||||
// possible due too many transport errors)
|
// possible due too many transport errors)
|
||||||
|
const isNetworkFailure
|
||||||
|
= error !== ConnectionErrors.SERVER_ERROR;
|
||||||
logger.error("XMPP connection error: " + errMsg);
|
logger.error("XMPP connection error: " + errMsg);
|
||||||
APP.UI.showPageReloadOverlay(
|
APP.UI.showPageReloadOverlay(
|
||||||
|
isNetworkFailure,
|
||||||
"xmpp-conn-dropped:" + errMsg);
|
"xmpp-conn-dropped:" + errMsg);
|
||||||
connection.removeEventListener(
|
connection.removeEventListener(
|
||||||
ConnectionEvents.CONNECTION_FAILED, handler);
|
ConnectionEvents.CONNECTION_FAILED, handler);
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
// Logging configuration
|
// Logging configuration
|
||||||
var loggingConfig = { // eslint-disable-line no-unused-vars
|
var loggingConfig = { // eslint-disable-line no-unused-vars
|
||||||
//default log level for the app and lib-jitsi-meet
|
//default log level for the app and lib-jitsi-meet
|
||||||
//defaultLogLevel: 'trace',
|
defaultLogLevel: 'trace',
|
||||||
// Option to disable LogCollector (which stores the logs on CallStats)
|
// Option to disable LogCollector (which stores the logs on CallStats)
|
||||||
//disableLogCollector: true,
|
//disableLogCollector: true,
|
||||||
// Examples:
|
// Logging level adjustments for verbose modules:
|
||||||
//'modules/version/ComponentsVersions.js': 'info',
|
'modules/xmpp/strophe.util.js': 'log'
|
||||||
//'modules/xmpp/ChatRoom.js': 'log'
|
|
||||||
};
|
};
|
|
@ -1093,12 +1093,15 @@ 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 {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
|
* @param {string} a label string identifying the reason for the page reload
|
||||||
* which will be included in details of the log event.
|
* 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
|
// Reload the page after 10 - 30 seconds
|
||||||
PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20), reason);
|
PageReloadOverlay.show(
|
||||||
|
10 + RandomUtil.randomInt(0, 20), isNetworkFailure, reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -113,10 +113,13 @@ 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 {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
|
* @param {string} reason a label string identifying the reason for the page
|
||||||
* reload which will be included in details of the log event
|
* reload which will be included in details of the log event
|
||||||
*/
|
*/
|
||||||
show(timeoutSeconds, reason) {
|
show(timeoutSeconds, isNetworkFailure, reason) {
|
||||||
|
|
||||||
if (!overlay) {
|
if (!overlay) {
|
||||||
overlay = new PageReloadOverlayImpl(timeoutSeconds);
|
overlay = new PageReloadOverlayImpl(timeoutSeconds);
|
||||||
|
|
Loading…
Reference in New Issue