Explorar el Código

Handles connection failed event details (passing them to analytics). (#2432)

* Handles connection failed event details (passing them to analytics).

* Fixing comments.

* Updates depending versions to be able to test.

* Fixing comments.

* Fixes wrong jsdoc.
master
Дамян Минков hace 7 años
padre
commit
ba94ba30c5

+ 5
- 2
connection.js Ver fichero

94
             JitsiConnectionEvents.CONNECTION_FAILED,
94
             JitsiConnectionEvents.CONNECTION_FAILED,
95
             connectionFailedHandler);
95
             connectionFailedHandler);
96
 
96
 
97
+        /* eslint-disable max-params */
97
         /**
98
         /**
98
          *
99
          *
99
          */
100
          */
100
-        function connectionFailedHandler(error, message, credentials) {
101
+        function connectionFailedHandler(error, message, credentials, details) {
102
+        /* eslint-enable max-params */
101
             APP.store.dispatch(
103
             APP.store.dispatch(
102
-                connectionFailed(connection, error, message, credentials));
104
+                connectionFailed(
105
+                    connection, error, message, credentials, details));
103
 
106
 
104
             if (isFatalJitsiConnectionError(error)) {
107
             if (isFatalJitsiConnectionError(error)) {
105
                 connection.removeEventListener(
108
                 connection.removeEventListener(

+ 3
- 5
package-lock.json Ver fichero

7158
       }
7158
       }
7159
     },
7159
     },
7160
     "lib-jitsi-meet": {
7160
     "lib-jitsi-meet": {
7161
-      "version": "github:jitsi/lib-jitsi-meet#1c2c63e6568333a8360c618314bb792da2265215",
7161
+      "version": "github:jitsi/lib-jitsi-meet#4daf8e7e958903bedcc265f435c08649f7a99c91",
7162
       "requires": {
7162
       "requires": {
7163
         "async": "0.9.0",
7163
         "async": "0.9.0",
7164
         "current-executing-script": "0.1.3",
7164
         "current-executing-script": "0.1.3",
7167
         "sdp-interop": "0.1.12",
7167
         "sdp-interop": "0.1.12",
7168
         "sdp-simulcast": "0.2.1",
7168
         "sdp-simulcast": "0.2.1",
7169
         "sdp-transform": "2.3.0",
7169
         "sdp-transform": "2.3.0",
7170
-        "strophe.js": "1.2.14",
7170
+        "strophe.js": "github:jitsi/strophejs#d05254fb28f4bbe6df5f905358582db3a12ee04c",
7171
         "strophejs-plugin-disco": "0.0.2",
7171
         "strophejs-plugin-disco": "0.0.2",
7172
         "webrtc-adapter": "github:webrtc/adapter#1eec19782b4058d186341263e7d049cea3e3290a",
7172
         "webrtc-adapter": "github:webrtc/adapter#1eec19782b4058d186341263e7d049cea3e3290a",
7173
         "yaeti": "1.0.1"
7173
         "yaeti": "1.0.1"
11271
       "dev": true
11271
       "dev": true
11272
     },
11272
     },
11273
     "strophe.js": {
11273
     "strophe.js": {
11274
-      "version": "1.2.14",
11275
-      "resolved": "https://registry.npmjs.org/strophe.js/-/strophe.js-1.2.14.tgz",
11276
-      "integrity": "sha1-fO7sUbMnLMXGxq53R0eApYQPGqc="
11274
+      "version": "github:jitsi/strophejs#d05254fb28f4bbe6df5f905358582db3a12ee04c"
11277
     },
11275
     },
11278
     "strophejs-plugin-disco": {
11276
     "strophejs-plugin-disco": {
11279
       "version": "0.0.2",
11277
       "version": "0.0.2",

+ 1
- 1
package.json Ver fichero

44
     "jquery-i18next": "1.2.0",
44
     "jquery-i18next": "1.2.0",
45
     "js-md5": "0.6.1",
45
     "js-md5": "0.6.1",
46
     "jwt-decode": "2.2.0",
46
     "jwt-decode": "2.2.0",
47
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#1c2c63e6568333a8360c618314bb792da2265215",
47
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#4daf8e7e958903bedcc265f435c08649f7a99c91",
48
     "lodash": "4.17.4",
48
     "lodash": "4.17.4",
49
     "moment": "2.19.4",
49
     "moment": "2.19.4",
50
     "nuclear-js": "1.4.0",
50
     "nuclear-js": "1.4.0",

+ 11
- 8
react/features/analytics/AnalyticsEvents.js Ver fichero

148
  * @param {string} reason - The reason for the reload.
148
  * @param {string} reason - The reason for the reload.
149
  * @param {number} timeout - The timeout in seconds after which the page is
149
  * @param {number} timeout - The timeout in seconds after which the page is
150
  * scheduled to reload.
150
  * scheduled to reload.
151
+ * @param {Object} details - The details for the error.
151
  * @returns {Object} The event in a format suitable for sending via
152
  * @returns {Object} The event in a format suitable for sending via
152
  * sendAnalytics.
153
  * sendAnalytics.
153
  */
154
  */
154
-export const createPageReloadScheduledEvent = function(reason, timeout) {
155
-    return {
156
-        action: 'page.reload.scheduled',
157
-        attributes: {
158
-            reason,
159
-            timeout
160
-        }
155
+export const createPageReloadScheduledEvent
156
+    = function(reason, timeout, details) {
157
+        return {
158
+            action: 'page.reload.scheduled',
159
+            attributes: {
160
+                reason,
161
+                timeout,
162
+                ...details
163
+            }
164
+        };
161
     };
165
     };
162
-};
163
 
166
 
164
 /**
167
 /**
165
  * Creates a "pinned" or "unpinned" event.
168
  * Creates a "pinned" or "unpinned" event.

+ 5
- 2
react/features/base/connection/actions.native.js Ver fichero

177
  * @param {string} [message] - Error message.
177
  * @param {string} [message] - Error message.
178
  * @param {Object} [credentials] - The invalid credentials that failed
178
  * @param {Object} [credentials] - The invalid credentials that failed
179
  * the authentication.
179
  * the authentication.
180
+ * @param {Object} [details] - The details about the connection failed event.
180
  * @public
181
  * @public
181
  * @returns {{
182
  * @returns {{
182
  *     type: CONNECTION_FAILED,
183
  *     type: CONNECTION_FAILED,
188
         connection: Object,
189
         connection: Object,
189
         error: string,
190
         error: string,
190
         message: ?string,
191
         message: ?string,
191
-        credentials: ?Object) {
192
+        credentials: ?Object,
193
+        details: ?Object) {
192
     return {
194
     return {
193
         type: CONNECTION_FAILED,
195
         type: CONNECTION_FAILED,
194
         connection,
196
         connection,
201
                     ? credentials
203
                     ? credentials
202
                     : undefined,
204
                     : undefined,
203
             message,
205
             message,
204
-            name: error
206
+            name: error,
207
+            details
205
         }
208
         }
206
     };
209
     };
207
 }
210
 }

+ 15
- 3
react/features/overlay/components/AbstractPageReloadOverlay.js Ver fichero

30
      * @static
30
      * @static
31
      */
31
      */
32
     static propTypes = {
32
     static propTypes = {
33
+        /**
34
+         * The details is an object containing more information
35
+         * about the connection failed(shard changes, was the computer
36
+         * suspended, etc.).
37
+         *
38
+         * @public
39
+         * @type {object}
40
+         */
41
+        details: PropTypes.object,
42
+
33
         dispatch: PropTypes.func,
43
         dispatch: PropTypes.func,
34
 
44
 
35
         /**
45
         /**
172
         }
182
         }
173
 
183
 
174
         sendAnalytics(createPageReloadScheduledEvent(
184
         sendAnalytics(createPageReloadScheduledEvent(
175
-            this.props.reason, this.state.timeoutSeconds));
185
+            this.props.reason, this.state.timeoutSeconds, this.props.details));
176
 
186
 
177
         logger.info(
187
         logger.info(
178
             `The conference will be reloaded after ${
188
             `The conference will be reloaded after ${
259
  * @protected
269
  * @protected
260
  * @returns {{
270
  * @returns {{
261
  *     isNetworkFailure: boolean,
271
  *     isNetworkFailure: boolean,
262
- *     reason: string
272
+ *     reason: string,
273
+ *     details: Object
263
  * }}
274
  * }}
264
  */
275
  */
265
 export function abstractMapStateToProps(state: Object) {
276
 export function abstractMapStateToProps(state: Object) {
269
 
280
 
270
     return {
281
     return {
271
         isNetworkFailure: Boolean(configError || connectionError),
282
         isNetworkFailure: Boolean(configError || connectionError),
272
-        reason: (configError || connectionError || conferenceError).message
283
+        reason: (configError || connectionError || conferenceError).message,
284
+        details: connectionError ? connectionError.details : undefined
273
     };
285
     };
274
 }
286
 }

Loading…
Cancelar
Guardar