From 2880083cbb893f805841eb33ee703ffb06c133f5 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 18 Nov 2020 15:59:28 +0000 Subject: [PATCH 1/8] Upgrade matrix-js-sdk to 9.2.0-rc.1 --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a015728256..6ac2daddcd 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "9.2.0-rc.1", "matrix-widget-api": "^0.1.0-beta.8", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 3c163b7c2f..a2e47e5daa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6505,9 +6505,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": - version "9.1.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/5ac00e346593f29f324b3af8e322928a6e1c427a" +matrix-js-sdk@9.2.0-rc.1: + version "9.2.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.2.0-rc.1.tgz#db0750259170a79c5f51b9b5fc6949f8521a1926" + integrity sha512-cDbY8fSZQEaDU6m1V8MpZtr69sd4iWw/SshNDpQMsd4llCVhMA10EC0RrETfFRerSI+SEn9sdhjQaa4wEPCy9w== dependencies: "@babel/runtime" "^7.11.2" another-json "^0.2.0" From 19656c7eb848d3c4e17eff9a46d41418659206c9 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 18 Nov 2020 16:27:03 +0000 Subject: [PATCH 2/8] Prepare changelog for v3.9.0-rc.1 --- CHANGELOG.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13c5ba81ed..9d0b90bbce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,65 @@ +Changes in [3.9.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.9.0-rc.1) (2020-11-18) +============================================================================================================= +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.8.0...v3.9.0-rc.1) + + * Upgrade JS SDK to 9.2.0-rc.1 + * Translations update from Weblate + [\#5429](https://github.com/matrix-org/matrix-react-sdk/pull/5429) + * Fix message search summary text + [\#5428](https://github.com/matrix-org/matrix-react-sdk/pull/5428) + * Shrink new room intro top margin to half for encryption bubble tile + [\#5427](https://github.com/matrix-org/matrix-react-sdk/pull/5427) + * Small delight tweaks to improve rough corners in the app + [\#5418](https://github.com/matrix-org/matrix-react-sdk/pull/5418) + * Fix DM logic to always pick a more reliable DM room + [\#5424](https://github.com/matrix-org/matrix-react-sdk/pull/5424) + * Update styling of the Analytics toast + [\#5408](https://github.com/matrix-org/matrix-react-sdk/pull/5408) + * Fix vertical centering of the Homepage and button layout + [\#5420](https://github.com/matrix-org/matrix-react-sdk/pull/5420) + * Fix BaseAvatar sometimes messing up and duplicating the url + [\#5422](https://github.com/matrix-org/matrix-react-sdk/pull/5422) + * Disable buttons when required by MSC2790 + [\#5412](https://github.com/matrix-org/matrix-react-sdk/pull/5412) + * Fix drag drop file to upload for Safari + [\#5414](https://github.com/matrix-org/matrix-react-sdk/pull/5414) + * Fix poorly i18n'd string + [\#5416](https://github.com/matrix-org/matrix-react-sdk/pull/5416) + * Fix the feedback not closing without feedback/countly + [\#5417](https://github.com/matrix-org/matrix-react-sdk/pull/5417) + * Fix New Room Intro invite to this room button + [\#5419](https://github.com/matrix-org/matrix-react-sdk/pull/5419) + * Change how we expose Role in User Info and hide in DMs + [\#5413](https://github.com/matrix-org/matrix-react-sdk/pull/5413) + * Disallow sending of empty messages + [\#5390](https://github.com/matrix-org/matrix-react-sdk/pull/5390) + * hide some validation tooltips if fields are valid. + [\#5403](https://github.com/matrix-org/matrix-react-sdk/pull/5403) + * Improvements around new room empty space interactions + [\#5398](https://github.com/matrix-org/matrix-react-sdk/pull/5398) + * Implement call hold + [\#5366](https://github.com/matrix-org/matrix-react-sdk/pull/5366) + * Fix Skeleton UI showing up when not intended. + [\#5407](https://github.com/matrix-org/matrix-react-sdk/pull/5407) + * Close context menu when user clicks the Home button + [\#5406](https://github.com/matrix-org/matrix-react-sdk/pull/5406) + * Skip e2ee warn logout prompt if user has no megolm sessions to lose + [\#5410](https://github.com/matrix-org/matrix-react-sdk/pull/5410) + * Allow country names to be translated + [\#5405](https://github.com/matrix-org/matrix-react-sdk/pull/5405) + * Support thirdparty lookup for phone numbers + [\#5396](https://github.com/matrix-org/matrix-react-sdk/pull/5396) + * Change "Password" to "New Password" + [\#5371](https://github.com/matrix-org/matrix-react-sdk/pull/5371) + * Add customisation point for dehydration key + [\#5397](https://github.com/matrix-org/matrix-react-sdk/pull/5397) + * Rebrand Riot -> Element in the permalink classes + [\#5386](https://github.com/matrix-org/matrix-react-sdk/pull/5386) + * Invite / Create DM UX tweaks + [\#5387](https://github.com/matrix-org/matrix-react-sdk/pull/5387) + * Tweaks to toasts and post-registration landing + [\#5383](https://github.com/matrix-org/matrix-react-sdk/pull/5383) + Changes in [3.8.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.8.0) (2020-11-09) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.8.0-rc.1...v3.8.0) From e85ca929042e9d74afb7174b16f3a5690ad516c9 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 18 Nov 2020 16:27:04 +0000 Subject: [PATCH 3/8] v3.9.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ac2daddcd..e46ed17316 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.8.0", + "version": "3.9.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From b3e8a6df800d01dfec2f85d18b864386f6a55477 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 18 Nov 2020 17:41:54 +0000 Subject: [PATCH 4/8] Tweak video component code style --- src/components/views/messages/MVideoBody.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index fb987a4f0d..671633be9e 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -71,7 +71,7 @@ export default class MVideoBody extends React.PureComponent { } } - _getContentUrl(): string|null { + private getContentUrl(): string|null { const content = this.props.mxEvent.getContent(); if (content.file !== undefined) { return this.state.decryptedUrl; @@ -80,7 +80,7 @@ export default class MVideoBody extends React.PureComponent { } } - _getThumbUrl(): string|null { + private getThumbUrl(): string|null { const content = this.props.mxEvent.getContent(); if (content.file !== undefined) { return this.state.decryptedThumbnailUrl; @@ -142,8 +142,8 @@ export default class MVideoBody extends React.PureComponent { } } - async _videoOnPlay() { - if (this._getContentUrl() || this.state.fetchingData || this.state.error) { + private videoOnPlay = async () => { + if (this.getContentUrl() || this.state.fetchingData || this.state.error) { // We have the file, we are fetching the file, or there is an error. return; } @@ -195,8 +195,8 @@ export default class MVideoBody extends React.PureComponent { ); } - const contentUrl = this._getContentUrl(); - const thumbUrl = this._getThumbUrl(); + const contentUrl = this.getContentUrl(); + const thumbUrl = this.getThumbUrl(); let height = null; let width = null; let poster = null; @@ -217,7 +217,7 @@ export default class MVideoBody extends React.PureComponent { From d36618dc86479754459e2cb967d20ce2b4e8d5cb Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 19 Nov 2020 13:26:14 +0000 Subject: [PATCH 5/8] Fix encrypted video playback in Chrome-based browsers For Chrome-based browsers, it seems we need to set some non-empty `src` URI for the video element's play button to be enabled, so this crafts an empty `data` URI and ensures playing is triggered once the real content has been fetched. Fixes https://github.com/vector-im/element-web/issues/15694 Regressed by https://github.com/matrix-org/matrix-react-sdk/pull/5352 --- src/components/views/messages/MVideoBody.tsx | 34 +++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index 671633be9e..9628f11809 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -39,6 +39,8 @@ interface IState { } export default class MVideoBody extends React.PureComponent { + private videoRef = React.createRef(); + constructor(props) { super(props); this.state = { @@ -80,6 +82,11 @@ export default class MVideoBody extends React.PureComponent { } } + private hasContentUrl(): boolean { + const url = this.getContentUrl(); + return url && !url.startsWith("data:"); + } + private getThumbUrl(): string|null { const content = this.props.mxEvent.getContent(); if (content.file !== undefined) { @@ -118,7 +125,10 @@ export default class MVideoBody extends React.PureComponent { } else { console.log("NOT preloading video"); this.setState({ - decryptedUrl: null, + // For Chrome and Electron, we need to set some non-empty `src` to + // enable the play button. Firefox does not seem to care either + // way, so it's fine to do for all browsers. + decryptedUrl: `data:${content?.info?.mimetype},`, decryptedThumbnailUrl: thumbnailUrl, decryptedBlob: null, }); @@ -143,7 +153,7 @@ export default class MVideoBody extends React.PureComponent { } private videoOnPlay = async () => { - if (this.getContentUrl() || this.state.fetchingData || this.state.error) { + if (this.hasContentUrl() || this.state.fetchingData || this.state.error) { // We have the file, we are fetching the file, or there is an error. return; } @@ -164,6 +174,9 @@ export default class MVideoBody extends React.PureComponent { decryptedUrl: contentUrl, decryptedBlob: decryptedBlob, fetchingData: false, + }, () => { + if (!this.videoRef.current) return; + this.videoRef.current.play(); }); this.props.onHeightChanged(); } @@ -215,9 +228,20 @@ export default class MVideoBody extends React.PureComponent { } return ( - From be25a0e4329813b20eb522541ff0e06bf7bcce7e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 23 Nov 2020 16:29:44 +0000 Subject: [PATCH 6/8] Upgrade matrix-js-sdk to 9.2.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e46ed17316..6067bbfb0f 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.19", - "matrix-js-sdk": "9.2.0-rc.1", + "matrix-js-sdk": "9.2.0", "matrix-widget-api": "^0.1.0-beta.8", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index a2e47e5daa..b8b3dea93e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6505,10 +6505,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@9.2.0-rc.1: - version "9.2.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.2.0-rc.1.tgz#db0750259170a79c5f51b9b5fc6949f8521a1926" - integrity sha512-cDbY8fSZQEaDU6m1V8MpZtr69sd4iWw/SshNDpQMsd4llCVhMA10EC0RrETfFRerSI+SEn9sdhjQaa4wEPCy9w== +matrix-js-sdk@9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-9.2.0.tgz#4b01dbb170266c4fe37be9397065d870561ad220" + integrity sha512-3lPgCB2in+AHDd+tLT8HbJ9elqDeJjYCE8i8Ti+NO2Myua62HIsf3pE/C/FE/QCDTuZBTjN0vgjym22M+GO65g== dependencies: "@babel/runtime" "^7.11.2" another-json "^0.2.0" From 6fbc3591755034a74e20f9e73936c2c544a3c8ce Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 23 Nov 2020 16:35:15 +0000 Subject: [PATCH 7/8] Prepare changelog for v3.9.0 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d0b90bbce..5aac4e2974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in [3.9.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.9.0) (2020-11-23) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.9.0-rc.1...v3.9.0) + + * Upgrade JS SDK to 9.2.0 + * [Release] Fix encrypted video playback in Chrome-based browsers + [\#5431](https://github.com/matrix-org/matrix-react-sdk/pull/5431) + Changes in [3.9.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.9.0-rc.1) (2020-11-18) ============================================================================================================= [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.8.0...v3.9.0-rc.1) From 5ca18590afcafeaa606a862f41e128da62e5f325 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 23 Nov 2020 16:35:16 +0000 Subject: [PATCH 8/8] v3.9.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6067bbfb0f..c2160650fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.9.0-rc.1", + "version": "3.9.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {