From 229c584138a1928a3bb764293330a84aac3baad5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 25 Nov 2021 15:38:13 +0100 Subject: [PATCH 1/4] don't fail login if dehydrated devices are not supported --- src/matrix/SessionContainer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/matrix/SessionContainer.js b/src/matrix/SessionContainer.js index 3e3dab66..91418b0d 100644 --- a/src/matrix/SessionContainer.js +++ b/src/matrix/SessionContainer.js @@ -329,7 +329,16 @@ export class SessionContainer { request: this._platform.request, }); const olm = await this._olmPromise; - const encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log); + let encryptedDehydratedDevice; + try { + encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log); + } catch (err) { + if (err instanceof HomeServerError) { + log.set("not_supported", true); + } else { + throw err; + } + } if (encryptedDehydratedDevice) { let resolveStageFinish; const promiseStageFinish = new Promise(r => resolveStageFinish = r); From ae7d4d07dfbcbfbe82972594dad62bf571cb8757 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 25 Nov 2021 15:42:36 +0100 Subject: [PATCH 2/4] use .name so we don't need an import --- src/matrix/SessionContainer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/SessionContainer.js b/src/matrix/SessionContainer.js index 91418b0d..d8977dde 100644 --- a/src/matrix/SessionContainer.js +++ b/src/matrix/SessionContainer.js @@ -333,7 +333,7 @@ export class SessionContainer { try { encryptedDehydratedDevice = await getDehydratedDevice(hsApi, olm, this._platform, log); } catch (err) { - if (err instanceof HomeServerError) { + if (err.name === "HomeServerError") { log.set("not_supported", true); } else { throw err; From 876fcf532f86dcc10aef65a5ce087deac3545022 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 26 Nov 2021 09:12:08 +0100 Subject: [PATCH 3/4] release v0.2.22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3211bf4f..6479bee1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydrogen-web", - "version": "0.2.21", + "version": "0.2.22", "description": "A javascript matrix client prototype, trying to minize RAM usage by offloading as much as possible to IndexedDB", "main": "src/lib.ts", "directories": { From 2802164bb4f416d6d59c3b9bfb8ec2d9cbbb78d9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 26 Nov 2021 12:45:40 +0100 Subject: [PATCH 4/4] update to version that doesn't use a bash script anymore, which doesnt work on macos --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6479bee1..848e4104 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "eslint": "^7.32.0", "fake-indexeddb": "^3.1.2", "finalhandler": "^1.1.1", - "impunity": "^1.0.3", + "impunity": "^1.0.7", "mdn-polyfills": "^5.20.0", "postcss": "^8.1.1", "postcss-css-variables": "^0.17.0", diff --git a/yarn.lock b/yarn.lock index 830a5cd5..52661eff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3021,10 +3021,10 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -impunity@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/impunity/-/impunity-1.0.3.tgz#1e9972d137f0e0dbed4d39e6eca6c238a29b6526" - integrity sha512-D3XT8ED/AX5mbSQdAf0nz+65ilZE/q17Yykx8g7FqlnKjDdoowFv9kxdS4tOggPrJY/5lAfE86/ZFa878VpZBw== +impunity@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/impunity/-/impunity-1.0.7.tgz#b1484678ca82b7fce7750ab085a418302ce5883d" + integrity sha512-DIPr9toJHP8s/SMe6efOzhfGtiCbEniPO4JtHk6CvSZqtEPZpkF31l8TUrG8XTYxU1lBFwlkFi7RZ681YWdBrQ== dependencies: colors "^1.3.3" commander "^6.1.0"