From 6f54ff9e7f2d6cda6f2d5643de25c4e8cb5679c9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 22 Nov 2018 16:21:55 +0000 Subject: [PATCH 1/5] Fix missing js-sdk logging Some of the js-sdk logging was going missing due to js-sdk's loglevel library being initialised before the rageshake logging. Fix by doing the rageshake setup within an import, as commented. --- src/vector/index.js | 21 ++-------------- src/vector/rageshakesetup.js | 46 ++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 src/vector/rageshakesetup.js diff --git a/src/vector/index.js b/src/vector/index.js index ee419eef6a..b25d08c306 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -24,6 +24,8 @@ require('gfm.css/gfm.css'); require('highlight.js/styles/github.css'); require('draft-js/dist/Draft.css'); +import './rageshakesetup'; + import React from 'react'; // add React and ReactPerf to the global namespace, to make them easier to // access via the console @@ -56,8 +58,6 @@ import SdkConfig from "matrix-react-sdk/lib/SdkConfig"; import Olm from 'olm'; -import rageshake from "matrix-react-sdk/lib/rageshake/rageshake"; - import CallHandler from 'matrix-react-sdk/lib/CallHandler'; import {getVectorConfig} from './getconfig'; @@ -68,22 +68,6 @@ let lastLocationHashSet = null; // and need to migrate, but they spam the console with warnings. Promise.config({warnings: false}); -function initRageshake() { - rageshake.init().then(() => { - console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome."); - - window.addEventListener('beforeunload', (e) => { - console.log('riot-web closing'); - // try to flush the logs to indexeddb - rageshake.flush(); - }); - - rageshake.cleanup(); - }, (err) => { - console.error("Failed to initialise rageshake: " + err); - }); -} - function checkBrowserFeatures(featureList) { if (!window.Modernizr) { console.error("Cannot check features - Modernizr global is missing."); @@ -225,7 +209,6 @@ function onTokenLoginCompleted() { } async function loadApp() { - initRageshake(); MatrixClientPeg.setIndexedDbWorkerScript(window.vector_indexeddb_worker_script); CallHandler.setConferenceHandler(VectorConferenceHandler); diff --git a/src/vector/rageshakesetup.js b/src/vector/rageshakesetup.js new file mode 100644 index 0000000000..b240e15917 --- /dev/null +++ b/src/vector/rageshakesetup.js @@ -0,0 +1,46 @@ +/* +Copyright 2018 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* + * Separate file that sets up rageshake logging when imported. + * This is necessary so that rageshake logging is set up before + * anything else. Webpack puts all import statements at the top + * of the file before any code, so imports will always be + * evaluated first. Other imports can cause other code to be + * evaluated (eg. the loglevel library in js-sdk, which if set + * up before rageshake causes some js-sdk logging to be missing + * from the rageshake.) + */ + +import rageshake from "matrix-react-sdk/lib/rageshake/rageshake"; + +function initRageshake() { + rageshake.init().then(() => { + console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome."); + + window.addEventListener('beforeunload', (e) => { + console.log('riot-web closing'); + // try to flush the logs to indexeddb + rageshake.flush(); + }); + + rageshake.cleanup(); + }, (err) => { + console.error("Failed to initialise rageshake: " + err); + }); +} + +initRageshake(); From d9434c7af584ef9fec07f0bddcc06b6436c8874e Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 22 Nov 2018 16:56:13 +0000 Subject: [PATCH 2/5] Bump js-sdk & react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9453cf010a..798f4478c1 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", - "matrix-js-sdk": "0.14.0", - "matrix-react-sdk": "0.14.5", + "matrix-js-sdk": "0.14.1", + "matrix-react-sdk": "0.14.6", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From 58f927538f810450eb686185c294f4b822303882 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 22 Nov 2018 16:56:41 +0000 Subject: [PATCH 3/5] v0.17.7 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 4fbefd0041..7d32bfccc5 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "0.17.6", + "version": "0.17.7", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From c2ec5f39ab20a2dcb241c33bbbfaacd08d2298f9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 22 Nov 2018 16:58:48 +0000 Subject: [PATCH 4/5] Prepare changelog for v0.17.7 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1551e7f4cf..9148433bd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [0.17.7](https://github.com/vector-im/riot-web/releases/tag/v0.17.7) (2018-11-22) +============================================================================================ +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.6...v0.17.7) + + * Warning when crypto DB is too new to use. + * Fix missing entries from js-sdk in rageshake logs + Changes in [0.17.6](https://github.com/vector-im/riot-web/releases/tag/v0.17.6) (2018-11-19) ============================================================================================ [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.6-rc.2...v0.17.6) From d483fb06056d26b514564e3848b56dfa3406b2c3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 22 Nov 2018 16:58:48 +0000 Subject: [PATCH 5/5] v0.17.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 798f4478c1..6914299409 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "0.17.6", + "version": "0.17.7", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": {