From 2fd9b9b3b9d5237737d85952363c7882b6d16f56 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 7 Oct 2020 14:23:52 +0100 Subject: [PATCH 1/9] Upgrade matrix-js-sdk to 8.5.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 e66d0aabcf..e5ecacd387 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": "8.5.0-rc.1", "matrix-widget-api": "^0.1.0-beta.2", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 51ff681783..a2c5cd6645 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5926,9 +5926,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 "8.4.1" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/a9a6b2de48250440dc2a1c3eee630f4957fb9f83" +matrix-js-sdk@8.5.0-rc.1: + version "8.5.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.5.0-rc.1.tgz#7ad34d8b6a786a7d4a04173e3b17da56022cd62a" + integrity sha512-hVFYkN3/rsPiNXdFqcvRvg+Egr75qhPGMi2gp59PDr7JrZEtOACA0I3NCY1vPub9kXGTtPZqPuHGFrsF9qLXGw== dependencies: "@babel/runtime" "^7.11.2" another-json "^0.2.0" From ffd7cddd0d9cbbc91eb47ab8e2d7f1d892ae3264 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 7 Oct 2020 14:30:51 +0100 Subject: [PATCH 2/9] Prepare changelog for v3.6.0-rc.1 --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a7ddc407..98a4a1ff87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,91 @@ +Changes in [3.6.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.6.0-rc.1) (2020-10-07) +============================================================================================================= +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.5.0...v3.6.0-rc.1) + + * Upgrade JS SDK to 8.5.0-rc.1 + * Update from Weblate + [\#5297](https://github.com/matrix-org/matrix-react-sdk/pull/5297) + * Fix edited replies being wrongly treated as big emoji + [\#5295](https://github.com/matrix-org/matrix-react-sdk/pull/5295) + * Fix StopGapWidget infinitely recursing + [\#5294](https://github.com/matrix-org/matrix-react-sdk/pull/5294) + * Fix editing and redactions not updating the Reply Thread + [\#5281](https://github.com/matrix-org/matrix-react-sdk/pull/5281) + * Hide Jump to Read Receipt button for users who have not yet sent an RR + [\#5282](https://github.com/matrix-org/matrix-react-sdk/pull/5282) + * fix img tags not always being rendered correctly + [\#5279](https://github.com/matrix-org/matrix-react-sdk/pull/5279) + * Hopefully fix righhtpanel crash + [\#5293](https://github.com/matrix-org/matrix-react-sdk/pull/5293) + * Fix naive pinning limit and app tile widgetMessaging NPE + [\#5283](https://github.com/matrix-org/matrix-react-sdk/pull/5283) + * Show server errors from saving profile settings + [\#5272](https://github.com/matrix-org/matrix-react-sdk/pull/5272) + * Update copy for `redact` permission + [\#5273](https://github.com/matrix-org/matrix-react-sdk/pull/5273) + * Remove width limit on widgets + [\#5265](https://github.com/matrix-org/matrix-react-sdk/pull/5265) + * Fix call container avatar initial centering + [\#5280](https://github.com/matrix-org/matrix-react-sdk/pull/5280) + * Fix right panel for peeking rooms + [\#5268](https://github.com/matrix-org/matrix-react-sdk/pull/5268) + * Add support for dehydrated devices + [\#5239](https://github.com/matrix-org/matrix-react-sdk/pull/5239) + * Use Own Profile Store for the Profile Settings + [\#5277](https://github.com/matrix-org/matrix-react-sdk/pull/5277) + * null-guard defaultAvatarUrlForString + [\#5270](https://github.com/matrix-org/matrix-react-sdk/pull/5270) + * Choose first result on enter in the emoji picker + [\#5257](https://github.com/matrix-org/matrix-react-sdk/pull/5257) + * Fix room directory clipping links in the room's topic + [\#5276](https://github.com/matrix-org/matrix-react-sdk/pull/5276) + * Decorate failed e2ee downgrade attempts better + [\#5278](https://github.com/matrix-org/matrix-react-sdk/pull/5278) + * MELS use latest avatar rather than the first avatar + [\#5262](https://github.com/matrix-org/matrix-react-sdk/pull/5262) + * Fix Encryption Panel close button clashing with Base Card + [\#5261](https://github.com/matrix-org/matrix-react-sdk/pull/5261) + * Wrap canEncryptToAllUsers in a try/catch to handle server errors + [\#5275](https://github.com/matrix-org/matrix-react-sdk/pull/5275) + * Fix conditional on communities prototype room creation dialog + [\#5274](https://github.com/matrix-org/matrix-react-sdk/pull/5274) + * Fix ensureDmExists for encryption detection + [\#5271](https://github.com/matrix-org/matrix-react-sdk/pull/5271) + * Switch to using the Widget API SDK for widget messaging + [\#5171](https://github.com/matrix-org/matrix-react-sdk/pull/5171) + * Ensure package links exist when releasing + [\#5269](https://github.com/matrix-org/matrix-react-sdk/pull/5269) + * Fix the call preview when not in same room as the call + [\#5267](https://github.com/matrix-org/matrix-react-sdk/pull/5267) + * Make the hangup button do things for conference calls + [\#5223](https://github.com/matrix-org/matrix-react-sdk/pull/5223) + * Render Jitsi widget state events in a more obvious way + [\#5222](https://github.com/matrix-org/matrix-react-sdk/pull/5222) + * Make the PIP Jitsi look and feel like the 1:1 PIP + [\#5226](https://github.com/matrix-org/matrix-react-sdk/pull/5226) + * Trim range when formatting so that it excludes leading/trailing spaces + [\#5263](https://github.com/matrix-org/matrix-react-sdk/pull/5263) + * Fix button label on the Set Password Dialog + [\#5264](https://github.com/matrix-org/matrix-react-sdk/pull/5264) + * fix link to classic yarn's `yarn link` + [\#5259](https://github.com/matrix-org/matrix-react-sdk/pull/5259) + * Fix index mismatch between username colors styles and custom theming + [\#5256](https://github.com/matrix-org/matrix-react-sdk/pull/5256) + * Disable autocompletion on security key input during login + [\#5258](https://github.com/matrix-org/matrix-react-sdk/pull/5258) + * fix uninitialised state and eventlistener leak in RoomUpgradeWarningBar + [\#5255](https://github.com/matrix-org/matrix-react-sdk/pull/5255) + * Only set title when it changes + [\#5254](https://github.com/matrix-org/matrix-react-sdk/pull/5254) + * Convert CallHandler to typescript + [\#5248](https://github.com/matrix-org/matrix-react-sdk/pull/5248) + * Retry loading i18n language if it fails + [\#5209](https://github.com/matrix-org/matrix-react-sdk/pull/5209) + * Rework profile area for user and room settings to be more clear + [\#5243](https://github.com/matrix-org/matrix-react-sdk/pull/5243) + * Validation improve pattern for derived data + [\#5241](https://github.com/matrix-org/matrix-react-sdk/pull/5241) + Changes in [3.5.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.5.0) (2020-09-28) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.5.0-rc.1...v3.5.0) From 4abaa107abcad1bea704ec08a1fcf557aac4b492 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 7 Oct 2020 14:30:51 +0100 Subject: [PATCH 3/9] v3.6.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e5ecacd387..0b371df5fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.5.0", + "version": "3.6.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From fcc411f8b93736d00abeecf1403be2627fda5731 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 8 Oct 2020 15:35:22 -0600 Subject: [PATCH 4/9] Use new preparing event for widget communications Fixes https://github.com/vector-im/element-web/issues/15404 We need to make sure we don't accidentally call the widget before its ready, but we can happily show it once it is loaded/prepared. --- src/components/views/elements/AppTile.js | 7 ++++++- src/stores/widgets/StopGapWidget.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 3405d4ff16..fda2652d12 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -50,6 +50,7 @@ export default class AppTile extends React.Component { // The key used for PersistedElement this._persistKey = 'widget_' + this.props.app.id; this._sgWidget = new StopGapWidget(this.props); + this._sgWidget.on("preparing", this._onWidgetPrepared); this._sgWidget.on("ready", this._onWidgetReady); this.iframe = null; // ref to the iframe (callback style) @@ -142,6 +143,7 @@ export default class AppTile extends React.Component { this._sgWidget.stop(); } this._sgWidget = new StopGapWidget(newProps); + this._sgWidget.on("preparing", this._onWidgetPrepared); this._sgWidget.on("ready", this._onWidgetReady); this._startWidget(); } @@ -295,8 +297,11 @@ export default class AppTile extends React.Component { this._revokeWidgetPermission(); } - _onWidgetReady = () => { + _onWidgetPrepared = () => { this.setState({loading: false}); + }; + + _onWidgetReady = () => { if (WidgetType.JITSI.matches(this.props.app.type)) { this._sgWidget.widgetApi.transport.send(ElementWidgetActions.ClientReady, {}); } diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index 9e4d124d5b..dde756cf3b 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -163,6 +163,7 @@ export class StopGapWidget extends EventEmitter { if (this.started) return; const driver = new StopGapWidgetDriver( this.appTileProps.whitelistCapabilities || []); this.messaging = new ClientWidgetApi(this.mockWidget, iframe, driver); + this.messaging.addEventListener("preparing", () => this.emit("preparing")); this.messaging.addEventListener("ready", () => this.emit("ready")); WidgetMessagingStore.instance.storeMessaging(this.mockWidget, this.messaging); From 2caf679024742efdd21a5d031fe706fd2763b58a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 8 Oct 2020 21:22:17 -0600 Subject: [PATCH 5/9] Update widget-api --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0b371df5fe..532bb1c3e5 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "linkifyjs": "^2.1.9", "lodash": "^4.17.19", "matrix-js-sdk": "8.5.0-rc.1", - "matrix-widget-api": "^0.1.0-beta.2", + "matrix-widget-api": "^0.1.0-beta.3", "minimist": "^1.2.5", "pako": "^1.0.11", "parse5": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index a2c5cd6645..7dc34164d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5954,10 +5954,10 @@ matrix-react-test-utils@^0.2.2: resolved "https://registry.yarnpkg.com/matrix-react-test-utils/-/matrix-react-test-utils-0.2.2.tgz#c87144d3b910c7edc544a6699d13c7c2bf02f853" integrity sha512-49+7gfV6smvBIVbeloql+37IeWMTD+fiywalwCqk8Dnz53zAFjKSltB3rmWHso1uecLtQEcPtCijfhzcLXAxTQ== -matrix-widget-api@^0.1.0-beta.2: - version "0.1.0-beta.2" - resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.2.tgz#367da1ccd26b711f73fc5b6e02edf55ac2ea2692" - integrity sha512-q5g5RZN+RRjM4HmcJ+LYoQAYrB1wzyERmoQ+LvKbTV/+9Ov36Kp0QEP8CleSXEd5WLp6bkRlt60axDaY6pWGmg== +matrix-widget-api@^0.1.0-beta.3: + version "0.1.0-beta.3" + resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.3.tgz#356965ca357172ee056e3fd86fd96879b059a114" + integrity sha512-j7nxdhLQfdU6snsdBA29KQR0DmT8/vl6otOvGqPCV0OCHpq1312cP79Eg4JzJKIFI3A76Qha3nYx6G9/aapwXg== mdast-util-compact@^1.0.0: version "1.0.4" From 3e7f1176111f997029611bf4965b22800d6b9157 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 9 Oct 2020 09:26:52 -0600 Subject: [PATCH 6/9] Fix templating for v1 jitsi widgets Fixes https://github.com/vector-im/element-web/issues/15427 --- src/stores/widgets/StopGapWidget.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index dde756cf3b..1eb4f9cd27 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -19,11 +19,13 @@ import { ClientWidgetApi, IStickerActionRequest, IStickyActionRequest, + ITemplateParams, IWidget, IWidgetApiRequest, IWidgetApiRequestEmptyData, IWidgetData, MatrixCapabilities, + runTemplate, Widget, WidgetApiFromWidgetAction, } from "matrix-widget-api"; @@ -76,15 +78,33 @@ class ElementWidget extends Widget { let conferenceId = super.rawData['conferenceId']; if (conferenceId === undefined) { // we'll need to parse the conference ID out of the URL for v1 Jitsi widgets - const parsedUrl = new URL(this.templateUrl); + const parsedUrl = new URL(super.templateUrl); // use super to get the raw widget URL conferenceId = parsedUrl.searchParams.get("confId"); } + let domain = super.rawData['domain']; + if (domain === undefined) { + // v1 widgets default to jitsi.riot.im regardless of user settings + domain = "jitsi.riot.im"; + } return { ...super.rawData, theme: SettingsStore.getValue("theme"), conferenceId, + domain, }; } + + public getCompleteUrl(params: ITemplateParams): string { + return runTemplate(this.templateUrl, { + // we need to supply a whole widget to the template, but don't have + // easy access to the definition the superclass is using, so be sad + // and gutwrench it. + // This isn't a problem when the widget architecture is fixed and this + // subclass gets deleted. + ...super['definition'], // XXX: Private member access + data: this.rawData, + }, params); + } } export class StopGapWidget extends EventEmitter { From 0ac4f21652b7ded873c770400ae0b0333662c67d Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 12 Oct 2020 13:24:53 +0100 Subject: [PATCH 7/9] Upgrade matrix-js-sdk to 8.5.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 532bb1c3e5..32017f2112 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": "8.5.0-rc.1", + "matrix-js-sdk": "8.5.0", "matrix-widget-api": "^0.1.0-beta.3", "minimist": "^1.2.5", "pako": "^1.0.11", diff --git a/yarn.lock b/yarn.lock index 7dc34164d4..5630ee2b64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5926,10 +5926,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@8.5.0-rc.1: - version "8.5.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.5.0-rc.1.tgz#7ad34d8b6a786a7d4a04173e3b17da56022cd62a" - integrity sha512-hVFYkN3/rsPiNXdFqcvRvg+Egr75qhPGMi2gp59PDr7JrZEtOACA0I3NCY1vPub9kXGTtPZqPuHGFrsF9qLXGw== +matrix-js-sdk@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.5.0.tgz#02d77e0e95fe32dcc74e0a94707f9103badfdca5" + integrity sha512-RJCqK/QkesL+63rX4C4mShEFw/ZR20D1UMw1RKY8pQhv1/7Skz+v5BTv/UCqG45E3rRYMarNOwy13CZ+yq33FA== dependencies: "@babel/runtime" "^7.11.2" another-json "^0.2.0" From 71e800abd1f54ebd86b2e062e54fcbea45f70b77 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 12 Oct 2020 13:36:52 +0100 Subject: [PATCH 8/9] Prepare changelog for v3.6.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98a4a1ff87..4a22954c3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +Changes in [3.6.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.6.0) (2020-10-12) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.6.0-rc.1...v3.6.0) + + * Upgrade JS SDK to 8.5.0 + * [Release] Fix templating for v1 jitsi widgets + [\#5306](https://github.com/matrix-org/matrix-react-sdk/pull/5306) + * [Release] Use new preparing event for widget communications + [\#5304](https://github.com/matrix-org/matrix-react-sdk/pull/5304) + Changes in [3.6.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.6.0-rc.1) (2020-10-07) ============================================================================================================= [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.5.0...v3.6.0-rc.1) From 2242e6b8c610e868f62516bf0483962e92d55191 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 12 Oct 2020 13:36:52 +0100 Subject: [PATCH 9/9] v3.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 32017f2112..71c8074a93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.6.0-rc.1", + "version": "3.6.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {