Skip to content

Commit e82be9f

Browse files
committed
Merge tag 'v17.0.0' into sc
* Remove groups and groups-related APIs ([\matrix-org#2234](matrix-org#2234)). * Add Element video room type ([\matrix-org#2273](matrix-org#2273)). * Live location sharing - handle redacted beacons ([\matrix-org#2269](matrix-org#2269)). * Fix getSessionsNeedingBackup() limit support ([\matrix-org#2270](matrix-org#2270)). Contributed by @adamvy. * Fix issues with /search and /context API handling for threads ([\matrix-org#2261](matrix-org#2261)). Fixes element-hq/element-web#21543. * Prevent exception 'Unable to set up secret storage' ([\matrix-org#2260](matrix-org#2260)).
2 parents 9faf862 + 59763a8 commit e82be9f

Some content is hidden

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

41 files changed

+2649
-2258
lines changed

.github/codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
codecov:
2+
allow_coverage_offsets: True
3+
coverage:
4+
status:
5+
project: off
6+
patch: off
17
comment:
28
layout: "diff, files"
39
behavior: default

.github/workflows/test_coverage.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@ on:
66
jobs:
77
test-coverage:
88
runs-on: ubuntu-latest
9+
env:
10+
# This must be set for fetchdep.sh to get the right branch
11+
PR_NUMBER: ${{github.event.number}}
912
steps:
1013
- name: Checkout code
1114
uses: actions/checkout@v2
15+
with:
16+
# If this is a pull request, make sure we check out its head rather than the
17+
# automatically generated merge commit, so that the coverage diff excludes
18+
# unrelated changes in the base branch
19+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
20+
21+
- name: Yarn cache
22+
uses: c-hive/gha-yarn-cache@v2
1223

1324
- name: Run tests with coverage
1425
run: "yarn install && yarn build && yarn coverage"
1526

1627
- name: Upload coverage
1728
uses: codecov/codecov-action@v2
1829
with:
30+
fail_ci_if_error: false
1931
verbose: true

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
Changes in [17.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v17.0.0) (2022-04-11)
2+
==================================================================================================
3+
4+
## 🚨 BREAKING CHANGES
5+
* Remove groups and groups-related APIs ([\#2234](https://github.com/matrix-org/matrix-js-sdk/pull/2234)).
6+
7+
## ✨ Features
8+
* Add Element video room type ([\#2273](https://github.com/matrix-org/matrix-js-sdk/pull/2273)).
9+
* Live location sharing - handle redacted beacons ([\#2269](https://github.com/matrix-org/matrix-js-sdk/pull/2269)).
10+
11+
## 🐛 Bug Fixes
12+
* Fix getSessionsNeedingBackup() limit support ([\#2270](https://github.com/matrix-org/matrix-js-sdk/pull/2270)). Contributed by @adamvy.
13+
* Fix issues with /search and /context API handling for threads ([\#2261](https://github.com/matrix-org/matrix-js-sdk/pull/2261)). Fixes vector-im/element-web#21543.
14+
* Prevent exception 'Unable to set up secret storage' ([\#2260](https://github.com/matrix-org/matrix-js-sdk/pull/2260)).
15+
16+
Changes in [16.0.2-rc.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v16.0.2-rc.1) (2022-04-05)
17+
============================================================================================================
18+
19+
## 🚨 BREAKING CHANGES
20+
* Remove groups and groups-related APIs ([\#2234](https://github.com/matrix-org/matrix-js-sdk/pull/2234)).
21+
22+
## ✨ Features
23+
* Add Element video room type ([\#2273](https://github.com/matrix-org/matrix-js-sdk/pull/2273)).
24+
* Live location sharing - handle redacted beacons ([\#2269](https://github.com/matrix-org/matrix-js-sdk/pull/2269)).
25+
26+
## 🐛 Bug Fixes
27+
* Fix getSessionsNeedingBackup() limit support ([\#2270](https://github.com/matrix-org/matrix-js-sdk/pull/2270)). Contributed by @adamvy.
28+
* Fix issues with /search and /context API handling for threads ([\#2261](https://github.com/matrix-org/matrix-js-sdk/pull/2261)). Fixes vector-im/element-web#21543.
29+
* Prevent exception 'Unable to set up secret storage' ([\#2260](https://github.com/matrix-org/matrix-js-sdk/pull/2260)).
30+
131
Changes in [16.0.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v16.0.1) (2022-03-28)
232
==================================================================================================
333

@@ -1988,6 +2018,12 @@ All Changes
19882018
* [BREAKING] Refactor the entire build process
19892019
[\#1113](https://github.com/matrix-org/matrix-js-sdk/pull/1113)
19902020

2021+
Changes in [3.42.2-rc.3](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v3.42.2-rc.3) (2022-04-08)
2022+
============================================================================================================
2023+
2024+
## 🐛 Bug Fixes
2025+
* Make self membership less prone to races ([\#2277](https://github.com/matrix-org/matrix-js-sdk/pull/2277)). Fixes vector-im/element-web#21661.
2026+
19912027
Changes in [3.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v3.0.0) (2020-01-13)
19922028
================================================================================================
19932029
[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v3.0.0-rc.1...v3.0.0)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "16.0.1",
3+
"version": "17.0.0",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"scripts": {
66
"prepublishOnly": "yarn build",

spec/integ/matrix-client-event-timeline.spec.js

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as utils from "../test-utils/test-utils";
22
import { EventTimeline } from "../../src/matrix";
33
import { logger } from "../../src/logger";
44
import { TestClient } from "../TestClient";
5+
import { Thread, THREAD_RELATION_TYPE } from "../../src/models/thread";
56

67
const userId = "@alice:localhost";
78
const userName = "Alice";
@@ -69,6 +70,27 @@ const EVENTS = [
6970
}),
7071
];
7172

73+
const THREAD_ROOT = utils.mkMessage({
74+
room: roomId,
75+
user: userId,
76+
msg: "thread root",
77+
});
78+
79+
const THREAD_REPLY = utils.mkEvent({
80+
room: roomId,
81+
user: userId,
82+
type: "m.room.message",
83+
content: {
84+
"body": "thread reply",
85+
"msgtype": "m.text",
86+
"m.relates_to": {
87+
// We can't use the const here because we change server support mode for test
88+
rel_type: "io.element.thread",
89+
event_id: THREAD_ROOT.event_id,
90+
},
91+
},
92+
});
93+
7294
// start the client, and wait for it to initialise
7395
function startClient(httpBackend, client) {
7496
httpBackend.when("GET", "/versions").respond(200, {});
@@ -116,9 +138,7 @@ describe("getEventTimeline support", function() {
116138
return startClient(httpBackend, client).then(function() {
117139
const room = client.getRoom(roomId);
118140
const timelineSet = room.getTimelineSets()[0];
119-
expect(function() {
120-
client.getEventTimeline(timelineSet, "event");
121-
}).toThrow();
141+
expect(client.getEventTimeline(timelineSet, "event")).rejects.toBeTruthy();
122142
});
123143
});
124144

@@ -136,16 +156,12 @@ describe("getEventTimeline support", function() {
136156
return startClient(httpBackend, client).then(() => {
137157
const room = client.getRoom(roomId);
138158
const timelineSet = room.getTimelineSets()[0];
139-
expect(function() {
140-
client.getEventTimeline(timelineSet, "event");
141-
}).not.toThrow();
159+
expect(client.getEventTimeline(timelineSet, "event")).rejects.toBeFalsy();
142160
});
143161
});
144162

145-
it("scrollback should be able to scroll back to before a gappy /sync",
146-
function() {
163+
it("scrollback should be able to scroll back to before a gappy /sync", function() {
147164
// need a client with timelineSupport disabled to make this work
148-
149165
let room;
150166

151167
return startClient(httpBackend, client).then(function() {
@@ -229,6 +245,7 @@ describe("MatrixClient event timelines", function() {
229245
afterEach(function() {
230246
httpBackend.verifyNoOutstandingExpectation();
231247
client.stopClient();
248+
Thread.setServerSideSupport(false);
232249
});
233250

234251
describe("getEventTimeline", function() {
@@ -355,8 +372,7 @@ describe("MatrixClient event timelines", function() {
355372
]);
356373
});
357374

358-
it("should join timelines where they overlap a previous /context",
359-
function() {
375+
it("should join timelines where they overlap a previous /context", function() {
360376
const room = client.getRoom(roomId);
361377
const timelineSet = room.getTimelineSets()[0];
362378

@@ -478,6 +494,50 @@ describe("MatrixClient event timelines", function() {
478494
httpBackend.flushAllExpected(),
479495
]);
480496
});
497+
498+
it("should handle thread replies with server support by fetching a contiguous thread timeline", async () => {
499+
Thread.setServerSideSupport(true);
500+
client.stopClient(); // we don't need the client to be syncing at this time
501+
const room = client.getRoom(roomId);
502+
const timelineSet = room.getTimelineSets()[0];
503+
504+
httpBackend.when("GET", "/rooms/!foo%3Abar/context/" + encodeURIComponent(THREAD_REPLY.event_id))
505+
.respond(200, function() {
506+
return {
507+
start: "start_token0",
508+
events_before: [],
509+
event: THREAD_REPLY,
510+
events_after: [],
511+
end: "end_token0",
512+
state: [],
513+
};
514+
});
515+
516+
httpBackend.when("GET", "/rooms/!foo%3Abar/event/" + encodeURIComponent(THREAD_ROOT.event_id))
517+
.respond(200, function() {
518+
return THREAD_ROOT;
519+
});
520+
521+
httpBackend.when("GET", "/rooms/!foo%3Abar/relations/" +
522+
encodeURIComponent(THREAD_ROOT.event_id) + "/" +
523+
encodeURIComponent(THREAD_RELATION_TYPE.name) + "?limit=20")
524+
.respond(200, function() {
525+
return {
526+
original_event: THREAD_ROOT,
527+
chunk: [THREAD_REPLY],
528+
next_batch: "next_batch_token0",
529+
prev_batch: "prev_batch_token0",
530+
};
531+
});
532+
533+
const timelinePromise = client.getEventTimeline(timelineSet, THREAD_REPLY.event_id);
534+
await httpBackend.flushAllExpected();
535+
536+
const timeline = await timelinePromise;
537+
538+
expect(timeline.getEvents().find(e => e.getId() === THREAD_ROOT.event_id));
539+
expect(timeline.getEvents().find(e => e.getId() === THREAD_REPLY.event_id));
540+
});
481541
});
482542

483543
describe("paginateEventTimeline", function() {

0 commit comments

Comments
 (0)