Skip to content

Commit 1ec2e3b

Browse files
committed
Merge remote-tracking branch 'origin/develop' into rav/remove_upload_keys
2 parents 8a841b8 + 11d8f56 commit 1ec2e3b

File tree

119 files changed

+3872
-1998
lines changed

Some content is hidden

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

119 files changed

+3872
-1998
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,14 @@ module.exports = {
8585
// We use a `logger` intermediary module
8686
"no-console": "error",
8787
},
88+
}, {
89+
files: [
90+
"spec/**/*.ts",
91+
],
92+
rules: {
93+
// We don't need super strict typing in test utilities
94+
"@typescript-eslint/explicit-function-return-type": "off",
95+
"@typescript-eslint/explicit-member-accessibility": "off",
96+
},
8897
}],
8998
};

.github/CODEOWNERS

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
* @matrix-org/element-web
2-
3-
/src/webrtc @matrix-org/element-call-reviewers
4-
/spec/*/webrtc @matrix-org/element-call-reviewers
1+
* @matrix-org/element-web
2+
/.github/workflows/** @matrix-org/element-web-app-team
3+
/package.json @matrix-org/element-web-app-team
4+
/yarn.lock @matrix-org/element-web-app-team
5+
/src/webrtc @matrix-org/element-call-reviewers
6+
/spec/*/webrtc @matrix-org/element-call-reviewers

.github/workflows/docs-pr-netlify.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
1515
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
1616
- name: 📥 Download artifact
17-
uses: dawidd6/action-download-artifact@b12b127cf24433d14b4f93cee62f5465076ba82a # v2.24.1
17+
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
1818
with:
1919
workflow: static_analysis.yml
2020
run_id: ${{ github.event.workflow_run.id }}

.github/workflows/pull_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
if: github.event.action == 'opened'
4343
steps:
4444
- name: Check membership
45-
uses: tspascoal/get-user-teams-membership@v1
45+
uses: tspascoal/get-user-teams-membership@v2
4646
id: teams
4747
with:
4848
username: ${{ github.event.pull_request.user.login }}

.github/workflows/static_analysis.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,44 @@ jobs:
6666
run: "yarn run gendoc"
6767

6868
- name: Upload Artifact
69-
uses: actions/upload-artifact@v2
69+
uses: actions/upload-artifact@v3
7070
with:
7171
name: docs
7272
path: _docs
7373
# We'll only use this in a workflow_run, then we're done with it
7474
retention-days: 1
75+
76+
tsc-strict:
77+
name: Typescript Strict Error Checker
78+
if: github.event_name == 'pull_request'
79+
runs-on: ubuntu-latest
80+
permissions:
81+
pull-requests: read
82+
checks: write
83+
steps:
84+
- uses: actions/checkout@v3
85+
86+
- name: Get diff lines
87+
id: diff
88+
uses: Equip-Collaboration/[email protected]
89+
with:
90+
include: '["\\.tsx?$"]'
91+
92+
- name: Detecting files changed
93+
id: files
94+
uses: futuratrepadeira/[email protected]
95+
with:
96+
repo-token: ${{ secrets.GITHUB_TOKEN }}
97+
pattern: '^.*\.tsx?$'
98+
99+
- uses: t3chguy/typescript-check-action@main
100+
with:
101+
repo-token: ${{ secrets.GITHUB_TOKEN }}
102+
use-check: false
103+
check-fail-mode: added
104+
output-behaviour: annotate
105+
ts-extra-args: '--noImplicitAny'
106+
files-changed: ${{ steps.files.outputs.files_updated }}
107+
files-added: ${{ steps.files.outputs.files_created }}
108+
files-deleted: ${{ steps.files.outputs.files_deleted }}
109+
line-numbers: ${{ steps.diff.outputs.lineNumbers }}

.github/workflows/tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ jobs:
3636
id: cpu-cores
3737
uses: SimenB/github-actions-cpu-cores@v1
3838

39+
- name: Run tests with coverage and metrics
40+
if: github.ref == 'refs/heads/develop'
41+
run: |
42+
yarn coverage --ci --reporters github-actions '--reporters=<rootDir>/spec/slowReporter.js' --max-workers ${{ steps.cpu-cores.outputs.count }} ./spec/${{ matrix.specs }}
43+
mv coverage/lcov.info coverage/${{ matrix.node }}-${{ matrix.specs }}.lcov.info
44+
env:
45+
JEST_SONAR_UNIQUE_OUTPUT_NAME: true
46+
3947
- name: Run tests with coverage
48+
if: github.ref != 'refs/heads/develop'
4049
run: |
4150
yarn coverage --ci --reporters github-actions --max-workers ${{ steps.cpu-cores.outputs.count }} ./spec/${{ matrix.specs }}
4251
mv coverage/lcov.info coverage/${{ matrix.node }}-${{ matrix.specs }}.lcov.info

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
Changes in [21.2.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v21.2.0) (2022-11-22)
2+
==================================================================================================
3+
4+
## ✨ Features
5+
* Make calls go back to 'connecting' state when media lost ([\#2880](https://github.com/matrix-org/matrix-js-sdk/pull/2880)).
6+
* Add ability to send unthreaded receipt ([\#2878](https://github.com/matrix-org/matrix-js-sdk/pull/2878)).
7+
* Add way to abort search requests ([\#2877](https://github.com/matrix-org/matrix-js-sdk/pull/2877)).
8+
* sliding sync: add custom room subscriptions support ([\#2834](https://github.com/matrix-org/matrix-js-sdk/pull/2834)).
9+
* webrtc: add advanced audio settings ([\#2434](https://github.com/matrix-org/matrix-js-sdk/pull/2434)). Contributed by @MrAnno.
10+
* Add support for group calls using MSC3401 ([\#2553](https://github.com/matrix-org/matrix-js-sdk/pull/2553)).
11+
* Make the js-sdk conform to tsc --strict ([\#2835](https://github.com/matrix-org/matrix-js-sdk/pull/2835)). Fixes #2112 #2116 and #2124.
12+
* Let leave requests outlive the window ([\#2815](https://github.com/matrix-org/matrix-js-sdk/pull/2815)). Fixes vector-im/element-call#639.
13+
* Add event and message capabilities to RoomWidgetClient ([\#2797](https://github.com/matrix-org/matrix-js-sdk/pull/2797)).
14+
* Misc fixes for group call widgets ([\#2657](https://github.com/matrix-org/matrix-js-sdk/pull/2657)).
15+
* Support nested Matrix clients via the widget API ([\#2473](https://github.com/matrix-org/matrix-js-sdk/pull/2473)).
16+
* Set max average bitrate on PTT calls ([\#2499](https://github.com/matrix-org/matrix-js-sdk/pull/2499)). Fixes vector-im/element-call#440.
17+
* Add config option for e2e group call signalling ([\#2492](https://github.com/matrix-org/matrix-js-sdk/pull/2492)).
18+
* Enable DTX on audio tracks in calls ([\#2482](https://github.com/matrix-org/matrix-js-sdk/pull/2482)).
19+
* Don't ignore call member events with a distant future expiration date ([\#2466](https://github.com/matrix-org/matrix-js-sdk/pull/2466)).
20+
* Expire call member state events after 1 hour ([\#2446](https://github.com/matrix-org/matrix-js-sdk/pull/2446)).
21+
* Emit unknown device errors for group call participants without e2e ([\#2447](https://github.com/matrix-org/matrix-js-sdk/pull/2447)).
22+
* Mute disconnected peers in PTT mode ([\#2421](https://github.com/matrix-org/matrix-js-sdk/pull/2421)).
23+
* Add support for sending encrypted to-device events with OLM ([\#2322](https://github.com/matrix-org/matrix-js-sdk/pull/2322)). Contributed by @robertlong.
24+
* Support for PTT group call mode ([\#2338](https://github.com/matrix-org/matrix-js-sdk/pull/2338)).
25+
26+
## 🐛 Bug Fixes
27+
* Fix registration add phone number not working ([\#2876](https://github.com/matrix-org/matrix-js-sdk/pull/2876)). Contributed by @bagvand.
28+
* Use an underride rule for Element Call notifications ([\#2873](https://github.com/matrix-org/matrix-js-sdk/pull/2873)). Fixes vector-im/element-web#23691.
29+
* Fixes unwanted highlight notifications with encrypted threads ([\#2862](https://github.com/matrix-org/matrix-js-sdk/pull/2862)).
30+
* Extra insurance that we don't mix events in the wrong timelines - v2 ([\#2856](https://github.com/matrix-org/matrix-js-sdk/pull/2856)). Contributed by @MadLittleMods.
31+
* Hide pending events in thread timelines ([\#2843](https://github.com/matrix-org/matrix-js-sdk/pull/2843)). Fixes vector-im/element-web#23684.
32+
* Fix pagination token tracking for mixed room timelines ([\#2855](https://github.com/matrix-org/matrix-js-sdk/pull/2855)). Fixes vector-im/element-web#23695.
33+
* Extra insurance that we don't mix events in the wrong timelines ([\#2848](https://github.com/matrix-org/matrix-js-sdk/pull/2848)). Contributed by @MadLittleMods.
34+
* Do not freeze state in `initialiseState()` ([\#2846](https://github.com/matrix-org/matrix-js-sdk/pull/2846)).
35+
* Don't remove our own member for a split second when entering a call ([\#2844](https://github.com/matrix-org/matrix-js-sdk/pull/2844)).
36+
* Resolve races between `initLocalCallFeed` and `leave` ([\#2826](https://github.com/matrix-org/matrix-js-sdk/pull/2826)).
37+
* Add throwOnFail to groupCall.setScreensharingEnabled ([\#2787](https://github.com/matrix-org/matrix-js-sdk/pull/2787)).
38+
* Fix connectivity regressions ([\#2780](https://github.com/matrix-org/matrix-js-sdk/pull/2780)).
39+
* Fix screenshare failing after several attempts ([\#2771](https://github.com/matrix-org/matrix-js-sdk/pull/2771)). Fixes vector-im/element-call#625.
40+
* Don't block muting/unmuting on network requests ([\#2754](https://github.com/matrix-org/matrix-js-sdk/pull/2754)). Fixes vector-im/element-call#592.
41+
* Fix ICE restarts ([\#2702](https://github.com/matrix-org/matrix-js-sdk/pull/2702)).
42+
* Target widget actions at a specific room ([\#2670](https://github.com/matrix-org/matrix-js-sdk/pull/2670)).
43+
* Add tests for ice candidate sending ([\#2674](https://github.com/matrix-org/matrix-js-sdk/pull/2674)).
44+
* Prevent exception when muting ([\#2667](https://github.com/matrix-org/matrix-js-sdk/pull/2667)). Fixes vector-im/element-call#578.
45+
* Fix race in creating calls ([\#2662](https://github.com/matrix-org/matrix-js-sdk/pull/2662)).
46+
* Add client.waitUntilRoomReadyForGroupCalls() ([\#2641](https://github.com/matrix-org/matrix-js-sdk/pull/2641)).
47+
* Wait for client to start syncing before making group calls ([\#2632](https://github.com/matrix-org/matrix-js-sdk/pull/2632)). Fixes #2589.
48+
* Add GroupCallEventHandlerEvent.Room ([\#2631](https://github.com/matrix-org/matrix-js-sdk/pull/2631)).
49+
* Add missing events from reemitter to GroupCall ([\#2527](https://github.com/matrix-org/matrix-js-sdk/pull/2527)). Contributed by @toger5.
50+
* Prevent double mute status changed events ([\#2502](https://github.com/matrix-org/matrix-js-sdk/pull/2502)).
51+
* Don't mute the remote side immediately in PTT calls ([\#2487](https://github.com/matrix-org/matrix-js-sdk/pull/2487)). Fixes vector-im/element-call#425.
52+
* Fix some MatrixCall leaks and use a shared AudioContext ([\#2484](https://github.com/matrix-org/matrix-js-sdk/pull/2484)). Fixes vector-im/element-call#412.
53+
* Don't block muting on determining whether the device exists ([\#2461](https://github.com/matrix-org/matrix-js-sdk/pull/2461)).
54+
* Only clone streams on Safari ([\#2450](https://github.com/matrix-org/matrix-js-sdk/pull/2450)). Fixes vector-im/element-call#267.
55+
* Set PTT mode on call correctly ([\#2445](https://github.com/matrix-org/matrix-js-sdk/pull/2445)). Fixes vector-im/element-call#382.
56+
* Wait for mute event to send in PTT mode ([\#2401](https://github.com/matrix-org/matrix-js-sdk/pull/2401)).
57+
* Handle other members having no e2e keys ([\#2383](https://github.com/matrix-org/matrix-js-sdk/pull/2383)). Fixes vector-im/element-call#338.
58+
* Fix races when muting/unmuting ([\#2370](https://github.com/matrix-org/matrix-js-sdk/pull/2370)).
59+
160
Changes in [21.1.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v21.1.0) (2022-11-08)
261
==================================================================================================
362

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
Matrix Javascript SDK
1010
=====================
1111

12-
This is the [Matrix](https://matrix.org) Client-Server r0 SDK for
13-
JavaScript. This SDK can be run in a browser or in Node.js.
12+
This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a
13+
browser or in Node.js.
14+
15+
The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only
16+
guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports
17+
is removed in v1.4 then the feature is *eligible* for removal from the SDK when v1.8 is released. This SDK has no
18+
guarantee on implementing all features of any particular spec release, currently. This can mean that the SDK will call
19+
endpoints from before Matrix 1.1, for example.
1420

1521
Quickstart
1622
==========

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "21.1.0",
3+
"version": "21.2.0",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"engines": {
66
"node": ">=16.0.0"
@@ -54,7 +54,6 @@
5454
],
5555
"dependencies": {
5656
"@babel/runtime": "^7.12.5",
57-
"@types/sdp-transform": "^2.4.5",
5857
"another-json": "^0.2.0",
5958
"bs58": "^5.0.0",
6059
"content-type": "^1.0.4",
@@ -85,26 +84,27 @@
8584
"@types/content-type": "^1.1.5",
8685
"@types/domexception": "^4.0.0",
8786
"@types/jest": "^29.0.0",
88-
"@types/node": "16",
87+
"@types/node": "18",
88+
"@types/sdp-transform": "^2.4.5",
8989
"@typescript-eslint/eslint-plugin": "^5.6.0",
9090
"@typescript-eslint/parser": "^5.6.0",
9191
"allchange": "^1.0.6",
9292
"babel-jest": "^29.0.0",
9393
"babelify": "^10.0.0",
9494
"better-docs": "^2.4.0-beta.9",
9595
"browserify": "^17.0.0",
96-
"docdash": "^1.2.0",
96+
"docdash": "^2.0.0",
9797
"domexception": "^4.0.0",
98-
"eslint": "8.26.0",
98+
"eslint": "8.28.0",
9999
"eslint-config-google": "^0.14.0",
100100
"eslint-import-resolver-typescript": "^3.5.1",
101101
"eslint-plugin-import": "^2.26.0",
102-
"eslint-plugin-matrix-org": "^0.7.0",
103-
"eslint-plugin-unicorn": "^44.0.2",
102+
"eslint-plugin-matrix-org": "^0.8.0",
103+
"eslint-plugin-unicorn": "^45.0.0",
104104
"exorcist": "^2.0.0",
105105
"fake-indexeddb": "^4.0.0",
106106
"jest": "^29.0.0",
107-
"jest-environment-jsdom": "^28.1.3",
107+
"jest-environment-jsdom": "^29.0.0",
108108
"jest-localstorage-mock": "^2.4.6",
109109
"jest-mock": "^29.0.0",
110110
"matrix-mock-request": "^2.5.0",

spec/integ/matrix-client-crypto.spec.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,4 +684,45 @@ describe("MatrixClient crypto", () => {
684684
});
685685
await httpBackend.flushAllExpected();
686686
});
687+
688+
it("Checks for outgoing room key requests for a given event's session", async () => {
689+
const eventA0 = new MatrixEvent({
690+
sender: "@bob:example.com",
691+
room_id: "!someroom",
692+
content: {
693+
algorithm: 'm.megolm.v1.aes-sha2',
694+
session_id: "sessionid",
695+
sender_key: "senderkey",
696+
},
697+
});
698+
const eventA1 = new MatrixEvent({
699+
sender: "@bob:example.com",
700+
room_id: "!someroom",
701+
content: {
702+
algorithm: 'm.megolm.v1.aes-sha2',
703+
session_id: "sessionid",
704+
sender_key: "senderkey",
705+
},
706+
});
707+
const eventB = new MatrixEvent({
708+
sender: "@bob:example.com",
709+
room_id: "!someroom",
710+
content: {
711+
algorithm: 'm.megolm.v1.aes-sha2',
712+
session_id: "othersessionid",
713+
sender_key: "senderkey",
714+
},
715+
});
716+
const nonEncryptedEvent = new MatrixEvent({
717+
sender: "@bob:example.com",
718+
room_id: "!someroom",
719+
content: {},
720+
});
721+
722+
aliTestClient.client.crypto?.onSyncCompleted({});
723+
await aliTestClient.client.cancelAndResendEventRoomKeyRequest(eventA0);
724+
expect(await aliTestClient.client.getOutgoingRoomKeyRequest(eventA1)).not.toBeNull();
725+
expect(await aliTestClient.client.getOutgoingRoomKeyRequest(eventB)).toBeNull();
726+
expect(await aliTestClient.client.getOutgoingRoomKeyRequest(nonEncryptedEvent)).toBeNull();
727+
});
687728
});

0 commit comments

Comments
 (0)