소스 검색

feat: distinguish between network and infra... failure

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

+ 3
- 4
logging_config.js 파일 보기

1
 // Logging configuration
1
 // Logging configuration
2
 var loggingConfig = { // eslint-disable-line no-unused-vars
2
 var loggingConfig = { // eslint-disable-line no-unused-vars
3
     //default log level for the app and lib-jitsi-meet
3
     //default log level for the app and lib-jitsi-meet
4
-    //defaultLogLevel: 'trace',
4
+    defaultLogLevel: 'trace',
5
     // Option to disable LogCollector (which stores the logs on CallStats)
5
     // Option to disable LogCollector (which stores the logs on CallStats)
6
     //disableLogCollector: true,
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
  * Notify the user that the video conferencing service is badly broken and
1093
  * Notify the user that the video conferencing service is badly broken and
1094
  * the page should be reloaded.
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
  * @param {string} a label string identifying the reason for the page reload
1098
  * @param {string} a label string identifying the reason for the page reload
1097
  * which will be included in details of the log event.
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
     // Reload the page after 10 - 30 seconds
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
      *
113
      *
114
      * @param {number} timeoutSeconds how many seconds before the conference
114
      * @param {number} timeoutSeconds how many seconds before the conference
115
      * reload will happen.
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
      * @param {string} reason a label string identifying the reason for the page
119
      * @param {string} reason a label string identifying the reason for the page
117
      * reload which will be included in details of the log event
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
         if (!overlay) {
124
         if (!overlay) {
122
             overlay = new PageReloadOverlayImpl(timeoutSeconds);
125
             overlay = new PageReloadOverlayImpl(timeoutSeconds);

Loading…
취소
저장