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.
This commit is contained in:
Дамян Минков 2018-02-06 15:54:21 -07:00 committed by virtuacoplenny
parent 5305557ce5
commit ba94ba30c5
6 changed files with 40 additions and 21 deletions

View File

@ -94,12 +94,15 @@ function connect(id, password, roomName) {
JitsiConnectionEvents.CONNECTION_FAILED,
connectionFailedHandler);
/* eslint-disable max-params */
/**
*
*/
function connectionFailedHandler(error, message, credentials) {
function connectionFailedHandler(error, message, credentials, details) {
/* eslint-enable max-params */
APP.store.dispatch(
connectionFailed(connection, error, message, credentials));
connectionFailed(
connection, error, message, credentials, details));
if (isFatalJitsiConnectionError(error)) {
connection.removeEventListener(

8
package-lock.json generated
View File

@ -7158,7 +7158,7 @@
}
},
"lib-jitsi-meet": {
"version": "github:jitsi/lib-jitsi-meet#1c2c63e6568333a8360c618314bb792da2265215",
"version": "github:jitsi/lib-jitsi-meet#4daf8e7e958903bedcc265f435c08649f7a99c91",
"requires": {
"async": "0.9.0",
"current-executing-script": "0.1.3",
@ -7167,7 +7167,7 @@
"sdp-interop": "0.1.12",
"sdp-simulcast": "0.2.1",
"sdp-transform": "2.3.0",
"strophe.js": "1.2.14",
"strophe.js": "github:jitsi/strophejs#d05254fb28f4bbe6df5f905358582db3a12ee04c",
"strophejs-plugin-disco": "0.0.2",
"webrtc-adapter": "github:webrtc/adapter#1eec19782b4058d186341263e7d049cea3e3290a",
"yaeti": "1.0.1"
@ -11271,9 +11271,7 @@
"dev": true
},
"strophe.js": {
"version": "1.2.14",
"resolved": "https://registry.npmjs.org/strophe.js/-/strophe.js-1.2.14.tgz",
"integrity": "sha1-fO7sUbMnLMXGxq53R0eApYQPGqc="
"version": "github:jitsi/strophejs#d05254fb28f4bbe6df5f905358582db3a12ee04c"
},
"strophejs-plugin-disco": {
"version": "0.0.2",

View File

@ -44,7 +44,7 @@
"jquery-i18next": "1.2.0",
"js-md5": "0.6.1",
"jwt-decode": "2.2.0",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#1c2c63e6568333a8360c618314bb792da2265215",
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#4daf8e7e958903bedcc265f435c08649f7a99c91",
"lodash": "4.17.4",
"moment": "2.19.4",
"nuclear-js": "1.4.0",

View File

@ -148,18 +148,21 @@ export const createInviteDialogClosedEvent = function() {
* @param {string} reason - The reason for the reload.
* @param {number} timeout - The timeout in seconds after which the page is
* scheduled to reload.
* @param {Object} details - The details for the error.
* @returns {Object} The event in a format suitable for sending via
* sendAnalytics.
*/
export const createPageReloadScheduledEvent = function(reason, timeout) {
return {
action: 'page.reload.scheduled',
attributes: {
reason,
timeout
}
export const createPageReloadScheduledEvent
= function(reason, timeout, details) {
return {
action: 'page.reload.scheduled',
attributes: {
reason,
timeout,
...details
}
};
};
};
/**
* Creates a "pinned" or "unpinned" event.

View File

@ -177,6 +177,7 @@ export function connectionEstablished(connection: Object) {
* @param {string} [message] - Error message.
* @param {Object} [credentials] - The invalid credentials that failed
* the authentication.
* @param {Object} [details] - The details about the connection failed event.
* @public
* @returns {{
* type: CONNECTION_FAILED,
@ -188,7 +189,8 @@ export function connectionFailed(
connection: Object,
error: string,
message: ?string,
credentials: ?Object) {
credentials: ?Object,
details: ?Object) {
return {
type: CONNECTION_FAILED,
connection,
@ -201,7 +203,8 @@ export function connectionFailed(
? credentials
: undefined,
message,
name: error
name: error,
details
}
};
}

View File

@ -30,6 +30,16 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
* @static
*/
static propTypes = {
/**
* The details is an object containing more information
* about the connection failed(shard changes, was the computer
* suspended, etc.).
*
* @public
* @type {object}
*/
details: PropTypes.object,
dispatch: PropTypes.func,
/**
@ -172,7 +182,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
}
sendAnalytics(createPageReloadScheduledEvent(
this.props.reason, this.state.timeoutSeconds));
this.props.reason, this.state.timeoutSeconds, this.props.details));
logger.info(
`The conference will be reloaded after ${
@ -259,7 +269,8 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
* @protected
* @returns {{
* isNetworkFailure: boolean,
* reason: string
* reason: string,
* details: Object
* }}
*/
export function abstractMapStateToProps(state: Object) {
@ -269,6 +280,7 @@ export function abstractMapStateToProps(state: Object) {
return {
isNetworkFailure: Boolean(configError || connectionError),
reason: (configError || connectionError || conferenceError).message
reason: (configError || connectionError || conferenceError).message,
details: connectionError ? connectionError.details : undefined
};
}