Skip to content

Commit 09ba894

Browse files
committed
Merge tag 'v16.0.1' into develop
* emit aggregate room beacon liveness ([\matrix-org#2241](matrix-org#2241)). * Live location sharing - create m.beacon_info events ([\matrix-org#2238](matrix-org#2238)). * Beacon event types from MSC3489 ([\matrix-org#2230](matrix-org#2230)). * Fix incorrect usage of unstable variant of `is_falling_back` ([\matrix-org#2227](matrix-org#2227)).
2 parents d630902 + 0ad83c4 commit 09ba894

File tree

96 files changed

+4041
-1525
lines changed

Some content is hidden

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

96 files changed

+4041
-1525
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module.exports = {
3131
"no-async-promise-executor": "off",
3232
// We use a `logger` intermediary module
3333
"no-console": "error",
34+
35+
// restrict EventEmitters to force callers to use TypedEventEmitter
36+
"no-restricted-imports": ["error", "events"],
3437
},
3538
overrides: [{
3639
files: [

.github/codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
comment:
2+
layout: "diff, files"
3+
behavior: default
4+
require_changes: false
5+
require_base: no
6+
require_head: no

.github/workflows/test_coverage.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test coverage
2+
on:
3+
pull_request: {}
4+
push:
5+
branches: [develop, main, master]
6+
jobs:
7+
test-coverage:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Run tests with coverage
14+
run: "yarn install && yarn build && yarn coverage"
15+
16+
- name: Upload coverage
17+
uses: codecov/codecov-action@v2
18+
with:
19+
verbose: true

CHANGELOG.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
Changes in [16.0.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v16.0.1) (2022-03-28)
2+
==================================================================================================
3+
4+
## ✨ Features
5+
* emit aggregate room beacon liveness ([\#2241](https://github.com/matrix-org/matrix-js-sdk/pull/2241)).
6+
* Live location sharing - create m.beacon_info events ([\#2238](https://github.com/matrix-org/matrix-js-sdk/pull/2238)).
7+
* Beacon event types from MSC3489 ([\#2230](https://github.com/matrix-org/matrix-js-sdk/pull/2230)).
8+
9+
## 🐛 Bug Fixes
10+
* Fix incorrect usage of unstable variant of `is_falling_back` ([\#2227](https://github.com/matrix-org/matrix-js-sdk/pull/2227)).
11+
12+
Changes in [16.0.1-rc.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v16.0.1-rc.1) (2022-03-22)
13+
============================================================================================================
14+
15+
Changes in [16.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v16.0.0) (2022-03-15)
16+
==================================================================================================
17+
18+
## 🚨 BREAKING CHANGES
19+
* Improve typing around event emitter handlers ([\#2180](https://github.com/matrix-org/matrix-js-sdk/pull/2180)).
20+
21+
## ✨ Features
22+
* Fix defer not supporting resolving with a Promise<T> ([\#2216](https://github.com/matrix-org/matrix-js-sdk/pull/2216)).
23+
* add LocationAssetType enum ([\#2214](https://github.com/matrix-org/matrix-js-sdk/pull/2214)).
24+
* Support for mid-call devices changes ([\#2154](https://github.com/matrix-org/matrix-js-sdk/pull/2154)). Contributed by @SimonBrandner.
25+
* Add new room state emit RoomStateEvent.Update for lower-frequency hits ([\#2192](https://github.com/matrix-org/matrix-js-sdk/pull/2192)).
26+
27+
## 🐛 Bug Fixes
28+
* Fix wrong event_id being sent for m.in_reply_to of threads ([\#2213](https://github.com/matrix-org/matrix-js-sdk/pull/2213)).
29+
* Fix wrongly asserting that PushRule::conditions is non-null ([\#2217](https://github.com/matrix-org/matrix-js-sdk/pull/2217)).
30+
* Make createThread more resilient when missing rootEvent ([\#2207](https://github.com/matrix-org/matrix-js-sdk/pull/2207)). Fixes vector-im/element-web#21130.
31+
* Fix bug with the /hierarchy API sending invalid requests ([\#2201](https://github.com/matrix-org/matrix-js-sdk/pull/2201)). Fixes vector-im/element-web#21170.
32+
* fix relation sender filter ([\#2196](https://github.com/matrix-org/matrix-js-sdk/pull/2196)). Fixes vector-im/element-web#20877.
33+
* Fix bug with one-way audio after a transfer ([\#2193](https://github.com/matrix-org/matrix-js-sdk/pull/2193)).
34+
35+
Changes in [16.0.0-rc.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v16.0.0-rc.1) (2022-03-08)
36+
============================================================================================================
37+
38+
## 🚨 BREAKING CHANGES
39+
* Improve typing around event emitter handlers ([\#2180](https://github.com/matrix-org/matrix-js-sdk/pull/2180)).
40+
41+
## ✨ Features
42+
* Fix defer not supporting resolving with a Promise<T> ([\#2216](https://github.com/matrix-org/matrix-js-sdk/pull/2216)).
43+
* add LocationAssetType enum ([\#2214](https://github.com/matrix-org/matrix-js-sdk/pull/2214)).
44+
* Support for mid-call devices changes ([\#2154](https://github.com/matrix-org/matrix-js-sdk/pull/2154)). Contributed by @SimonBrandner.
45+
* Add new room state emit RoomStateEvent.Update for lower-frequency hits ([\#2192](https://github.com/matrix-org/matrix-js-sdk/pull/2192)).
46+
47+
## 🐛 Bug Fixes
48+
* Fix wrong event_id being sent for m.in_reply_to of threads ([\#2213](https://github.com/matrix-org/matrix-js-sdk/pull/2213)).
49+
* Fix wrongly asserting that PushRule::conditions is non-null ([\#2217](https://github.com/matrix-org/matrix-js-sdk/pull/2217)).
50+
* Make createThread more resilient when missing rootEvent ([\#2207](https://github.com/matrix-org/matrix-js-sdk/pull/2207)). Fixes vector-im/element-web#21130.
51+
* Fix bug with the /hierarchy API sending invalid requests ([\#2201](https://github.com/matrix-org/matrix-js-sdk/pull/2201)). Fixes vector-im/element-web#21170.
52+
* fix relation sender filter ([\#2196](https://github.com/matrix-org/matrix-js-sdk/pull/2196)). Fixes vector-im/element-web#20877.
53+
* Fix bug with one-way audio after a transfer ([\#2193](https://github.com/matrix-org/matrix-js-sdk/pull/2193)).
54+
155
Changes in [15.6.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v15.6.0) (2022-02-28)
256
==================================================================================================
357

CONTRIBUTING.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,48 @@ checks, so please check back after a few minutes.
100100

101101
Tests
102102
-----
103-
If your PR is a feature (ie. if it's being labelled with the 'T-Enhancement'
104-
label) then we require that the PR also includes tests. These need to test that
105-
your feature works as expected and ideally test edge cases too. For the js-sdk
106-
itself, your tests should generally be unit tests. matrix-react-sdk also uses
107-
these guidelines, so for that your tests can be unit tests using
108-
react-test-utils, snapshot tests or screenshot tests.
109-
110-
We don't require tests for bug fixes (T-Defect) but strongly encourage regression
111-
tests for the bug itself wherever possible.
112-
113-
In the future we may formalise this more with a minimum test coverage
114-
percentage for the diff.
103+
Your PR should include tests.
104+
105+
For new user facing features in `matrix-react-sdk` or `element-web`, you
106+
must include:
107+
108+
1. Comprehensive unit tests written in Jest. These are located in `/test`.
109+
2. "happy path" end-to-end tests.
110+
These are located in `/test/end-to-end-tests` in `matrix-react-sdk`, and
111+
are run using `element-web`. Ideally, you would also include tests for edge
112+
and error cases.
113+
114+
Unit tests are expected even when the feature is in labs. It's good practice
115+
to write tests alongside the code as it ensures the code is testable from
116+
the start, and gives you a fast feedback loop while you're developing the
117+
functionality. End-to-end tests should be added prior to the feature
118+
leaving labs, but don't have to be present from the start (although it might
119+
be beneficial to have some running early, so you can test things faster).
120+
121+
For bugs in those repos, your change must include at least one unit test or
122+
end-to-end test; which is best depends on what sort of test most concisely
123+
exercises the area.
124+
125+
Changes to `matrix-js-sdk` must be accompanied by unit tests written in Jest.
126+
These are located in `/spec/`.
127+
128+
When writing unit tests, please aim for a high level of test coverage
129+
for new code - 80% or greater. If you cannot achieve that, please document
130+
why it's not possible in your PR.
131+
132+
Tests validate that your change works as intended and also document
133+
concisely what is being changed. Ideally, your new tests fail
134+
prior to your change, and succeed once it has been applied. You may
135+
find this simpler to achieve if you write the tests first.
136+
137+
If you're spiking some code that's experimental and not being used to support
138+
production features, exceptions can be made to requirements for tests.
139+
Note that tests will still be required in order to ship the feature, and it's
140+
strongly encouraged to think about tests early in the process, as adding
141+
tests later will become progressively more difficult.
142+
143+
If you're not sure how to approach writing tests for your change, ask for help
144+
in [#element-dev](https://matrix.to/#/#element-dev:matrix.org).
115145

116146
Code style
117147
----------

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "15.6.0",
3+
"version": "16.0.1",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"scripts": {
66
"prepublishOnly": "yarn build",
@@ -89,7 +89,7 @@
8989
"better-docs": "^2.4.0-beta.9",
9090
"browserify": "^17.0.0",
9191
"docdash": "^1.2.0",
92-
"eslint": "7.18.0",
92+
"eslint": "8.9.0",
9393
"eslint-config-google": "^0.14.0",
9494
"eslint-plugin-import": "^2.25.4",
9595
"eslint-plugin-matrix-org": "^0.4.0",
@@ -113,7 +113,8 @@
113113
"<rootDir>/src/**/*.{js,ts}"
114114
],
115115
"coverageReporters": [
116-
"text"
116+
"text",
117+
"json"
117118
]
118119
},
119120
"typings": "./lib/index.d.ts"

spec/TestClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import MockHttpBackend from 'matrix-mock-request';
2424
import { LocalStorageCryptoStore } from '../src/crypto/store/localStorage-crypto-store';
2525
import { logger } from '../src/logger';
2626
import { WebStorageSessionStore } from "../src/store/session/webstorage";
27-
import { syncPromise } from "./test-utils";
27+
import { syncPromise } from "./test-utils/test-utils";
2828
import { createClient } from "../src/matrix";
2929
import { MockStorageApi } from "./MockStorageApi";
3030

@@ -86,7 +86,7 @@ TestClient.prototype.toString = function() {
8686
*/
8787
TestClient.prototype.start = function() {
8888
logger.log(this + ': starting');
89-
this.httpBackend.when("GET", "/capabilities").respond(200, { capabilities: {} });
89+
this.httpBackend.when("GET", "/versions").respond(200, {});
9090
this.httpBackend.when("GET", "/pushrules").respond(200, {});
9191
this.httpBackend.when("POST", "/filter").respond(200, { filter_id: "fid" });
9292
this.expectDeviceKeyUpload();

spec/browserify/sync-browserify.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
// load XmlHttpRequest mock
1818
import "./setupTests";
1919
import "../../dist/browser-matrix"; // uses browser-matrix instead of the src
20-
import * as utils from "../test-utils";
20+
import * as utils from "../test-utils/test-utils";
2121
import { TestClient } from "../TestClient";
2222

2323
const USER_ID = "@user:test.server";
@@ -35,7 +35,7 @@ describe("Browserify Test", function() {
3535
client = testClient.client;
3636
httpBackend = testClient.httpBackend;
3737

38-
httpBackend.when("GET", "/capabilities").respond(200, { capabilities: {} });
38+
httpBackend.when("GET", "/versions").respond(200, {});
3939
httpBackend.when("GET", "/pushrules").respond(200, {});
4040
httpBackend.when("POST", "/filter").respond(200, { filter_id: "fid" });
4141

spec/integ/devicelist-integ-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
*/
1818

1919
import { TestClient } from '../TestClient';
20-
import * as testUtils from '../test-utils';
20+
import * as testUtils from '../test-utils/test-utils';
2121
import { logger } from '../../src/logger';
2222

2323
const ROOM_ID = "!room:id";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ limitations under the License.
2929
import '../olm-loader';
3030

3131
import { logger } from '../../src/logger';
32-
import * as testUtils from "../test-utils";
32+
import * as testUtils from "../test-utils/test-utils";
3333
import { TestClient } from "../TestClient";
3434
import { CRYPTO_ENABLED } from "../../src/client";
3535

@@ -722,7 +722,7 @@ describe("MatrixClient crypto", function() {
722722
return Promise.resolve()
723723
.then(() => {
724724
logger.log(aliTestClient + ': starting');
725-
httpBackend.when("GET", "/capabilities").respond(200, {});
725+
httpBackend.when("GET", "/versions").respond(200, {});
726726
httpBackend.when("GET", "/pushrules").respond(200, {});
727727
httpBackend.when("POST", "/filter").respond(200, { filter_id: "fid" });
728728
aliTestClient.expectDeviceKeyUpload();

0 commit comments

Comments
 (0)