Skip to content

Commit ee15b18

Browse files
committed
Merge tag 'v18.1.0' into sc
* Convert `getLocalAliases` to a stable API call ([\matrix-org#2402](matrix-org#2402)). * Fix request, crypto, and bs58 imports ([\matrix-org#2414](matrix-org#2414)). Fixes matrix-org#2415. * Update relations after every decryption attempt ([\matrix-org#2387](matrix-org#2387)). Fixes element-hq/element-web#22258. Contributed by @weeman1337. * Fix degraded mode for the IDBStore and test it ([\matrix-org#2400](matrix-org#2400)). Fixes matrix-org/element-web-rageshakes#13170. * Don't cancel SAS verifications if `ready` is received after `start` ([\matrix-org#2250](matrix-org#2250)). * Prevent overlapping sync accumulator persists ([\matrix-org#2392](matrix-org#2392)). Fixes vector-im/element-web#21541. * Fix behaviour of isRelation with relation m.replace for state events ([\matrix-org#2389](matrix-org#2389)). Fixes element-hq/element-web#22280. * Fixes matrix-org#2384 ([\matrix-org#2385](matrix-org#2385)). Fixes undefined/matrix-js-sdk#2384. Contributed by @schmop. * Ensure rooms are recalculated on re-invites ([\matrix-org#2374](matrix-org#2374)). Fixes element-hq/element-web#22106.
2 parents 4a5ee08 + bf30c15 commit ee15b18

Some content is hidden

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

46 files changed

+2142
-2630
lines changed

.eslintrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ module.exports = {
5252
"@typescript-eslint/no-explicit-any": "off",
5353
// We'd rather not do this but we do
5454
"@typescript-eslint/ban-ts-comment": "off",
55+
// We're okay with assertion errors when we ask for them
56+
"@typescript-eslint/no-non-null-assertion": "off",
5557

5658
"quotes": "off",
5759
// We use a `logger` intermediary module

.github/workflows/jsdoc.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release Process
2+
on:
3+
release:
4+
types: [ published ]
5+
concurrency: ${{ github.workflow }}-${{ github.ref }}
6+
jobs:
7+
jsdoc:
8+
name: Publish Documentation
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 🧮 Checkout code
12+
uses: actions/checkout@v3
13+
14+
- name: 🔧 Yarn cache
15+
uses: actions/setup-node@v3
16+
with:
17+
cache: "yarn"
18+
19+
- name: 🔨 Install dependencies
20+
run: "yarn install --pure-lockfile"
21+
22+
- name: 📖 Generate JSDoc
23+
run: "yarn gendoc"
24+
25+
- name: 📋 Copy to temp
26+
run: |
27+
ls -lah
28+
tag="${{ github.ref_name }}"
29+
version="${tag#v}"
30+
echo "VERSION=$version" >> $GITHUB_ENV
31+
cp -a "./.jsdoc/matrix-js-sdk/$version" $RUNNER_TEMP
32+
33+
- name: 🧮 Checkout gh-pages
34+
uses: actions/checkout@v3
35+
with:
36+
ref: gh-pages
37+
38+
- name: 🔪 Prepare
39+
run: |
40+
cp -a "$RUNNER_TEMP/$VERSION" .
41+
42+
# Add the new directory to the index if it isn't there already
43+
if ! grep -q "Version $VERSION" index.html; then
44+
perl -i -pe 'BEGIN {$rel=shift} $_ =~ /^<\/ul>/ && print
45+
"<li><a href=\"${rel}/index.html\">Version ${rel}</a></li>\n"' "$VERSION" index.html
46+
fi
47+
48+
- name: 🚀 Deploy
49+
uses: peaceiris/actions-gh-pages@v3
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
keep_files: true
53+
publish_dir: .

.github/workflows/pr_details.yml

+20-30
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
# Find details about the PR associated with this ref
2-
# Outputs:
3-
# prnumber: the ID number of the associated PR
4-
# headref: the name of the head branch of the PR
5-
# baseref: the name of the base branch of the PR
62
name: PR Details
73
on:
84
workflow_call:
@@ -18,13 +14,16 @@ on:
1814
outputs:
1915
pr_id:
2016
description: The ID of the PR found
21-
value: ${{ jobs.prdetails.outputs.pr_id }}
17+
value: ${{ fromJSON(jobs.prdetails.outputs.result).number }}
2218
head_branch:
2319
description: The head branch of the PR found
24-
value: ${{ jobs.prdetails.outputs.head_branch }}
20+
value: ${{ fromJSON(jobs.prdetails.outputs.result).head.ref }}
2521
base_branch:
2622
description: The base branch of the PR found
27-
value: ${{ jobs.prdetails.outputs.base_branch }}
23+
value: ${{ fromJSON(jobs.prdetails.outputs.result).base.ref }}
24+
data:
25+
description: The JSON data of the pull request API object
26+
value: ${{ jobs.prdetails.outputs.result }})
2827

2928
jobs:
3029
prdetails:
@@ -33,27 +32,18 @@ jobs:
3332
steps:
3433
- name: "🔍 Read PR details"
3534
id: details
36-
# We need to find the PR number that corresponds to the branch, which we do by searching the GH API
37-
# The workflow_run event includes a list of pull requests, but it doesn't get populated for
38-
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
39-
run: |
40-
head_branch='${{ inputs.owner }}:${{ inputs.branch }}'
41-
echo "Head branch: $head_branch"
42-
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
43-
pr_data=$(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri")
44-
45-
pr_number=$(jq -r '.[] | .number' <<< "$pr_data")
46-
echo "PR number: $pr_number"
47-
echo "::set-output name=prnumber::$pr_number"
48-
49-
head_ref=$(jq -r '.[] | .head.ref' <<< "$pr_data")
50-
echo "Head ref: $head_ref"
51-
echo "::set-output name=headref::$head_ref"
52-
53-
base_ref=$(jq -r '.[] | .base.ref' <<< "$pr_data")
54-
echo "Base ref: $base_ref"
55-
echo "::set-output name=baseref::$base_ref"
35+
uses: actions/github-script@v5
36+
with:
37+
# We need to find the PR number that corresponds to the branch, which we do by searching the GH API
38+
# The workflow_run event includes a list of pull requests, but it doesn't get populated for
39+
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
40+
script: |
41+
const [owner, repo] = "${{ github.repository }}".split("/");
42+
const response = await github.rest.pulls.list({
43+
head: "${{ inputs.owner }}:${{ inputs.branch }}",
44+
owner,
45+
repo,
46+
});
47+
return response.data[0];
5648
outputs:
57-
pr_id: ${{ steps.details.outputs.prnumber }}
58-
head_branch: ${{ steps.details.outputs.headref }}
59-
base_branch: ${{ steps.details.outputs.baseref }}
49+
result: ${{ steps.details.outputs.result }}

.github/workflows/pull_request.yaml

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: Pull Request
22
on:
33
pull_request_target:
44
types: [ opened, edited, labeled, unlabeled, synchronize ]
5-
concurrency:
6-
group: ${{ github.workflow }}-${{ github.ref }}
7-
cancel-in-progress: true
5+
concurrency: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
86
jobs:
97
changelog:
108
name: Preview Changelog
@@ -21,7 +19,7 @@ jobs:
2119
permissions:
2220
pull-requests: read
2321
steps:
24-
- uses: yogevbd/enforce-label-action@2.1.0
22+
- uses: yogevbd/enforce-label-action@2.2.2
2523
with:
2624
REQUIRED_LABELS_ANY: "T-Defect,T-Deprecation,T-Enhancement,T-Task"
2725
BANNED_LABELS: "X-Blocked"

.github/workflows/sonarcloud.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Must only be called from a workflow_run in the context of the upstream repo
12
name: SonarCloud
23
on:
34
workflow_call:
@@ -35,13 +36,6 @@ on:
3536
type: string
3637
required: false
3738
description: The base branch of the PR if this workflow is being triggered due to one
38-
39-
# Org specific parameters
40-
main_branch:
41-
type: string
42-
required: false
43-
description: The default branch of the repository
44-
default: "develop"
4539
secrets:
4640
SONAR_TOKEN:
4741
required: true
@@ -57,13 +51,20 @@ jobs:
5751
ref: ${{ inputs.head_branch }} # checkout commit that triggered this workflow
5852
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
5953

60-
# Fetch develop so that Sonar can identify new issues in PR builds
61-
- name: "📕 Fetch ${{ inputs.main_branch }}"
62-
if: inputs.head_branch != inputs.main_branch
63-
run: git rev-parse HEAD && git fetch origin ${{ inputs.main_branch }}:${{ inputs.main_branch }} && git status && git rev-parse HEAD
54+
# Fetch base branch from the upstream repo so that Sonar can identify new code in PR builds
55+
- name: "📕 Fetch upstream base branch"
56+
# workflow_call retains the github context of the caller, so `repository` will be upstream always due
57+
# to it running on `workflow_run` which is called from the context of the target repo and not the fork.
58+
if: inputs.base_branch
59+
run: |
60+
git remote add upstream https://github.com/${{ github.repository }}
61+
git rev-parse HEAD
62+
git fetch upstream ${{ inputs.base_branch }}:${{ inputs.base_branch }}
63+
git status
64+
git rev-parse HEAD
6465
6566
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
66-
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
67+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this alternative:
6768
- name: "📥 Download Coverage Report"
6869
uses: dawidd6/action-download-artifact@v2
6970
if: inputs.coverage_workflow_name

.github/workflows/sonarqube.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types:
66
- completed
77
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
8+
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
99
cancel-in-progress: true
1010
jobs:
1111
prdetails:

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: "yarn build"
2727

2828
- name: Run tests with coverage
29-
run: "yarn coverage --ci"
29+
run: "yarn coverage --ci --reporters github-actions"
3030

3131
- name: Upload Artifact
3232
uses: actions/upload-artifact@v2

.istanbul.yml

-2
This file was deleted.

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
Changes in [18.1.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v18.1.0) (2022-06-07)
2+
==================================================================================================
3+
4+
## ✨ Features
5+
* Convert `getLocalAliases` to a stable API call ([\#2402](https://github.com/matrix-org/matrix-js-sdk/pull/2402)).
6+
7+
## 🐛 Bug Fixes
8+
* Fix request, crypto, and bs58 imports ([\#2414](https://github.com/matrix-org/matrix-js-sdk/pull/2414)). Fixes #2415.
9+
* Update relations after every decryption attempt ([\#2387](https://github.com/matrix-org/matrix-js-sdk/pull/2387)). Fixes vector-im/element-web#22258. Contributed by @weeman1337.
10+
* Fix degraded mode for the IDBStore and test it ([\#2400](https://github.com/matrix-org/matrix-js-sdk/pull/2400)). Fixes matrix-org/element-web-rageshakes#13170.
11+
* Don't cancel SAS verifications if `ready` is received after `start` ([\#2250](https://github.com/matrix-org/matrix-js-sdk/pull/2250)).
12+
* Prevent overlapping sync accumulator persists ([\#2392](https://github.com/matrix-org/matrix-js-sdk/pull/2392)). Fixes vector-im/element-web#21541.
13+
* Fix behaviour of isRelation with relation m.replace for state events ([\#2389](https://github.com/matrix-org/matrix-js-sdk/pull/2389)). Fixes vector-im/element-web#22280.
14+
* Fixes #2384 ([\#2385](https://github.com/matrix-org/matrix-js-sdk/pull/2385)). Fixes undefined/matrix-js-sdk#2384. Contributed by @schmop.
15+
* Ensure rooms are recalculated on re-invites ([\#2374](https://github.com/matrix-org/matrix-js-sdk/pull/2374)). Fixes vector-im/element-web#22106.
16+
117
Changes in [18.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v18.0.0) (2022-05-24)
218
==================================================================================================
319

CONTRIBUTING.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ Merge Strategy
249249

250250
The preferred method for merging pull requests is squash merging to keep the
251251
commit history trim, but it is up to the discretion of the team member merging
252-
the change. When stacking pull requests, you may wish to do the following:
252+
the change. We do not support rebase merges due to `allchange` being unable to
253+
handle them. When merging make sure to leave the default commit title, or
254+
at least leave the PR number at the end in brackets like by default.
255+
When stacking pull requests, you may wish to do the following:
253256

254257
1. Branch from develop to your branch (branch1), push commits onto it and open a pull request
255258
2. Branch from your base branch (branch1) to your work branch (branch2), push commits and open a pull request configuring the base to be branch1, saying in the description that it is based on your other PR.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "18.0.0",
3+
"version": "18.1.0",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"engines": {
66
"node": ">=12.9.0"
@@ -81,24 +81,24 @@
8181
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.8.tgz",
8282
"@types/bs58": "^4.0.1",
8383
"@types/content-type": "^1.1.5",
84-
"@types/jest": "^26.0.20",
84+
"@types/jest": "^27.0.0",
8585
"@types/node": "12",
8686
"@types/request": "^2.48.5",
8787
"@typescript-eslint/eslint-plugin": "^5.6.0",
8888
"@typescript-eslint/parser": "^5.6.0",
8989
"allchange": "^1.0.6",
90-
"babel-jest": "^26.6.3",
90+
"babel-jest": "^28.0.0",
9191
"babelify": "^10.0.0",
9292
"better-docs": "^2.4.0-beta.9",
9393
"browserify": "^17.0.0",
9494
"docdash": "^1.2.0",
95-
"eslint": "8.9.0",
95+
"eslint": "8.16.0",
9696
"eslint-config-google": "^0.14.0",
9797
"eslint-plugin-import": "^2.25.4",
98-
"eslint-plugin-matrix-org": "^0.4.0",
98+
"eslint-plugin-matrix-org": "^0.5.0",
9999
"exorcist": "^1.0.1",
100100
"fake-indexeddb": "^3.1.2",
101-
"jest": "^26.6.3",
101+
"jest": "^28.0.0",
102102
"jest-localstorage-mock": "^2.4.6",
103103
"jest-sonar-reporter": "^2.0.0",
104104
"jsdoc": "^3.6.6",

release.sh

+1-22
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ fi
2929
npm --version > /dev/null || (echo "npm is required: please install it"; kill $$)
3030
yarn --version > /dev/null || (echo "yarn is required: please install it"; kill $$)
3131

32-
USAGE="$0 [-xz] [-c changelog_file] vX.Y.Z"
32+
USAGE="$0 [-x] [-c changelog_file] vX.Y.Z"
3333

3434
help() {
3535
cat <<EOF
3636
$USAGE
3737
3838
-c changelog_file: specify name of file containing changelog
3939
-x: skip updating the changelog
40-
-z: skip generating the jsdoc
4140
-n: skip publish to NPM
4241
EOF
4342
}
@@ -60,7 +59,6 @@ if ! git diff-files --quiet; then
6059
fi
6160

6261
skip_changelog=
63-
skip_jsdoc=
6462
skip_npm=
6563
changelog_file="CHANGELOG.md"
6664
expected_npm_user="matrixdotorg"
@@ -76,9 +74,6 @@ while getopts hc:u:xzn f; do
7674
x)
7775
skip_changelog=1
7876
;;
79-
z)
80-
skip_jsdoc=1
81-
;;
8277
n)
8378
skip_npm=1
8479
;;
@@ -326,22 +321,6 @@ if [ -z "$skip_npm" ]; then
326321
fi
327322
fi
328323

329-
if [ -z "$skip_jsdoc" ]; then
330-
echo "generating jsdocs"
331-
yarn gendoc
332-
333-
echo "copying jsdocs to gh-pages branch"
334-
git checkout gh-pages
335-
git pull
336-
cp -a ".jsdoc/matrix-js-sdk/$release" .
337-
perl -i -pe 'BEGIN {$rel=shift} $_ =~ /^<\/ul>/ && print
338-
"<li><a href=\"${rel}/index.html\">Version ${rel}</a></li>\n"' \
339-
$release index.html
340-
git add "$release"
341-
git commit --no-verify -m "Add jsdoc for $release" index.html "$release"
342-
git push origin gh-pages
343-
fi
344-
345324
# if it is a pre-release, leave it on the release branch for now.
346325
if [ $prerelease -eq 1 ]; then
347326
git checkout "$rel_branch"

renovate.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": [
3+
"config:base",
4+
":dependencyDashboardApproval"
5+
],
6+
"labels": ["T-Task", "Dependencies"],
7+
"lockFileMaintenance": { "enabled": true },
8+
"groupName": "all",
9+
"packageRules": [{
10+
"matchFiles": ["package.json"],
11+
"rangeStrategy": "update-lockfile"
12+
}]
13+
}

0 commit comments

Comments
 (0)