Skip to content

Commit ef78196

Browse files
Revert "Merge develop into livekit (#3569)"
This reverts commit 8297588.
1 parent 8297588 commit ef78196

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2202
-5950
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = {
7474
"jest/no-standalone-expect": [
7575
"error",
7676
{
77-
additionalTestBlockFunctions: ["beforeAll", "beforeEach", "oldBackendOnly", "newBackendOnly"],
77+
additionalTestBlockFunctions: ["beforeAll", "beforeEach", "oldBackendOnly"],
7878
},
7979
],
8080
},

.github/workflows/cypress.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
jobs:
1616
cypress:
1717
name: Cypress
18-
uses: matrix-org/matrix-react-sdk/.github/workflows/cypress.yaml@v3.74.0
18+
uses: matrix-org/matrix-react-sdk/.github/workflows/cypress.yaml@develop
1919
permissions:
2020
actions: read
2121
issues: read

.github/workflows/downstream-artifacts.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
jobs:
2020
build-element-web:
2121
name: Build element-web
22-
uses: matrix-org/matrix-react-sdk/.github/workflows/element-web.yaml@v3.74.0
22+
uses: matrix-org/matrix-react-sdk/.github/workflows/element-web.yaml@develop
2323
with:
2424
matrix-js-sdk-sha: ${{ github.sha }}
2525
react-sdk-repository: matrix-org/matrix-react-sdk

.github/workflows/tests.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
specs: [browserify, integ, unit]
21-
node: [18, latest]
21+
node: [16, 18, latest]
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v3
@@ -50,9 +50,6 @@ jobs:
5050
env:
5151
JEST_SONAR_UNIQUE_OUTPUT_NAME: true
5252

53-
# tell jest to use coloured output
54-
FORCE_COLOR: true
55-
5653
- name: Move coverage files into place
5754
if: env.ENABLE_COVERAGE == 'true'
5855
run: mv coverage/lcov.info coverage/${{ matrix.node }}-${{ matrix.specs }}.lcov.info

.github/workflows/upgrade_dependencies.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
- name: Create Pull Request
2222
id: cpr
23-
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5
23+
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5
2424
with:
2525
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
2626
branch: actions/upgrade-deps

CHANGELOG.md

-48
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
1-
Changes in [26.2.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v26.2.0) (2023-07-04)
2-
==================================================================================================
3-
4-
## 🦖 Deprecations
5-
* The Browserify artifact is being deprecated, scheduled for removal in the October 10th release cycle. ([\#3189](https://github.com/matrix-org/matrix-js-sdk/issues/3189)).
6-
* ElementR: Add `CryptoApi#bootstrapSecretStorage` ([\#3483](https://github.com/matrix-org/matrix-js-sdk/pull/3483)). Contributed by @florianduros.
7-
* Deprecate `MatrixClient.findVerificationRequestDMInProgress`, `MatrixClient.getVerificationRequestsToDeviceInProgress`, and `MatrixClient.requestVerification`, in favour of methods in `CryptoApi`. ([\#3474](https://github.com/matrix-org/matrix-js-sdk/pull/3474)).
8-
* Introduce a new `Crypto.VerificationRequest` interface, and deprecate direct access to the old `VerificationRequest` class. Also deprecate some related classes that were exported from `src/crypto/verification/request/VerificationRequest` ([\#3449](https://github.com/matrix-org/matrix-js-sdk/pull/3449)).
9-
10-
## ✨ Features
11-
* OIDC: navigate to authorization endpoint ([\#3499](https://github.com/matrix-org/matrix-js-sdk/pull/3499)). Contributed by @kerryarchibald.
12-
* Support for interactive device verification in Element-R. ([\#3505](https://github.com/matrix-org/matrix-js-sdk/pull/3505)).
13-
* Support for interactive device verification in Element-R. ([\#3508](https://github.com/matrix-org/matrix-js-sdk/pull/3508)).
14-
* Support for interactive device verification in Element-R. ([\#3490](https://github.com/matrix-org/matrix-js-sdk/pull/3490)). Fixes vector-im/element-web#25316.
15-
* Element-R: Store cross signing keys in secret storage ([\#3498](https://github.com/matrix-org/matrix-js-sdk/pull/3498)). Contributed by @florianduros.
16-
* OIDC: add dynamic client registration util function ([\#3481](https://github.com/matrix-org/matrix-js-sdk/pull/3481)). Contributed by @kerryarchibald.
17-
* Add getLastUnthreadedReceiptFor utility to Thread delegating to the underlying Room ([\#3493](https://github.com/matrix-org/matrix-js-sdk/pull/3493)).
18-
* ElementR: Add `rust-crypto#createRecoveryKeyFromPassphrase` implementation ([\#3472](https://github.com/matrix-org/matrix-js-sdk/pull/3472)). Contributed by @florianduros.
19-
20-
## 🐛 Bug Fixes
21-
* Aggregate relations regardless of whether event fits into the timeline ([\#3496](https://github.com/matrix-org/matrix-js-sdk/pull/3496)). Fixes vector-im/element-web#25596.
22-
* Fix bug where switching media caused media in subsequent calls to fail ([\#3489](https://github.com/matrix-org/matrix-js-sdk/pull/3489)).
23-
* Fix: remove polls from room state on redaction ([\#3475](https://github.com/matrix-org/matrix-js-sdk/pull/3475)). Fixes vector-im/element-web#25573. Contributed by @kerryarchibald.
24-
* Fix export type `GeneratedSecretStorageKey` ([\#3479](https://github.com/matrix-org/matrix-js-sdk/pull/3479)). Contributed by @florianduros.
25-
* Close IDB database before deleting it to prevent spurious unexpected close errors ([\#3478](https://github.com/matrix-org/matrix-js-sdk/pull/3478)). Fixes vector-im/element-web#25597.
26-
27-
Changes in [26.1.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v26.1.0) (2023-06-20)
28-
==================================================================================================
29-
30-
## 🦖 Deprecations
31-
* Introduce a new `Crypto.Verifier` interface, and deprecate direct access to `VerificationBase`, `SAS` and `ReciprocateQRCode` ([\#3414](https://github.com/matrix-org/matrix-js-sdk/pull/3414)).
32-
33-
## ✨ Features
34-
* Add `rust-crypto#isCrossSigningReady` implementation ([\#3462](https://github.com/matrix-org/matrix-js-sdk/pull/3462)). Contributed by @florianduros.
35-
* OIDC: Validate `m.authentication` configuration ([\#3419](https://github.com/matrix-org/matrix-js-sdk/pull/3419)). Contributed by @kerryarchibald.
36-
* ElementR: Add `CryptoApi.getCrossSigningStatus` ([\#3452](https://github.com/matrix-org/matrix-js-sdk/pull/3452)). Contributed by @florianduros.
37-
* Extend stats summary with call device and user count based on room state ([\#3424](https://github.com/matrix-org/matrix-js-sdk/pull/3424)). Contributed by @toger5.
38-
* Update MSC3912 implementation to use `with_rel_type` instead of `with_relations` ([\#3420](https://github.com/matrix-org/matrix-js-sdk/pull/3420)).
39-
* Export thread-related types from SDK ([\#3447](https://github.com/matrix-org/matrix-js-sdk/pull/3447)). Contributed by @stas-demydiuk.
40-
* Use correct /v3 prefix for /refresh ([\#3016](https://github.com/matrix-org/matrix-js-sdk/pull/3016)). Contributed by @davidisaaclee.
41-
42-
## 🐛 Bug Fixes
43-
* Fix thread list being ordered based on all updates ([\#3458](https://github.com/matrix-org/matrix-js-sdk/pull/3458)). Fixes vector-im/element-web#25522.
44-
* Fix: handle `baseUrl` with trailing slash in `fetch.getUrl` ([\#3455](https://github.com/matrix-org/matrix-js-sdk/pull/3455)). Fixes vector-im/element-web#25526. Contributed by @kerryarchibald.
45-
* use cli.canSupport to determine intentional mentions support ([\#3445](https://github.com/matrix-org/matrix-js-sdk/pull/3445)). Fixes vector-im/element-web#25497. Contributed by @kerryarchibald.
46-
* Make sliding sync linearize processing of sync requests ([\#3442](https://github.com/matrix-org/matrix-js-sdk/pull/3442)).
47-
* Fix edge cases around 2nd order relations and threads ([\#3437](https://github.com/matrix-org/matrix-js-sdk/pull/3437)).
48-
491
Changes in [26.0.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v26.0.1) (2023-06-09)
502
==================================================================================================
513

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ endpoints from before Matrix 1.1, for example.
2121

2222
## In a browser
2323

24-
### Note, the browserify build has been deprecated. Please use a bundler like webpack or vite instead.
25-
2624
Download the browser version from
2725
https://github.com/matrix-org/matrix-js-sdk/releases/latest and add that as a
2826
`<script>` to your page. There will be a global variable `matrixcs`

package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "26.2.0",
3+
"version": "26.0.1",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"engines": {
6-
"node": ">=18.0.0"
6+
"node": ">=16.0.0"
77
},
88
"scripts": {
99
"prepublishOnly": "yarn build",
@@ -55,15 +55,13 @@
5555
],
5656
"dependencies": {
5757
"@babel/runtime": "^7.12.5",
58-
"@matrix-org/matrix-sdk-crypto-js": "^0.1.1",
58+
"@matrix-org/matrix-sdk-crypto-js": "^0.1.0-alpha.10",
5959
"another-json": "^0.2.0",
6060
"bs58": "^5.0.0",
6161
"content-type": "^1.0.4",
62-
"jwt-decode": "^3.1.2",
6362
"loglevel": "^1.7.1",
6463
"matrix-events-sdk": "0.0.1",
6564
"matrix-widget-api": "^1.3.1",
66-
"oidc-client-ts": "^2.2.4",
6765
"p-retry": "4",
6866
"sdp-transform": "^2.14.1",
6967
"unhomoglyph": "^1.0.6",
@@ -103,13 +101,13 @@
103101
"debug": "^4.3.4",
104102
"docdash": "^2.0.0",
105103
"domexception": "^4.0.0",
106-
"eslint": "8.43.0",
104+
"eslint": "8.41.0",
107105
"eslint-config-google": "^0.14.0",
108106
"eslint-config-prettier": "^8.5.0",
109107
"eslint-import-resolver-typescript": "^3.5.1",
110108
"eslint-plugin-import": "^2.26.0",
111109
"eslint-plugin-jest": "^27.1.6",
112-
"eslint-plugin-jsdoc": "^46.0.0",
110+
"eslint-plugin-jsdoc": "^45.0.0",
113111
"eslint-plugin-matrix-org": "^1.0.0",
114112
"eslint-plugin-tsdoc": "^0.2.17",
115113
"eslint-plugin-unicorn": "^47.0.0",

spec/integ/crypto/cross-signing.spec.ts

+34-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import "fake-indexeddb/auto";
1919
import { IDBFactory } from "fake-indexeddb";
2020

2121
import { CRYPTO_BACKENDS, InitCrypto } from "../../test-utils/test-utils";
22-
import { createClient, IAuthDict, MatrixClient } from "../../../src";
23-
import { mockSetupCrossSigningRequests } from "../../test-utils/mockEndpoints";
22+
import { createClient, MatrixClient, IAuthDict, UIAuthCallback } from "../../../src";
2423

2524
afterEach(() => {
2625
// reset fake-indexeddb after each test, to make sure we don't leak connections
@@ -63,14 +62,45 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("cross-signing (%s)", (backend: s
6362
});
6463

6564
/**
66-
* Create cross-signing keys and publish the keys
65+
* Mock the requests needed to set up cross signing
66+
*
67+
* Return `{}` for `GET _matrix/client/r0/user/:userId/account_data/:type` request
68+
* Return `{}` for `POST _matrix/client/v3/keys/signatures/upload` request (named `upload-sigs` for fetchMock check)
69+
* Return `{}` for `POST /_matrix/client/(unstable|v3)/keys/device_signing/upload` request (named `upload-keys` for fetchMock check)
70+
*/
71+
function mockSetupCrossSigningRequests(): void {
72+
// have account_data requests return an empty object
73+
fetchMock.get("express:/_matrix/client/r0/user/:userId/account_data/:type", {});
74+
75+
// we expect a request to upload signatures for our device ...
76+
fetchMock.post({ url: "path:/_matrix/client/v3/keys/signatures/upload", name: "upload-sigs" }, {});
77+
78+
// ... and one to upload the cross-signing keys (with UIA)
79+
fetchMock.post(
80+
// legacy crypto uses /unstable/; /v3/ is correct
81+
{
82+
url: new RegExp("/_matrix/client/(unstable|v3)/keys/device_signing/upload"),
83+
name: "upload-keys",
84+
},
85+
{},
86+
);
87+
}
88+
89+
/**
90+
* Create cross-signing keys, publish the keys
91+
* Mock and bootstrap all the required steps
6792
*
6893
* @param authDict - The parameters to as the `auth` dict in the key upload request.
6994
* @see https://spec.matrix.org/v1.6/client-server-api/#authentication-types
7095
*/
7196
async function bootstrapCrossSigning(authDict: IAuthDict): Promise<void> {
97+
const uiaCallback: UIAuthCallback<void> = async (makeRequest) => {
98+
await makeRequest(authDict);
99+
};
100+
101+
// now bootstrap cross signing, and check it resolves successfully
72102
await aliceClient.getCrypto()?.bootstrapCrossSigning({
73-
authUploadDeviceSigningKeys: (makeRequest) => makeRequest(authDict).then(() => undefined),
103+
authUploadDeviceSigningKeys: uiaCallback,
74104
});
75105
}
76106

0 commit comments

Comments
 (0)