Преглед на файлове

feat: distinguish between network and infra... failure

j8
paweldomas преди 8 години
родител
ревизия
44beed6216
променени са 4 файла, в които са добавени 19 реда и са изтрити 9 реда
  1. 7
    2
      conference.js
  2. 3
    4
      logging_config.js
  3. 5
    2
      modules/UI/UI.js
  4. 4
    1
      modules/UI/reload_overlay/PageReloadOverlay.js

+ 7
- 2
conference.js Целия файл

@@ -387,7 +387,8 @@ class ConferenceConnector {
387 387
             // the app. Both the errors above are unrecoverable from the library
388 388
             // perspective.
389 389
             room.leave().then(() => connection.disconnect());
390
-            APP.UI.showPageReloadOverlay(err);
390
+            APP.UI.showPageReloadOverlay(
391
+                false /* not a network type of failure */, err);
391 392
             break;
392 393
 
393 394
         case ConferenceErrors.CONFERENCE_MAX_USERS:
@@ -545,12 +546,16 @@ export default {
545 546
      */
546 547
     _bindConnectionFailedHandler (connection) {
547 548
         const handler = function (error, errMsg) {
548
-            if (ConnectionErrors.OTHER_ERROR === error) {
549
+            if (ConnectionErrors.OTHER_ERROR === error ||
550
+                ConnectionErrors.SERVER_ERROR === error) {
549 551
                 // - item-not-found
550 552
                 // - connection dropped(closed by Strophe unexpectedly
551 553
                 //   possible due too many transport errors)
554
+                const isNetworkFailure
555
+                    = error !== ConnectionErrors.SERVER_ERROR;
552 556
                 logger.error("XMPP connection error: " + errMsg);
553 557
                 APP.UI.showPageReloadOverlay(
558
+                    isNetworkFailure,
554 559
                     "xmpp-conn-dropped:" + errMsg);
555 560
                 connection.removeEventListener(
556 561
                     ConnectionEvents.CONNECTION_FAILED, handler);

+ 3
- 4
logging_config.js Целия файл

@@ -1,10 +1,9 @@
1 1
 // Logging configuration
2 2
 var loggingConfig = { // eslint-disable-line no-unused-vars
3 3
     //default log level for the app and lib-jitsi-meet
4
-    //defaultLogLevel: 'trace',
4
+    defaultLogLevel: 'trace',
5 5
     // Option to disable LogCollector (which stores the logs on CallStats)
6 6
     //disableLogCollector: true,
7
-    // Examples:
8
-    //'modules/version/ComponentsVersions.js': 'info',
9
-    //'modules/xmpp/ChatRoom.js': 'log'
7
+    // Logging level adjustments for verbose modules:
8
+    'modules/xmpp/strophe.util.js': 'log'
10 9
 };

+ 5
- 2
modules/UI/UI.js Целия файл

@@ -1093,12 +1093,15 @@ UI.notifyFocusDisconnected = function (focus, retrySec) {
1093 1093
  * Notify the user that the video conferencing service is badly broken and
1094 1094
  * the page should be reloaded.
1095 1095
  *
1096
+ * @param {boolean} isNetworkFailure <tt>true</tt> indicates that it's caused by
1097
+ * network related failure or <tt>false</tt> when it's the infrastructure.
1096 1098
  * @param {string} a label string identifying the reason for the page reload
1097 1099
  * which will be included in details of the log event.
1098 1100
  */
1099
-UI.showPageReloadOverlay = function (reason) {
1101
+UI.showPageReloadOverlay = function (isNetworkFailure, reason) {
1100 1102
     // Reload the page after 10 - 30 seconds
1101
-    PageReloadOverlay.show(10 + RandomUtil.randomInt(0, 20), reason);
1103
+    PageReloadOverlay.show(
1104
+        10 + RandomUtil.randomInt(0, 20), isNetworkFailure, reason);
1102 1105
 };
1103 1106
 
1104 1107
 /**

+ 4
- 1
modules/UI/reload_overlay/PageReloadOverlay.js Целия файл

@@ -113,10 +113,13 @@ export default {
113 113
      *
114 114
      * @param {number} timeoutSeconds how many seconds before the conference
115 115
      * reload will happen.
116
+     * @param {boolean} isNetworkFailure <tt>true</tt> indicates that it's
117
+     * caused by network related failure or <tt>false</tt> when it's
118
+     * the infrastructure.
116 119
      * @param {string} reason a label string identifying the reason for the page
117 120
      * reload which will be included in details of the log event
118 121
      */
119
-    show(timeoutSeconds, reason) {
122
+    show(timeoutSeconds, isNetworkFailure, reason) {
120 123
 
121 124
         if (!overlay) {
122 125
             overlay = new PageReloadOverlayImpl(timeoutSeconds);

Loading…
Отказ
Запис