From bb88eb715484ffb46b9e56368f1d92651dc4c6bb Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Mon, 25 Dec 2023 01:08:17 +1100 Subject: [PATCH] Up-mx-js-sdk-29 (#1533) * update matrix-js-sdk * replace deprecated resolveRoomAlias --- package-lock.json | 58 +++++++++++++++------- package.json | 2 +- src/app/organisms/join-alias/JoinAlias.jsx | 2 +- src/util/matrixUtil.js | 2 +- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6778482..6c944ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "linkify-html": "4.0.2", "linkify-react": "4.1.1", "linkifyjs": "4.0.2", - "matrix-js-sdk": "24.1.0", + "matrix-js-sdk": "29.1.0", "millify": "6.1.0", "pdfjs-dist": "3.10.111", "prismjs": "1.29.0", @@ -1106,10 +1106,10 @@ "node": ">=10" } }, - "node_modules/@matrix-org/matrix-sdk-crypto-js": { - "version": "0.1.0-alpha.5", - "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-js/-/matrix-sdk-crypto-js-0.1.0-alpha.5.tgz", - "integrity": "sha512-2KjAgWNGfuGLNjJwsrs6gGX157vmcTfNrA4u249utgnMPbJl7QwuUqh1bGxQ0PpK06yvZjgPlkna0lTbuwtuQw==", + "node_modules/@matrix-org/matrix-sdk-crypto-wasm": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@matrix-org/matrix-sdk-crypto-wasm/-/matrix-sdk-crypto-wasm-2.2.0.tgz", + "integrity": "sha512-txmvaTiZpVV0/kWCRcE7tZvRESCEc1ynLJDVh9OUsFlaXfl13c7qdD3E6IJEJ8YiPMIn+PHogdfBZsO84reaMg==", "engines": { "node": ">= 10" } @@ -2712,9 +2712,9 @@ "dev": true }, "node_modules/@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.2.tgz", + "integrity": "sha512-v4Mr60wJuF069iZZCdY5DKhfj0l6eXNJtbSM/oMDNdRLoBEUsktmKnswkz0X3OAic5W8Qy/YU6owKE4A66Y46A==" }, "node_modules/@types/file-saver": { "version": "2.0.5", @@ -3843,6 +3843,11 @@ "node": ">= 8" } }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + }, "node_modules/css-what": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.1.0.tgz", @@ -5894,6 +5899,11 @@ "node": ">=4.0" } }, + "node_modules/jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + }, "node_modules/katex": { "version": "0.16.4", "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.4.tgz", @@ -6098,31 +6108,33 @@ "integrity": "sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==" }, "node_modules/matrix-js-sdk": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-24.1.0.tgz", - "integrity": "sha512-xEx2ZoNsS56dwgqLJ3rIv2SUpFxdQLrLKmJCpMatMUKCAg+NGuZfpQ3QXblIbGaqFNQZCH7fC7S48AeTMZp1Jw==", + "version": "29.1.0", + "resolved": "https://registry.npmjs.org/matrix-js-sdk/-/matrix-js-sdk-29.1.0.tgz", + "integrity": "sha512-nF+ACFioDltGCf2KFfXK7QoJ70Ytnzm4Jse2UI+BDXeR9WCjtKefXJtboN2rmU4MFmLCTHcnBTmu6yig67YUqw==", "dependencies": { "@babel/runtime": "^7.12.5", - "@matrix-org/matrix-sdk-crypto-js": "^0.1.0-alpha.5", + "@matrix-org/matrix-sdk-crypto-wasm": "^2.0.0", "another-json": "^0.2.0", "bs58": "^5.0.0", "content-type": "^1.0.4", + "jwt-decode": "^3.1.2", "loglevel": "^1.7.1", "matrix-events-sdk": "0.0.1", - "matrix-widget-api": "^1.3.1", + "matrix-widget-api": "^1.6.0", + "oidc-client-ts": "^2.2.4", "p-retry": "4", "sdp-transform": "^2.14.1", "unhomoglyph": "^1.0.6", "uuid": "9" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/matrix-widget-api": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/matrix-widget-api/-/matrix-widget-api-1.4.0.tgz", - "integrity": "sha512-dw0dRylGQzDUoiaY/g5xx1tBbS7aoov31PRtFMAvG58/4uerYllV9Gfou7w+I1aglwB6hihTREzKltVjARWV6A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/matrix-widget-api/-/matrix-widget-api-1.6.0.tgz", + "integrity": "sha512-VXIJyAZ/WnBmT4C7ePqevgMYGneKMCP/0JuCOqntSsaNlCRHJvwvTxmqUU+ufOpzIF5gYNyIrAjbgrEbK3iqJQ==", "dependencies": { "@types/events": "^3.0.0", "events": "^3.2.0" @@ -6462,6 +6474,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/oidc-client-ts": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/oidc-client-ts/-/oidc-client-ts-2.4.0.tgz", + "integrity": "sha512-WijhkTrlXK2VvgGoakWJiBdfIsVGz6CFzgjNNqZU1hPKV2kyeEaJgLs7RwuiSp2WhLfWBQuLvr2SxVlZnk3N1w==", + "dependencies": { + "crypto-js": "^4.2.0", + "jwt-decode": "^3.1.2" + }, + "engines": { + "node": ">=12.13.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", diff --git a/package.json b/package.json index 69bcd8f..cb6111b 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "linkify-html": "4.0.2", "linkify-react": "4.1.1", "linkifyjs": "4.0.2", - "matrix-js-sdk": "24.1.0", + "matrix-js-sdk": "29.1.0", "millify": "6.1.0", "pdfjs-dist": "3.10.111", "prismjs": "1.29.0", diff --git a/src/app/organisms/join-alias/JoinAlias.jsx b/src/app/organisms/join-alias/JoinAlias.jsx index bb90bf3..bc0a8ad 100644 --- a/src/app/organisms/join-alias/JoinAlias.jsx +++ b/src/app/organisms/join-alias/JoinAlias.jsx @@ -62,7 +62,7 @@ function JoinAliasContent({ term, requestClose }) { let via; if (alias.startsWith('#')) { try { - const aliasData = await mx.resolveRoomAlias(alias); + const aliasData = await mx.getRoomIdForAlias(alias); via = aliasData?.servers.slice(0, 3) || []; if (mountStore.getItem()) { setProcess(`Joining ${alias}...`); diff --git a/src/util/matrixUtil.js b/src/util/matrixUtil.js index 54ee31b..a776fb2 100644 --- a/src/util/matrixUtil.js +++ b/src/util/matrixUtil.js @@ -41,7 +41,7 @@ export function getUsernameOfRoomMember(roomMember) { export async function isRoomAliasAvailable(alias) { try { - const result = await initMatrix.matrixClient.resolveRoomAlias(alias); + const result = await initMatrix.matrixClient.getRoomIdForAlias(alias); if (result.room_id) return false; return false; } catch (e) {