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, JitsiConnectionEvents.CONNECTION_FAILED,
connectionFailedHandler); connectionFailedHandler);
/* eslint-disable max-params */
/** /**
* *
*/ */
function connectionFailedHandler(error, message, credentials) { function connectionFailedHandler(error, message, credentials, details) {
/* eslint-enable max-params */
APP.store.dispatch( APP.store.dispatch(
connectionFailed(connection, error, message, credentials)); connectionFailed(
connection, error, message, credentials, details));
if (isFatalJitsiConnectionError(error)) { if (isFatalJitsiConnectionError(error)) {
connection.removeEventListener( connection.removeEventListener(

8
package-lock.json generated
View File

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

View File

@ -44,7 +44,7 @@
"jquery-i18next": "1.2.0", "jquery-i18next": "1.2.0",
"js-md5": "0.6.1", "js-md5": "0.6.1",
"jwt-decode": "2.2.0", "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", "lodash": "4.17.4",
"moment": "2.19.4", "moment": "2.19.4",
"nuclear-js": "1.4.0", "nuclear-js": "1.4.0",

View File

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

View File

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

View File

@ -30,6 +30,16 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
* @static * @static
*/ */
static propTypes = { 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, dispatch: PropTypes.func,
/** /**
@ -172,7 +182,7 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
} }
sendAnalytics(createPageReloadScheduledEvent( sendAnalytics(createPageReloadScheduledEvent(
this.props.reason, this.state.timeoutSeconds)); this.props.reason, this.state.timeoutSeconds, this.props.details));
logger.info( logger.info(
`The conference will be reloaded after ${ `The conference will be reloaded after ${
@ -259,7 +269,8 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
* @protected * @protected
* @returns {{ * @returns {{
* isNetworkFailure: boolean, * isNetworkFailure: boolean,
* reason: string * reason: string,
* details: Object
* }} * }}
*/ */
export function abstractMapStateToProps(state: Object) { export function abstractMapStateToProps(state: Object) {
@ -269,6 +280,7 @@ export function abstractMapStateToProps(state: Object) {
return { return {
isNetworkFailure: Boolean(configError || connectionError), isNetworkFailure: Boolean(configError || connectionError),
reason: (configError || connectionError || conferenceError).message reason: (configError || connectionError || conferenceError).message,
details: connectionError ? connectionError.details : undefined
}; };
} }