From 665e05259637a111fc3a7b4b2bcf369cd251511c Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 26 Apr 2018 15:09:17 +0100 Subject: [PATCH 1/2] Allow debugging of unhandled login errors --- src/components/structures/MatrixChat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 92baecb787..1eb96c9f11 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -352,7 +352,7 @@ export default React.createClass({ defaultDeviceDisplayName: this.props.defaultDeviceDisplayName, }); }).catch((e) => { - console.error(`Error attempting to load session: ${e}`); + console.error('Error attempting to load session', e); return false; }).then((loadedSession) => { if (!loadedSession) { From 5da62c6ad9db044d0e7c4de555239005719c8718 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 26 Apr 2018 15:18:29 +0100 Subject: [PATCH 2/2] Fix bug that caused crash when analytics HS/IS whitelists not specified --- src/Analytics.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Analytics.js b/src/Analytics.js index d48372afd7..8b55bdfd64 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -190,6 +190,7 @@ class Analytics { } _setVisitVariable(key, value) { + if (this.disabled) return; this._paq.push(['setCustomVariable', customVariables[key].id, key, value, 'visit']); } @@ -199,8 +200,8 @@ class Analytics { const config = SdkConfig.get(); if (!config.piwik) return; - const whitelistedHSUrls = config.piwik.whitelistedHSUrls; - const whitelistedISUrls = config.piwik.whitelistedISUrls; + const whitelistedHSUrls = config.piwik.whitelistedHSUrls || []; + const whitelistedISUrls = config.piwik.whitelistedISUrls || []; this._setVisitVariable('User Type', isGuest ? 'Guest' : 'Logged In'); this._setVisitVariable('Homeserver URL', whitelistRedact(whitelistedHSUrls, homeserverUrl));