From e9055df9e37399deb2096c3ae048f081b803fbc7 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Mon, 18 Jul 2022 18:58:02 +0300 Subject: [PATCH] fix(externalStorage): Infinitely growing. In certain scenarios(when the iframe's domain is the same as the parent page) the jitsiLocalStorage key from local storage is included in the serialized local storage and then propagaded to the parent page. This way we end up with recursion which grows the localStorage infinitely. --- package-lock.json | 42 +++++++++++++++---- package.json | 2 +- .../base/jitsi-local-storage/setup.web.js | 2 +- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 310b61ff6..dbe28aa22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "@giphy/react-components": "5.6.0", "@giphy/react-native-sdk": "1.7.0", "@hapi/bourne": "2.0.0", - "@jitsi/js-utils": "2.0.0", + "@jitsi/js-utils": "2.0.3", "@jitsi/logger": "2.0.0", "@jitsi/rnnoise-wasm": "0.1.0", "@jitsi/rtcstats": "9.2.0", @@ -3596,9 +3596,9 @@ } }, "node_modules/@jitsi/js-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@jitsi/js-utils/-/js-utils-2.0.0.tgz", - "integrity": "sha512-Rk1JFGdXEJ5+eALVRTMohfn3pdMDQqlCJQEkCMLXKlCpEo+JhsOrB4KzlPo1rV9U8PnRfrf0j5N9uf/0C2a8Gw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@jitsi/js-utils/-/js-utils-2.0.3.tgz", + "integrity": "sha512-yEojQxrbDcx6VngnjVex7y3ypxMxUpZ/DSpP6uhbC53xmw9W/xcNwGspTjZD0cAKAcTjT7e8OQc0ptYyMi8WbA==", "dependencies": { "bowser": "2.7.0", "js-md5": "0.7.3" @@ -12912,6 +12912,20 @@ "webrtc-adapter": "8.0.0" } }, + "node_modules/lib-jitsi-meet/node_modules/@jitsi/js-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@jitsi/js-utils/-/js-utils-2.0.0.tgz", + "integrity": "sha512-Rk1JFGdXEJ5+eALVRTMohfn3pdMDQqlCJQEkCMLXKlCpEo+JhsOrB4KzlPo1rV9U8PnRfrf0j5N9uf/0C2a8Gw==", + "dependencies": { + "bowser": "2.7.0", + "js-md5": "0.7.3" + } + }, + "node_modules/lib-jitsi-meet/node_modules/js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==" + }, "node_modules/lib-jitsi-meet/node_modules/uuid": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.1.0.tgz", @@ -23460,9 +23474,9 @@ "dev": true }, "@jitsi/js-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@jitsi/js-utils/-/js-utils-2.0.0.tgz", - "integrity": "sha512-Rk1JFGdXEJ5+eALVRTMohfn3pdMDQqlCJQEkCMLXKlCpEo+JhsOrB4KzlPo1rV9U8PnRfrf0j5N9uf/0C2a8Gw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@jitsi/js-utils/-/js-utils-2.0.3.tgz", + "integrity": "sha512-yEojQxrbDcx6VngnjVex7y3ypxMxUpZ/DSpP6uhbC53xmw9W/xcNwGspTjZD0cAKAcTjT7e8OQc0ptYyMi8WbA==", "requires": { "bowser": "2.7.0", "js-md5": "0.7.3" @@ -30586,6 +30600,20 @@ "webrtc-adapter": "8.0.0" }, "dependencies": { + "@jitsi/js-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@jitsi/js-utils/-/js-utils-2.0.0.tgz", + "integrity": "sha512-Rk1JFGdXEJ5+eALVRTMohfn3pdMDQqlCJQEkCMLXKlCpEo+JhsOrB4KzlPo1rV9U8PnRfrf0j5N9uf/0C2a8Gw==", + "requires": { + "bowser": "2.7.0", + "js-md5": "0.7.3" + } + }, + "js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==" + }, "uuid": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.1.0.tgz", diff --git a/package.json b/package.json index 727233635..1a5d858cc 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@giphy/react-components": "5.6.0", "@giphy/react-native-sdk": "1.7.0", "@hapi/bourne": "2.0.0", - "@jitsi/js-utils": "2.0.0", + "@jitsi/js-utils": "2.0.3", "@jitsi/logger": "2.0.0", "@jitsi/rnnoise-wasm": "0.1.0", "@jitsi/rtcstats": "9.2.0", diff --git a/react/features/base/jitsi-local-storage/setup.web.js b/react/features/base/jitsi-local-storage/setup.web.js index ae1659add..85a37f0d8 100644 --- a/react/features/base/jitsi-local-storage/setup.web.js +++ b/react/features/base/jitsi-local-storage/setup.web.js @@ -19,7 +19,7 @@ declare var config: Object; * @returns {void} */ function onFakeLocalStorageChanged() { - APP.API.notifyLocalStorageChanged(jitsiLocalStorage.serialize()); + APP.API.notifyLocalStorageChanged(jitsiLocalStorage.serialize([ 'jitsiLocalStorage' ])); } /**