Skip to content

Commit

Permalink
Merge tag 'v1.11.5' into sc
Browse files Browse the repository at this point in the history
* Device manager - hide unverified security recommendation when only current session is unverified ([\#9228](matrix-org/matrix-react-sdk#9228)). Contributed by @kerryarchibald.
* Device manager - scroll to filtered list from security recommendations ([\#9227](matrix-org/matrix-react-sdk#9227)). Contributed by @kerryarchibald.
* Device manager - updated dropdown style in filtered device list ([\#9226](matrix-org/matrix-react-sdk#9226)). Contributed by @kerryarchibald.
* Device manager - device type and verification icons on device tile ([\#9197](matrix-org/matrix-react-sdk#9197)). Contributed by @kerryarchibald.
* Description of DM room with more than two other people is now being displayed correctly ([\#9231](matrix-org/matrix-react-sdk#9231)). Fixes element-hq/element-web#23094.
* Fix voice messages with multiple composers ([\#9208](matrix-org/matrix-react-sdk#9208)). Fixes element-hq/element-web#23023. Contributed by @grimhilt.
* Fix suggested rooms going missing ([\#9236](matrix-org/matrix-react-sdk#9236)). Fixes element-hq/element-web#23190.
* Fix tooltip infinitely recursing ([\#9235](matrix-org/matrix-react-sdk#9235)). Fixes matrix-org/element-web-rageshakes#15107, matrix-org/element-web-rageshakes#15093 matrix-org/element-web-rageshakes#15092 and matrix-org/element-web-rageshakes#15077.
* Fix plain text export saving ([\#9230](matrix-org/matrix-react-sdk#9230)). Contributed by @jryans.
* Add missing space in SecurityRoomSettingsTab ([\#9222](matrix-org/matrix-react-sdk#9222)). Contributed by @gefgu.
* Make use of js-sdk roomNameGenerator to handle i18n for generated room names ([\#9209](matrix-org/matrix-react-sdk#9209)). Fixes element-hq/element-web#21369.
* Fix progress bar regression throughout the app ([\#9219](matrix-org/matrix-react-sdk#9219)). Fixes element-hq/element-web#23121.
* Reuse empty string & space string logic for event types in devtools ([\#9218](matrix-org/matrix-react-sdk#9218)). Fixes element-hq/element-web#23115.
  • Loading branch information
su-ex committed Sep 15, 2022
2 parents 9583025 + c4cbc54 commit 57d2087
Show file tree
Hide file tree
Showing 10 changed files with 2,605 additions and 291 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled
branches:
- develop

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
labels_template: "<%= JSON.stringify(labels) %>"
# We can't use GITHUB_TOKEN here or CI won't run on the new PR
github_token: ${{ secrets.ELEMENT_BOT_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,38 @@ jobs:

- name: Run Linter
run: "yarn run lint:js"

tsc-strict:
name: Typescript Strict Error Checker
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: read
checks: write
steps:
- uses: actions/checkout@v3

- name: Get diff lines
id: diff
uses: Equip-Collaboration/diff-line-numbers@v1.0.0
with:
include: '["\\.tsx?$"]'

- name: Detecting files changed
id: files
uses: futuratrepadeira/changed-files@v3.2.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pattern: '^.*\.tsx?$'

- uses: t3chguy/typescript-check-action@main
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
use-check: false
check-fail-mode: added
output-behaviour: annotate
ts-extra-args: '--strict'
files-changed: ${{ steps.files.outputs.files_updated }}
files-added: ${{ steps.files.outputs.files_created }}
files-deleted: ${{ steps.files.outputs.files_deleted }}
line-numbers: ${{ steps.diff.outputs.lineNumbers }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
.vscode
.vscode/
.DS_Store
/test_artifacts/
/coverage/
34 changes: 32 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
Changes in [1.11.5](https://github.com/vector-im/element-desktop/releases/tag/v1.11.5) (2022-09-13)
===================================================================================================

## ✨ Features
* Device manager - hide unverified security recommendation when only current session is unverified ([\#9228](https://github.com/matrix-org/matrix-react-sdk/pull/9228)). Contributed by @kerryarchibald.
* Device manager - scroll to filtered list from security recommendations ([\#9227](https://github.com/matrix-org/matrix-react-sdk/pull/9227)). Contributed by @kerryarchibald.
* Device manager - updated dropdown style in filtered device list ([\#9226](https://github.com/matrix-org/matrix-react-sdk/pull/9226)). Contributed by @kerryarchibald.
* Device manager - device type and verification icons on device tile ([\#9197](https://github.com/matrix-org/matrix-react-sdk/pull/9197)). Contributed by @kerryarchibald.

## 🐛 Bug Fixes
* Description of DM room with more than two other people is now being displayed correctly ([\#9231](https://github.com/matrix-org/matrix-react-sdk/pull/9231)). Fixes vector-im/element-web#23094.
* Fix voice messages with multiple composers ([\#9208](https://github.com/matrix-org/matrix-react-sdk/pull/9208)). Fixes vector-im/element-web#23023. Contributed by @grimhilt.
* Fix suggested rooms going missing ([\#9236](https://github.com/matrix-org/matrix-react-sdk/pull/9236)). Fixes vector-im/element-web#23190.
* Fix tooltip infinitely recursing ([\#9235](https://github.com/matrix-org/matrix-react-sdk/pull/9235)). Fixes matrix-org/element-web-rageshakes#15107, matrix-org/element-web-rageshakes#15093 matrix-org/element-web-rageshakes#15092 and matrix-org/element-web-rageshakes#15077.
* Fix plain text export saving ([\#9230](https://github.com/matrix-org/matrix-react-sdk/pull/9230)). Contributed by @jryans.
* Add missing space in SecurityRoomSettingsTab ([\#9222](https://github.com/matrix-org/matrix-react-sdk/pull/9222)). Contributed by @gefgu.
* Make use of js-sdk roomNameGenerator to handle i18n for generated room names ([\#9209](https://github.com/matrix-org/matrix-react-sdk/pull/9209)). Fixes vector-im/element-web#21369.
* Fix progress bar regression throughout the app ([\#9219](https://github.com/matrix-org/matrix-react-sdk/pull/9219)). Fixes vector-im/element-web#23121.
* Reuse empty string & space string logic for event types in devtools ([\#9218](https://github.com/matrix-org/matrix-react-sdk/pull/9218)). Fixes vector-im/element-web#23115.

Changes in [1.11.4](https://github.com/vector-im/element-desktop/releases/tag/v1.11.4) (2022-08-31)
===================================================================================================

## 🔒 Security
* Fixes for [CVE-2022-36059](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE%2D2022%2D36059) and [CVE-2022-36060](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE%2D2022%2D36060)

Learn more about what we've been up to at https://element.io/blog/element-web-desktop-1-11-4-a-security-update-deferred-dms-and-more/
Find more details of the vulnerabilities at https://matrix.org/blog/2022/08/31/security-releases-matrix-js-sdk-19-4-0-and-matrix-react-sdk-3-53-0

## ✨ Features
* Upgrade to Electron 20 ([\#403](https://github.com/vector-im/element-desktop/pull/403)).
* Device manager - scroll to filtered list from security recommendations ([\#9227](https://github.com/matrix-org/matrix-react-sdk/pull/9227)). Contributed by @kerryarchibald.
Expand Down Expand Up @@ -1147,8 +1173,12 @@ Changes in [1.9.8](https://github.com/vector-im/element-desktop/releases/tag/v1.
Changes in [1.9.7](https://github.com/vector-im/element-desktop/releases/tag/v1.9.7) (2021-12-13)
=================================================================================================

* Security release with updated version of Olm to fix https://matrix.org/blog/2021/12/03/pre-disclosure-upcoming-security-release-of-libolm-and-matrix-js-sdk
* Fix a crash on logout
## 🔒 SECURITY FIXES
* Security release with updated version of Olm to fix https://matrix.org/blog/2021/12/03/pre-disclosure-upcoming-security-release-of-libolm-and-matrix-js-sdk
* Upgrade Electron to 13.5.2 to fix https://matrix.org/blog/2022/01/31/high-severity-vulnerability-in-element-desktop-1-9-6-and-earlier (https://github.com/vector-im/element-desktop/security/advisories/GHSA-mjrg-9f8r-h3m7)

## 🐛 Bug Fixes
* Fix a crash on logout

Changes in [1.9.6](https://github.com/vector-im/element-desktop/releases/tag/v1.9.6) (2021-12-06)
=================================================================================================
Expand Down
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
7 changes: 2 additions & 5 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/bin/bash
#
# Script to perform a release of element-desktop.
#
# Requires githib-changelog-generator; to install, do
# pip install git+https://github.com/matrix-org/github-changelog-generator.git

set -e

cd `dirname $0`
cd "$(dirname "$0")"

./node_modules/matrix-js-sdk/release.sh -n "$@"
./node_modules/matrix-js-sdk/release.sh "$@"
99 changes: 21 additions & 78 deletions scripts/fetch-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,9 @@ const { setPackageVersion } = require('./set-version.js');

const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
const PACKAGE_URL_PREFIX = "https://github.com/vector-im/element-web/releases/download/";
const DEVELOP_TGZ_URL = "https://vector-im.github.io/element-web/develop.tar.gz";
const ASAR_PATH = 'webapp.asar';

async function getLatestDevelopUrl(bkToken) {
const buildsResult = await needle('get',
"https://api.buildkite.com/v2/organizations/matrix-dot-org/pipelines/element-web/builds",
{
branch: 'develop',
state: 'passed',
per_page: 1,
},
{
headers: {
authorization: "Bearer " + bkToken,
},
},
);
const latestBuild = buildsResult.body[0];
console.log("Latest build is " + latestBuild.number);
let artifactUrl;
for (const job of latestBuild.jobs) {
// Strip any colon-form emoji from the build name
if (job.name && job.name.replace(/:\w*:\s*/, '') === 'Package') {
artifactUrl = job.artifacts_url;
break;
}
}
if (artifactUrl === undefined) {
throw new Error("Couldn't find artifact URL - has the name of the package job changed?");
}

const artifactsResult = await needle('get', artifactUrl, {},
{
headers: {
authorization: "Bearer " + bkToken,
},
},
);
let dlUrl;
let dlFilename;
for (const artifact of artifactsResult.body) {
if (artifact.filename && /^element-.*\.tar.gz$/.test(artifact.filename)) {
dlUrl = artifact.download_url;
dlFilename = artifact.filename;
break;
}
}
if (dlUrl === undefined) {
throw new Error("Couldn't find artifact download URL - has the artifact filename changed?");
}
console.log("Fetching artifact URL...");
const dlResult = await needle('get', dlUrl, {},
{
headers: {
authorization: "Bearer " + bkToken,
},
// This URL will give us a Location header, but will also give us
// a JSON object with the direct URL. We'll take the URL and pass it
// back, then we can easily support specifying a URL directly.
follow_max: 0,
},
);
return [dlFilename, dlResult.body.url];
}

async function downloadToFile(url, filename) {
console.log("Downloading " + url + "...");

Expand Down Expand Up @@ -150,24 +89,17 @@ async function main() {
if (sc) {
} else if (targetVersion === undefined) {
targetVersion = 'v' + riotDesktopPackageJson.version;
filename = 'element-' + targetVersion + '.tar.gz';
url = PACKAGE_URL_PREFIX + targetVersion + '/' + filename;
} else if (targetVersion === 'develop') {
const buildKiteApiKey = process.env.BUILDKITE_API_KEY;
if (buildKiteApiKey === undefined) {
console.log("Set BUILDKITE_API_KEY to fetch latest develop version");
console.log(
"Sorry - Buildkite's API requires authentication to access builds, " +
"even if those builds are accessible on the web with no auth.",
);
process.exit(1);
}
[filename, url] = await getLatestDevelopUrl(buildKiteApiKey);
} else if (targetVersion !== 'develop') {
setVersion = true; // version was specified
}

if (targetVersion === 'develop') {
filename = 'develop.tar.gz';
url = DEVELOP_TGZ_URL;
verify = false; // develop builds aren't signed
} else {
filename = 'element-' + targetVersion + '.tar.gz';
url = PACKAGE_URL_PREFIX + targetVersion + '/' + filename;
setVersion = true;
}

const haveGpg = await new Promise((resolve) => {
Expand Down Expand Up @@ -209,7 +141,7 @@ async function main() {
}

let haveDeploy = false;
const expectedDeployDir = sc ? "../element-web/webapp" : path.join(deployDir, path.basename(filename).replace(/\.tar\.gz/, ''));
let expectedDeployDir = sc ? "../element-web/webapp" : path.join(deployDir, path.basename(filename).replace(/\.tar\.gz/, ''));
try {
await fs.opendirSync(expectedDeployDir);
console.log(expectedDeployDir + "already exists");
Expand Down Expand Up @@ -260,6 +192,12 @@ async function main() {
await tar.x({
file: outPath,
cwd: deployDir,
onentry: entry => {
// Find the appropriate extraction path, only needed for `develop` where the dir name is unknown
if (entry.type === "Directory" && !path.join(deployDir, entry.path).startsWith(expectedDeployDir)) {
expectedDeployDir = path.join(deployDir, entry.path);
}
},
});
}

Expand Down Expand Up @@ -291,4 +229,9 @@ async function main() {
console.log("Done!");
}

main().then((ret) => process.exit(ret)).catch(e => process.exit(1));
main().then((ret) => {
process.exit(ret);
}).catch(e => {
console.error(e);
process.exit(1);
});
64 changes: 64 additions & 0 deletions test/launch-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import * as os from "os";
import * as fs from "fs";
import * as path from "path";
import "expect-playwright";
import { _electron as electron } from "playwright";
import { ElectronApplication, Page } from "playwright-core";

describe("App launch", () => {
const artifactsPath = path.join(process.cwd(), "test_artifacts");
fs.mkdirSync(artifactsPath);

const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "element-desktop-tests"));
console.log("Using temp profile directory: ", tmpDir);

let app: ElectronApplication;
let window: Page;

beforeAll(async () => {
const args = ["--profile-dir", tmpDir];

const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
if (!executablePath) {
// Unpackaged mode testing
args.unshift("./lib/electron-main.js");
}

app = await electron.launch({
executablePath,
args,
recordVideo: {
dir: artifactsPath,
}
});
window = await app.firstWindow();
});

afterAll(async () => {
await app?.close();
fs.rmSync(tmpDir, { recursive: true });
});

it("should launch and render the welcome view successfully", async () => {
await window.locator("#matrixchat").waitFor();
await window.locator(".mx_Welcome").waitFor();
await expect(window).toMatchURL("vector://vector/webapp/#/welcome");
await window.screenshot({ path: path.join(artifactsPath, "welcome.png") });
}, 30000);
});
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"lib": [
"es2019",
"dom"
]
],
"types": ["jest", "node"],
},
"include": [
"./src/**/*.ts"
"./src/**/*.ts",
"./tests/**/*.ts"
]
}
Loading

0 comments on commit 57d2087

Please sign in to comment.