Parcourir la source

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
Дамян Минков il y a 7 ans
Parent
révision
ba94ba30c5

+ 5
- 2
connection.js Voir le fichier

@@ -94,12 +94,15 @@ function connect(id, password, roomName) {
94 94
             JitsiConnectionEvents.CONNECTION_FAILED,
95 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 103
             APP.store.dispatch(
102
-                connectionFailed(connection, error, message, credentials));
104
+                connectionFailed(
105
+                    connection, error, message, credentials, details));
103 106
 
104 107
             if (isFatalJitsiConnectionError(error)) {
105 108
                 connection.removeEventListener(

+ 3
- 5
package-lock.json Voir le fichier

@@ -7158,7 +7158,7 @@
7158 7158
       }
7159 7159
     },
7160 7160
     "lib-jitsi-meet": {
7161
-      "version": "github:jitsi/lib-jitsi-meet#1c2c63e6568333a8360c618314bb792da2265215",
7161
+      "version": "github:jitsi/lib-jitsi-meet#4daf8e7e958903bedcc265f435c08649f7a99c91",
7162 7162
       "requires": {
7163 7163
         "async": "0.9.0",
7164 7164
         "current-executing-script": "0.1.3",
@@ -7167,7 +7167,7 @@
7167 7167
         "sdp-interop": "0.1.12",
7168 7168
         "sdp-simulcast": "0.2.1",
7169 7169
         "sdp-transform": "2.3.0",
7170
-        "strophe.js": "1.2.14",
7170
+        "strophe.js": "github:jitsi/strophejs#d05254fb28f4bbe6df5f905358582db3a12ee04c",
7171 7171
         "strophejs-plugin-disco": "0.0.2",
7172 7172
         "webrtc-adapter": "github:webrtc/adapter#1eec19782b4058d186341263e7d049cea3e3290a",
7173 7173
         "yaeti": "1.0.1"
@@ -11271,9 +11271,7 @@
11271 11271
       "dev": true
11272 11272
     },
11273 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 11276
     "strophejs-plugin-disco": {
11279 11277
       "version": "0.0.2",

+ 1
- 1
package.json Voir le fichier

@@ -44,7 +44,7 @@
44 44
     "jquery-i18next": "1.2.0",
45 45
     "js-md5": "0.6.1",
46 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 48
     "lodash": "4.17.4",
49 49
     "moment": "2.19.4",
50 50
     "nuclear-js": "1.4.0",

+ 11
- 8
react/features/analytics/AnalyticsEvents.js Voir le fichier

@@ -148,18 +148,21 @@ export const createInviteDialogClosedEvent = function() {
148 148
  * @param {string} reason - The reason for the reload.
149 149
  * @param {number} timeout - The timeout in seconds after which the page is
150 150
  * scheduled to reload.
151
+ * @param {Object} details - The details for the error.
151 152
  * @returns {Object} The event in a format suitable for sending via
152 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 168
  * Creates a "pinned" or "unpinned" event.

+ 5
- 2
react/features/base/connection/actions.native.js Voir le fichier

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

+ 15
- 3
react/features/overlay/components/AbstractPageReloadOverlay.js Voir le fichier

@@ -30,6 +30,16 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
30 30
      * @static
31 31
      */
32 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 43
         dispatch: PropTypes.func,
34 44
 
35 45
         /**
@@ -172,7 +182,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
172 182
         }
173 183
 
174 184
         sendAnalytics(createPageReloadScheduledEvent(
175
-            this.props.reason, this.state.timeoutSeconds));
185
+            this.props.reason, this.state.timeoutSeconds, this.props.details));
176 186
 
177 187
         logger.info(
178 188
             `The conference will be reloaded after ${
@@ -259,7 +269,8 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
259 269
  * @protected
260 270
  * @returns {{
261 271
  *     isNetworkFailure: boolean,
262
- *     reason: string
272
+ *     reason: string,
273
+ *     details: Object
263 274
  * }}
264 275
  */
265 276
 export function abstractMapStateToProps(state: Object) {
@@ -269,6 +280,7 @@ export function abstractMapStateToProps(state: Object) {
269 280
 
270 281
     return {
271 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
 }

Chargement…
Annuler
Enregistrer