From a330b3c596114b1e618a09254fc1e7a652eadb46 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Aug 2021 15:50:45 +0100 Subject: [PATCH 01/43] Changelog --- CHANGELOG.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d65a524d1..a49685839f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,66 @@ +Changes in [3.28.0-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v3.28.0-rc.1) (2021-07-11) +============================================================================================================= + +## ✨ Features + * Show how long a call was on call tiles ([\#6570](https://github.com/matrix-org/matrix-react-sdk/pull/6570)). Fixes vector-im/element-web#18405. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Add regional indicators to emoji picker ([\#6490](https://github.com/matrix-org/matrix-react-sdk/pull/6490)). Fixes vector-im/element-web#14963. Contributed by [robintown](https://github.com/robintown). + * Make call control buttons accessible to screen reader users ([\#6181](https://github.com/matrix-org/matrix-react-sdk/pull/6181)). Fixes vector-im/element-web#18358. Contributed by [pvagner](https://github.com/pvagner). + * Skip sending a thumbnail if it is not a sufficient saving over the original ([\#6559](https://github.com/matrix-org/matrix-react-sdk/pull/6559)). Fixes vector-im/element-web#17906. + * Increase PiP snapping speed ([\#6539](https://github.com/matrix-org/matrix-react-sdk/pull/6539)). Fixes vector-im/element-web#18371. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Improve and move the incoming call toast ([\#6470](https://github.com/matrix-org/matrix-react-sdk/pull/6470)). Fixes vector-im/element-web#17912. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Allow all of the URL schemes that Firefox allows ([\#6457](https://github.com/matrix-org/matrix-react-sdk/pull/6457)). Contributed by [aaronraimist](https://github.com/aaronraimist). + * Improve bubble layout colors ([\#6452](https://github.com/matrix-org/matrix-react-sdk/pull/6452)). Fixes vector-im/element-web#18081. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Spaces let users switch between Home and All Rooms behaviours ([\#6497](https://github.com/matrix-org/matrix-react-sdk/pull/6497)). Fixes vector-im/element-web#18093. + * Support for MSC2285 (hidden read receipts) ([\#6390](https://github.com/matrix-org/matrix-react-sdk/pull/6390)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Group pinned message events with MELS ([\#6349](https://github.com/matrix-org/matrix-react-sdk/pull/6349)). Fixes vector-im/element-web#17938. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Make version copiable ([\#6227](https://github.com/matrix-org/matrix-react-sdk/pull/6227)). Fixes vector-im/element-web#17603 and vector-im/element-web#18329. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Improve voice messages uploading state ([\#6530](https://github.com/matrix-org/matrix-react-sdk/pull/6530)). Fixes vector-im/element-web#18226 and vector-im/element-web#18224. + * Add surround with feature ([\#5510](https://github.com/matrix-org/matrix-react-sdk/pull/5510)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Improve call event tile wording ([\#6545](https://github.com/matrix-org/matrix-react-sdk/pull/6545)). Fixes vector-im/element-web#18376. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Show an avatar/a turned off microphone icon for muted users ([\#6486](https://github.com/matrix-org/matrix-react-sdk/pull/6486)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Prompt user to leave rooms/subspaces in a space when leaving space ([\#6424](https://github.com/matrix-org/matrix-react-sdk/pull/6424)). Fixes vector-im/element-web#18071. + * Add customisation point to override widget variables ([\#6455](https://github.com/matrix-org/matrix-react-sdk/pull/6455)). Fixes vector-im/element-web#18035. + * Add support for screen sharing in 1:1 calls ([\#5992](https://github.com/matrix-org/matrix-react-sdk/pull/5992)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + +## 🐛 Bug Fixes + * Fix [object Object] in Widget Permissions ([\#6560](https://github.com/matrix-org/matrix-react-sdk/pull/6560)). Fixes vector-im/element-web#18384. Contributed by [Palid](https://github.com/Palid). + * Fix right margin for events on IRC layout ([\#6542](https://github.com/matrix-org/matrix-react-sdk/pull/6542)). Fixes vector-im/element-web#18354. + * Mirror only usermedia feeds ([\#6512](https://github.com/matrix-org/matrix-react-sdk/pull/6512)). Fixes vector-im/element-web#5633. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix LogoutDialog warning + TypeScript migration ([\#6533](https://github.com/matrix-org/matrix-react-sdk/pull/6533)). + * Fix the wrong font being used in the room topic field ([\#6527](https://github.com/matrix-org/matrix-react-sdk/pull/6527)). Fixes vector-im/element-web#18339. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix inconsistent styling for links on hover ([\#6513](https://github.com/matrix-org/matrix-react-sdk/pull/6513)). Contributed by [janogarcia](https://github.com/janogarcia). + * Fix incorrect height for encoded placeholder images ([\#6514](https://github.com/matrix-org/matrix-react-sdk/pull/6514)). Contributed by [Palid](https://github.com/Palid). + * Fix call events layout for message bubble ([\#6465](https://github.com/matrix-org/matrix-react-sdk/pull/6465)). Fixes vector-im/element-web#18144. + * Improve subspaces and some utilities around room/space creation ([\#6458](https://github.com/matrix-org/matrix-react-sdk/pull/6458)). Fixes vector-im/element-web#18090 vector-im/element-web#18091 and vector-im/element-web#17256. + * Restore pointer cursor for SenderProfile in message bubbles ([\#6501](https://github.com/matrix-org/matrix-react-sdk/pull/6501)). Fixes vector-im/element-web#18249. + * Fix issues with the Call View ([\#6472](https://github.com/matrix-org/matrix-react-sdk/pull/6472)). Fixes vector-im/element-web#18221. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Align event list summary read receipts when using message bubbles ([\#6500](https://github.com/matrix-org/matrix-react-sdk/pull/6500)). Fixes vector-im/element-web#18143. + * Better positioning for unbubbled events in timeline ([\#6477](https://github.com/matrix-org/matrix-react-sdk/pull/6477)). Fixes vector-im/element-web#18132. + * Realign reactions row with messages in modern layout ([\#6491](https://github.com/matrix-org/matrix-react-sdk/pull/6491)). Fixes vector-im/element-web#18118. Contributed by [robintown](https://github.com/robintown). + * Fix CreateRoomDialog exploding when making public room outside of a space ([\#6492](https://github.com/matrix-org/matrix-react-sdk/pull/6492)). Fixes vector-im/element-web#18275. + * Fix call crashing because `element` was undefined ([\#6488](https://github.com/matrix-org/matrix-react-sdk/pull/6488)). Fixes vector-im/element-web#18270. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Upscale thumbnails to the container size ([\#6589](https://github.com/matrix-org/matrix-react-sdk/pull/6589)). Fixes vector-im/element-web#18307. + * Fix create room dialog in spaces no longer adding to the space ([\#6587](https://github.com/matrix-org/matrix-react-sdk/pull/6587)). Fixes vector-im/element-web#18465. + * Don't show a modal on call reject/user hangup ([\#6580](https://github.com/matrix-org/matrix-react-sdk/pull/6580)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fade Call View Buttons after `componentDidMount` ([\#6581](https://github.com/matrix-org/matrix-react-sdk/pull/6581)). Fixes vector-im/element-web#18439. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix missing expand button on codeblocks ([\#6565](https://github.com/matrix-org/matrix-react-sdk/pull/6565)). Fixes vector-im/element-web#18388. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * allow customizing the bubble layout colors ([\#6568](https://github.com/matrix-org/matrix-react-sdk/pull/6568)). Fixes vector-im/element-web#18408. Contributed by [benneti](https://github.com/benneti). + * Don't flash "Missed call" when accepting a call ([\#6567](https://github.com/matrix-org/matrix-react-sdk/pull/6567)). Fixes vector-im/element-web#18404. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix clicking whitespaces on replies ([\#6571](https://github.com/matrix-org/matrix-react-sdk/pull/6571)). Fixes vector-im/element-web#18327. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix disabled state for voice messages + send button tooltip ([\#6562](https://github.com/matrix-org/matrix-react-sdk/pull/6562)). Fixes vector-im/element-web#18413. + * Fix voice feed being cut-off ([\#6550](https://github.com/matrix-org/matrix-react-sdk/pull/6550)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix sizing issues of the screen picker ([\#6498](https://github.com/matrix-org/matrix-react-sdk/pull/6498)). Fixes vector-im/element-web#18281. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Stop voice messages that are playing when starting a recording ([\#6563](https://github.com/matrix-org/matrix-react-sdk/pull/6563)). Fixes vector-im/element-web#18410. + * Properly set style attribute on shared usercontent iframe ([\#6561](https://github.com/matrix-org/matrix-react-sdk/pull/6561)). Fixes vector-im/element-web#18414. + * Null guard space inviter to prevent the app exploding ([\#6558](https://github.com/matrix-org/matrix-react-sdk/pull/6558)). + * Make the ringing sound mutable/disablable ([\#6534](https://github.com/matrix-org/matrix-react-sdk/pull/6534)). Fixes vector-im/element-web#15591. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix wrong cursor being used in PiP ([\#6551](https://github.com/matrix-org/matrix-react-sdk/pull/6551)). Fixes vector-im/element-web#18383. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Re-pin Jitsi if the widget already exists ([\#6226](https://github.com/matrix-org/matrix-react-sdk/pull/6226)). Fixes vector-im/element-web#17679. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix broken call notification regression ([\#6526](https://github.com/matrix-org/matrix-react-sdk/pull/6526)). Fixes vector-im/element-web#18335. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * createRoom, only send join rule event if we have a join rule to put in it ([\#6516](https://github.com/matrix-org/matrix-react-sdk/pull/6516)). Fixes vector-im/element-web#18301. + * Fix clicking pills inside replies ([\#6508](https://github.com/matrix-org/matrix-react-sdk/pull/6508)). Fixes vector-im/element-web#18283. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * Fix grecaptcha regression ([\#6503](https://github.com/matrix-org/matrix-react-sdk/pull/6503)). Fixes vector-im/element-web#18284. Contributed by [Palid](https://github.com/Palid). + Changes in [3.27.0](https://github.com/vector-im/element-desktop/releases/tag/v3.27.0) (2021-07-02) =================================================================================================== From 15731848adfdfcc4cfb72678146eac7db5c03674 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 11 Aug 2021 16:00:43 +0100 Subject: [PATCH 02/43] Upgrade matrix-js-sdk to 12.3.0-rc.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2445e3c973..47fa616d0b 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.20", - "matrix-js-sdk": "12.2.0", + "matrix-js-sdk": "12.3.0-rc.1", "matrix-widget-api": "^0.1.0-beta.15", "minimist": "^1.2.5", "opus-recorder": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index a780d1ffa0..5e1699a696 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5686,10 +5686,10 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@12.2.0: - version "12.2.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.2.0.tgz#e1dc7ddac054289cb24ee3d11dba8a5ba5ddecf5" - integrity sha512-foSs3uKRc6uvFNhgY35eErBvLWVDd5RNIxxsdFKlmU3B+70YUf3BP3petyBNW34ORyOqNdX36IiApfLo3npNEw== +matrix-js-sdk@12.3.0-rc.1: + version "12.3.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.3.0-rc.1.tgz#9e192f7bffb08d68deb1298e46082eda3273c6ee" + integrity sha512-sqvc5+y289qnoqFvq32XDiWFu3NPKOmmTTV6fB+OdtkP3VvU8In+6sXYWqY3Xz7ZD4nY+At6AijQmDPn2seJwQ== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 429befac62ffc0b491e92083f8527d9f6d593632 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 11 Aug 2021 16:02:12 +0100 Subject: [PATCH 03/43] v3.28.0-rc.1 --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 47fa616d0b..0fa143b83b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.27.0", + "version": "3.28.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { @@ -25,7 +25,7 @@ "bin": { "reskindex": "scripts/reskindex.js" }, - "main": "./src/index.js", + "main": "./lib/index.js", "matrix_src_main": "./src/index.js", "matrix_lib_main": "./lib/index.js", "matrix_lib_typings": "./lib/index.d.ts", @@ -205,5 +205,6 @@ "coverageReporters": [ "text" ] - } + }, + "typings": "./lib/index.d.ts" } From de398f46f4a9ec4169ad2dbe253f4acc7eb4e800 Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 11 Aug 2021 16:11:10 +0100 Subject: [PATCH 04/43] initial spike --- package.json | 2 + src/components/structures/MatrixChat.tsx | 11 ++++ .../views/dialogs/BugReportDialog.tsx | 8 +++ .../views/elements/ErrorBoundary.tsx | 1 + src/rageshake/rageshake.js | 2 +- src/sentry.ts | 48 ++++++++++++++ yarn.lock | 63 +++++++++++++++++++ 7 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 src/sentry.ts diff --git a/package.json b/package.json index 2445e3c973..beb30e231f 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,8 @@ }, "dependencies": { "@babel/runtime": "^7.12.5", + "@sentry/browser": "^6.11.0", + "@sentry/tracing": "^6.11.0", "await-lock": "^2.1.0", "blurhash": "^1.1.3", "browser-encrypt-attachment": "^0.3.0", diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 60c78b5f9e..e288884a5a 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -108,6 +108,7 @@ import SoftLogout from './auth/SoftLogout'; import { makeRoomPermalink } from "../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; +import {initSentry, sendSentryReport} from "../../sentry"; /** constants for MatrixChat.state.view */ export enum Views { @@ -393,6 +394,16 @@ export default class MatrixChat extends React.PureComponent { PosthogAnalytics.instance.updatePlatformSuperProperties(); CountlyAnalytics.instance.enable(/* anonymous = */ true); + + initSentry(SdkConfig.get()["sentry"]); + setTimeout(() => { + try { + const e = new Error("whoops"); + throw(e); + } catch (e) { + sendSentryReport("user text", "label", e); + } + }, 4000); } private async postLoginSetup() { diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index 3df05dac6e..b12aecd95c 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -29,11 +29,13 @@ import BaseDialog from "./BaseDialog"; import Field from '../elements/Field'; import Spinner from "../elements/Spinner"; import DialogButtons from "../elements/DialogButtons"; +import {sendSentryReport} from "../../../sentry"; interface IProps { onFinished: (success: boolean) => void; initialText?: string; label?: string; + error?: Error; } interface IState { @@ -113,6 +115,12 @@ export default class BugReportDialog extends React.Component { }); } }); + + // Send a Sentry report if the user agreed to send logs and if there's an error object (Sentry won't be very + // useful for grouping errors without exception information to aggregate with) + if (sendLogs) { + sendSentryReport(userText, this.props.label, this.props.error); + } }; private onDownload = async (): Promise => { diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index 334e569163..a1b67cb347 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -71,6 +71,7 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> { private onBugReport = (): void => { Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { label: 'react-soft-crash', + error: this.state.error }); }; diff --git a/src/rageshake/rageshake.js b/src/rageshake/rageshake.js index 9512f62e42..a3a59a472b 100644 --- a/src/rageshake/rageshake.js +++ b/src/rageshake/rageshake.js @@ -84,7 +84,7 @@ class ConsoleLogger { // In development, it can be useful to log complex cyclic // objects to the console for inspection. This is fine for // the console, but default `stringify` can't handle that. - // We workaround this by using a special replacer function + // We w orkaround this by using a special replacer function // to only log values of the root object and avoid cycles. return JSON.stringify(arg, (key, value) => { if (key && typeof value === "object") { diff --git a/src/sentry.ts b/src/sentry.ts new file mode 100644 index 0000000000..925aa48251 --- /dev/null +++ b/src/sentry.ts @@ -0,0 +1,48 @@ +import * as Sentry from "@sentry/browser"; +import { Integrations } from "@sentry/tracing"; +import PlatformPeg from "./PlatformPeg"; +import SdkConfig from "./SdkConfig"; + +export function sendSentryReport(userText: string, label: string, error: Error): void { + if (!SdkConfig.get()["sentry"]) return; + + // Ignore reports without errors, as they're not useful in sentry and can't easily be aggregated + if (error) { + Sentry.captureException(error); + } +} + +interface ISentryConfig { + dsn: string; + environment?: string; +} + +export async function initSentry(sentryConfig: ISentryConfig): Promise { + if (!sentryConfig) return; + const platform = PlatformPeg.get(); + let appVersion = "unknown"; + try { + appVersion = await platform.getAppVersion(); + } catch (e) {} + + Sentry.init({ + dsn: sentryConfig.dsn, + release: `${platform.getHumanReadableName()}@${appVersion}`, + environment: sentryConfig.environment, + defaultIntegrations: false, + autoSessionTracking: false, + debug: true, + integrations: [ + // specifically disable Integrations.GlobalHandlers, which hooks uncaught exceptions - we don't + // want to capture those at this stage, just explicit rageshakes + new Sentry.Integrations.InboundFilters(), + new Sentry.Integrations.FunctionToString(), + new Sentry.Integrations.Breadcrumbs(), + new Sentry.Integrations.UserAgent(), + new Sentry.Integrations.Dedupe(), + ], + // Set to 1.0 which is reasonable if we're only submitting Rageshakes; will need to be set < 1.0 + // if we collect more frequently. + tracesSampleRate: 1.0, + }); +} diff --git a/yarn.lock b/yarn.lock index a780d1ffa0..d9896fe56a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1453,11 +1453,74 @@ tslib "^2.2.0" webcrypto-core "^1.2.0" +"@sentry/browser@^6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.11.0.tgz#9e90bbc0488ebcdd1e67937d8d5b4f13c3f6dee0" + integrity sha512-Qr2QRA0t5/S9QQqxzYKvM9W8prvmiWuldfwRX4hubovXzcXLgUi4WK0/H612wSbYZ4dNAEcQbtlxFWJNN4wxdg== + dependencies: + "@sentry/core" "6.11.0" + "@sentry/types" "6.11.0" + "@sentry/utils" "6.11.0" + tslib "^1.9.3" + +"@sentry/core@6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.11.0.tgz#40e94043afcf6407a109be26655c77832c64e740" + integrity sha512-09TB+f3pqEq8LFahFWHO6I/4DxHo+NcS52OkbWMDqEi6oNZRD7PhPn3i14LfjsYVv3u3AESU8oxSEGbFrr2UjQ== + dependencies: + "@sentry/hub" "6.11.0" + "@sentry/minimal" "6.11.0" + "@sentry/types" "6.11.0" + "@sentry/utils" "6.11.0" + tslib "^1.9.3" + +"@sentry/hub@6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.11.0.tgz#ddf9ddb0577d1c8290dc02c0242d274fe84d6c16" + integrity sha512-pT9hf+ZJfVFpoZopoC+yJmFNclr4NPqPcl2cgguqCHb69DklD1NxgBNWK8D6X05qjnNFDF991U6t1mxP9HrGuw== + dependencies: + "@sentry/types" "6.11.0" + "@sentry/utils" "6.11.0" + tslib "^1.9.3" + +"@sentry/minimal@6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.11.0.tgz#806d5512658370e40827b3e3663061db708fff33" + integrity sha512-XkZ7qrdlGp4IM/gjGxf1Q575yIbl5RvPbg+WFeekpo16Ufvzx37Mr8c2xsZaWosISVyE6eyFpooORjUlzy8EDw== + dependencies: + "@sentry/hub" "6.11.0" + "@sentry/types" "6.11.0" + tslib "^1.9.3" + +"@sentry/tracing@^6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.11.0.tgz#9bd9287addea1ebc12c75b226f71c7713c0fac4f" + integrity sha512-9VA1/SY++WeoMQI4K6n/sYgIdRtCu9NLWqmGqu/5kbOtESYFgAt1DqSyqGCr00ZjQiC2s7tkDkTNZb38K6KytQ== + dependencies: + "@sentry/hub" "6.11.0" + "@sentry/minimal" "6.11.0" + "@sentry/types" "6.11.0" + "@sentry/utils" "6.11.0" + tslib "^1.9.3" + +"@sentry/types@6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.11.0.tgz#5122685478d32ddacd3a891cbcf550012df85f7c" + integrity sha512-gm5H9eZhL6bsIy/h3T+/Fzzz2vINhHhqd92CjHle3w7uXdTdFV98i2pDpErBGNTSNzbntqOMifYEB5ENtZAvcg== + "@sentry/types@^6.10.0": version "6.10.0" resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.10.0.tgz#6b1f44e5ed4dbc2710bead24d1b32fb08daf04e1" integrity sha512-M7s0JFgG7/6/yNVYoPUbxzaXDhnzyIQYRRJJKRaTD77YO4MHvi4Ke8alBWqD5fer0cPIfcSkBqa9BLdqRqcMWw== +"@sentry/utils@6.11.0": + version "6.11.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.11.0.tgz#d1dee4faf4d9c42c54bba88d5a66fb96b902a14c" + integrity sha512-IOvyFHcnbRQxa++jO+ZUzRvFHEJ1cZjrBIQaNVc0IYF0twUOB5PTP6joTcix38ldaLeapaPZ9LGfudbvYvxkdg== + dependencies: + "@sentry/types" "6.11.0" + tslib "^1.9.3" + "@sinonjs/commons@^1.7.0": version "1.8.3" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" From dface1928dc040632aeeafc58c34db0816f4164e Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 11 Aug 2021 16:49:28 +0100 Subject: [PATCH 05/43] Load all rageshake attributes --- src/sentry.ts | 117 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/src/sentry.ts b/src/sentry.ts index 925aa48251..bccfdaad79 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -2,14 +2,127 @@ import * as Sentry from "@sentry/browser"; import { Integrations } from "@sentry/tracing"; import PlatformPeg from "./PlatformPeg"; import SdkConfig from "./SdkConfig"; +import {MatrixClientPeg} from "./MatrixClientPeg"; +import SettingsStore from "./settings/SettingsStore"; +import {MatrixClient} from "../../matrix-js-sdk"; -export function sendSentryReport(userText: string, label: string, error: Error): void { +async function getStorageOptions(): Record { + const result = {} + + // add storage persistence/quota information + if (navigator.storage && navigator.storage.persisted) { + try { + result["storageManager_persisted"] = String(await navigator.storage.persisted()); + } catch (e) {} + } else if (document.hasStorageAccess) { // Safari + try { + result["storageManager_persisted"] = String(await document.hasStorageAccess()); + } catch (e) {} + } + if (navigator.storage && navigator.storage.estimate) { + try { + const estimate = await navigator.storage.estimate(); + result["storageManager_quota"] = String(estimate.quota); + result["storageManager_usage"] = String(estimate.usage); + if (estimate.usageDetails) { + Object.keys(estimate.usageDetails).forEach(k => { + result[`storageManager_usage_${k}`] = String(estimate.usageDetails[k]); + }); + } + } catch (e) {} + } + + return result; +} + +function getUserContext(client: MatrixClient): Record { + return { + "username": client.credentials.userId, + "enabled_labs": getEnabledLabs(), + "low_bandwidth": SettingsStore.getValue("lowBandwidth") ? "enabled" : "disabled", + }; +} + +function getEnabledLabs(): string { + const enabledLabs = SettingsStore.getFeatureSettingNames().filter(f => SettingsStore.getValue(f)); + if (enabledLabs.length) { + return enabledLabs.join(", "); + } +} + +async function getCryptoContext(client: MatrixClient): Record { + if (!client.isCryptoEnabled()) { + return {}; + } + const keys = [`ed25519:${client.getDeviceEd25519Key()}`]; + if (client.getDeviceCurve25519Key) { + keys.push(`curve25519:${client.getDeviceCurve25519Key()}`); + } + const crossSigning = client.crypto.crossSigningInfo; + const secretStorage = client.crypto.secretStorage; + const pkCache = client.getCrossSigningCacheCallbacks(); + const sessionBackupKeyFromCache = await client.crypto.getSessionBackupPrivateKey(); + + return { + "device_keys": keys.join(', '), + "cross_signing_ready": String(await client.isCrossSigningReady()), + "cross_signing_supported_by_hs": + String(await client.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")), + "cross_signing_key": crossSigning.getId(), + "cross_signing_privkey_in_secret_storage": String( + !!(await crossSigning.isStoredInSecretStorage(secretStorage))), + "cross_signing_master_privkey_cached": String( + !!(pkCache && await pkCache.getCrossSigningKeyCache("master"))), + "cross_signing_user_signing_privkey_cached": String( + !!(pkCache && await pkCache.getCrossSigningKeyCache("user_signing"))), + "secret_storage_ready": String(await client.isSecretStorageReady()), + "secret_storage_key_in_account": String(!!(await secretStorage.hasKey())), + "session_backup_key_in_secret_storage": String(!!(await client.isKeyBackupKeyStored())), + "session_backup_key_cached": String(!!sessionBackupKeyFromCache), + "session_backup_key_well_formed": String(sessionBackupKeyFromCache instanceof Uint8Array), + }; +} + +function getDeviceContext(client: MatrixClient): Record { + const result = { + "device_id": client?.deviceId, + "mx_local_settings": localStorage.getItem('mx_local_settings'), + }; + + if (window.Modernizr) { + const missingFeatures = Object.keys(window.Modernizr).filter(key => window.Modernizr[key] === false); + if (missingFeatures.length > 0) { + result["modernizr_missing_features"] = missingFeatures.join(", "); + } + } + + return result; +} + +async function getContext() { + const client = MatrixClientPeg.get(); + return { + "contexts": { + "user": getUserContext(client), + "crypto": await getCryptoContext(client), + "device": getDeviceContext(client), + "storage": await getStorageOptions() + }, + "extra": { + + }, + }; +} + +export async function sendSentryReport(userText: string, label: string, error: Error): void { if (!SdkConfig.get()["sentry"]) return; // Ignore reports without errors, as they're not useful in sentry and can't easily be aggregated if (error) { - Sentry.captureException(error); + Sentry.captureException(error, await getContext()); } + + // TODO: use https://docs.sentry.io/api/projects/submit-user-feedback/ to submit userText } interface ISentryConfig { From c6202bf6533995e96a4d1062733950c9e6298da5 Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 11 Aug 2021 16:50:33 +0100 Subject: [PATCH 06/43] lint --- src/sentry.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sentry.ts b/src/sentry.ts index bccfdaad79..31f56e9db5 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -1,13 +1,12 @@ import * as Sentry from "@sentry/browser"; -import { Integrations } from "@sentry/tracing"; import PlatformPeg from "./PlatformPeg"; import SdkConfig from "./SdkConfig"; -import {MatrixClientPeg} from "./MatrixClientPeg"; +import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; -import {MatrixClient} from "../../matrix-js-sdk"; +import { MatrixClient } from "../../matrix-js-sdk"; async function getStorageOptions(): Record { - const result = {} + const result = {}; // add storage persistence/quota information if (navigator.storage && navigator.storage.persisted) { @@ -106,7 +105,7 @@ async function getContext() { "user": getUserContext(client), "crypto": await getCryptoContext(client), "device": getDeviceContext(client), - "storage": await getStorageOptions() + "storage": await getStorageOptions(), }, "extra": { From ba1618812c0a1b2d0810ae484833a3a44c8d9235 Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 11 Aug 2021 17:19:15 +0100 Subject: [PATCH 07/43] Send user text as context --- .../views/dialogs/BugReportDialog.tsx | 8 +--- .../views/messages/TileErrorBoundary.tsx | 1 + src/sentry.ts | 37 +++++++++++-------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index b12aecd95c..08d295d8b7 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -29,7 +29,7 @@ import BaseDialog from "./BaseDialog"; import Field from '../elements/Field'; import Spinner from "../elements/Spinner"; import DialogButtons from "../elements/DialogButtons"; -import {sendSentryReport} from "../../../sentry"; +import { sendSentryReport } from "../../../sentry"; interface IProps { onFinished: (success: boolean) => void; @@ -116,11 +116,7 @@ export default class BugReportDialog extends React.Component { } }); - // Send a Sentry report if the user agreed to send logs and if there's an error object (Sentry won't be very - // useful for grouping errors without exception information to aggregate with) - if (sendLogs) { - sendSentryReport(userText, this.props.label, this.props.error); - } + sendSentryReport(userText, this.state.issueUrl, this.props.error); }; private onDownload = async (): Promise => { diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index c61771f396..a15806ae0c 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -51,6 +51,7 @@ export default class TileErrorBoundary extends React.Component { private onBugReport = (): void => { Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { label: 'react-soft-crash-tile', + error: this.state.error, }); }; diff --git a/src/sentry.ts b/src/sentry.ts index 31f56e9db5..841eac2f24 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -98,30 +98,35 @@ function getDeviceContext(client: MatrixClient): Record { return result; } -async function getContext() { +async function getContexts() { const client = MatrixClientPeg.get(); return { - "contexts": { - "user": getUserContext(client), - "crypto": await getCryptoContext(client), - "device": getDeviceContext(client), - "storage": await getStorageOptions(), - }, - "extra": { - - }, + "user": getUserContext(client), + "crypto": await getCryptoContext(client), + "device": getDeviceContext(client), + "storage": await getStorageOptions(), }; } -export async function sendSentryReport(userText: string, label: string, error: Error): void { - if (!SdkConfig.get()["sentry"]) return; +export async function sendSentryReport(userText: string, issueUrl: string, error: Error): void { + const sentryConfig = SdkConfig.get()["sentry"]; + if (!sentryConfig) return; - // Ignore reports without errors, as they're not useful in sentry and can't easily be aggregated + const captureContext = { + "contexts": await getContexts(), + "extra": { + "userText": userText, + "issue_url": issueUrl, + }, + }; + + // If there's no error and no issueUrl, the report will just produce non-grouped noise in Sentry, so don't + // upload it if (error) { - Sentry.captureException(error, await getContext()); + Sentry.captureException(error, captureContext); + } else if (issueUrl) { + Sentry.captureMessage(`Issue: ${issueUrl}`, captureContext); } - - // TODO: use https://docs.sentry.io/api/projects/submit-user-feedback/ to submit userText } interface ISentryConfig { From cc9ddb351f9e2c6c6ed75ca198783bcd3b0b6cbe Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 11 Aug 2021 17:47:54 +0100 Subject: [PATCH 08/43] Remove test error on startup, and send correct user text --- src/components/structures/MatrixChat.tsx | 10 +--------- src/components/views/dialogs/BugReportDialog.tsx | 2 +- src/rageshake/rageshake.js | 2 +- src/sentry.ts | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index e288884a5a..7b3fe260d7 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -108,7 +108,7 @@ import SoftLogout from './auth/SoftLogout'; import { makeRoomPermalink } from "../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; -import {initSentry, sendSentryReport} from "../../sentry"; +import { initSentry, sendSentryReport } from "../../sentry"; /** constants for MatrixChat.state.view */ export enum Views { @@ -396,14 +396,6 @@ export default class MatrixChat extends React.PureComponent { CountlyAnalytics.instance.enable(/* anonymous = */ true); initSentry(SdkConfig.get()["sentry"]); - setTimeout(() => { - try { - const e = new Error("whoops"); - throw(e); - } catch (e) { - sendSentryReport("user text", "label", e); - } - }, 4000); } private async postLoginSetup() { diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index 08d295d8b7..cdb463976a 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -116,7 +116,7 @@ export default class BugReportDialog extends React.Component { } }); - sendSentryReport(userText, this.state.issueUrl, this.props.error); + sendSentryReport(this.state.text, this.state.issueUrl, this.props.error); }; private onDownload = async (): Promise => { diff --git a/src/rageshake/rageshake.js b/src/rageshake/rageshake.js index a3a59a472b..9512f62e42 100644 --- a/src/rageshake/rageshake.js +++ b/src/rageshake/rageshake.js @@ -84,7 +84,7 @@ class ConsoleLogger { // In development, it can be useful to log complex cyclic // objects to the console for inspection. This is fine for // the console, but default `stringify` can't handle that. - // We w orkaround this by using a special replacer function + // We workaround this by using a special replacer function // to only log values of the root object and avoid cycles. return JSON.stringify(arg, (key, value) => { if (key && typeof value === "object") { diff --git a/src/sentry.ts b/src/sentry.ts index 841eac2f24..26a1ffc2e9 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -115,7 +115,7 @@ export async function sendSentryReport(userText: string, issueUrl: string, error const captureContext = { "contexts": await getContexts(), "extra": { - "userText": userText, + "user_text": userText, "issue_url": issueUrl, }, }; From 34249caa9e0fccbfc36945692cb88f2dfd75040a Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Aug 2021 21:50:25 +0100 Subject: [PATCH 09/43] Use changelog generator from npm --- package.json | 2 +- yarn.lock | 63 +++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0fa143b83b..fa1258ef24 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "@typescript-eslint/eslint-plugin": "^4.17.0", "@typescript-eslint/parser": "^4.17.0", "@wojtekmaj/enzyme-adapter-react-17": "^0.6.1", - "allchange": "github:matrix-org/allchange", + "allchange": "^0.0.1", "babel-jest": "^26.6.3", "chokidar": "^3.5.1", "concurrently": "^5.3.0", diff --git a/yarn.lock b/yarn.lock index 5e1699a696..d91b504757 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,28 @@ # yarn lockfile v1 +"@actions/core@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.4.0.tgz#cf2e6ee317e314b03886adfeb20e448d50d6e524" + integrity sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg== + +"@actions/github@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.0.0.tgz#1754127976c50bd88b2e905f10d204d76d1472f8" + integrity sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ== + dependencies: + "@actions/http-client" "^1.0.11" + "@octokit/core" "^3.4.0" + "@octokit/plugin-paginate-rest" "^2.13.3" + "@octokit/plugin-rest-endpoint-methods" "^5.1.1" + +"@actions/http-client@^1.0.11": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0" + integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg== + dependencies: + tunnel "0.0.6" + "@babel/cli@^7.12.10": version "7.14.8" resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.14.8.tgz#fac73c0e2328a8af9fd3560c06b096bfa3730933" @@ -1331,7 +1353,7 @@ dependencies: "@octokit/types" "^6.0.3" -"@octokit/core@^3.5.0": +"@octokit/core@^3.4.0", "@octokit/core@^3.5.0": version "3.5.1" resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== @@ -1367,6 +1389,18 @@ resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-9.3.0.tgz#160347858d727527901c6aae7f7d5c2414cc1f2e" integrity sha512-oz60hhL+mDsiOWhEwrj5aWXTOMVtQgcvP+sRzX4C3cH7WOK9QSAoEtjWh0HdOf6V3qpdgAmUMxnQPluzDWR7Fw== +"@octokit/openapi-types@^9.5.0": + version "9.7.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-9.7.0.tgz#9897cdefd629cd88af67b8dbe2e5fb19c63426b2" + integrity sha512-TUJ16DJU8mekne6+KVcMV5g6g/rJlrnIKn7aALG9QrNpnEipFc1xjoarh0PKaAWf2Hf+HwthRKYt+9mCm5RsRg== + +"@octokit/plugin-paginate-rest@^2.13.3": + version "2.15.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.15.1.tgz#264189dd3ce881c6c33758824aac05a4002e056a" + integrity sha512-47r52KkhQDkmvUKZqXzA1lKvcyJEfYh3TKAIe5+EzMeyDM3d+/s5v11i2gTk8/n6No6DPi3k5Ind6wtDbo/AEg== + dependencies: + "@octokit/types" "^6.24.0" + "@octokit/plugin-paginate-rest@^2.6.2": version "2.15.0" resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.15.0.tgz#9c956c3710b2bd786eb3814eaf5a2b17392c150d" @@ -1387,6 +1421,14 @@ "@octokit/types" "^6.23.0" deprecation "^2.3.1" +"@octokit/plugin-rest-endpoint-methods@^5.1.1": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.8.0.tgz#33b342fe41f2603fdf8b958e6652103bb3ea3f3b" + integrity sha512-qeLZZLotNkoq+it6F+xahydkkbnvSK0iDjlXFo3jNTB+Ss0qIbYQb9V/soKLMkgGw8Q2sHjY5YEXiA47IVPp4A== + dependencies: + "@octokit/types" "^6.25.0" + deprecation "^2.3.1" + "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" @@ -1425,6 +1467,13 @@ dependencies: "@octokit/openapi-types" "^9.3.0" +"@octokit/types@^6.24.0", "@octokit/types@^6.25.0": + version "6.25.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.25.0.tgz#c8e37e69dbe7ce55ed98ee63f75054e7e808bf1a" + integrity sha512-bNvyQKfngvAd/08COlYIN54nRgxskmejgywodizQNyiKoXmWRAjKup2/LYwm+T9V0gsKH6tuld1gM0PzmOiB4Q== + dependencies: + "@octokit/openapi-types" "^9.5.0" + "@peculiar/asn1-schema@^2.0.27", "@peculiar/asn1-schema@^2.0.32": version "2.0.37" resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.0.37.tgz#700476512ab903d809f64a3040fb1b2fe6fb6d4b" @@ -1956,10 +2005,13 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" -"allchange@github:matrix-org/allchange": +allchange@^0.0.1: version "0.0.1" - resolved "https://codeload.github.com/matrix-org/allchange/tar.gz/56b37b06339a3ac3fe771f3ec3d0bff798df8dab" + resolved "https://registry.yarnpkg.com/allchange/-/allchange-0.0.1.tgz#3f66f7b06314b942fd0c1630fef6ce2ac1b90972" + integrity sha512-YVg1ZcYzEE5/fEnexzlhfWIbPeGtjfFgJ73qUG2DNwl16Apt9sRJQE7z6dLbDPaL9tOlYpIgzf7Id74uS+ccjQ== dependencies: + "@actions/core" "^1.4.0" + "@actions/github" "^5.0.0" "@octokit/rest" "^18.6.7" cli-color "^2.0.0" js-yaml "^4.1.0" @@ -7898,6 +7950,11 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tunnel@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" From 71008c9e87d91651b8cba3fdfd3189f6d2283074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 12 Aug 2021 08:14:02 +0200 Subject: [PATCH 10/43] Use AccessibleTooltipButton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index 76e6a43ca5..e56c34520c 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -502,10 +502,12 @@ export default class CallView extends React.Component { ) ) { sidebarButton = ( - ); } From 9249a6e80c71fb50fff2ef50250aae8c79524079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 12 Aug 2021 16:16:13 +0200 Subject: [PATCH 11/43] $system-... -> $system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/themes/dark/css/_dark.scss | 10 +++++----- res/themes/legacy-light/css/_legacy-light.scss | 10 +++++----- res/themes/light/css/_light.scss | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/res/themes/dark/css/_dark.scss b/res/themes/dark/css/_dark.scss index e4ea2bb57e..39658db962 100644 --- a/res/themes/dark/css/_dark.scss +++ b/res/themes/dark/css/_dark.scss @@ -1,5 +1,5 @@ // Colors from Figma Compound https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0 -$system-dark: #21262C; +$system: #21262C; // unified palette // try to use these colors when possible @@ -50,7 +50,7 @@ $inverted-bg-color: $base-color; $selected-color: $room-highlight-color; // selected for hoverover & selected event tiles -$event-selected-color: $system-dark; +$event-selected-color: $system; // used for the hairline dividers in RoomView $primary-hairline-color: transparent; @@ -94,7 +94,7 @@ $lightbox-background-bg-color: #000; $lightbox-background-bg-opacity: 0.85; $settings-grey-fg-color: #a2a2a2; -$settings-profile-placeholder-bg-color: $system-dark; +$settings-profile-placeholder-bg-color: $system; $settings-profile-overlay-placeholder-fg-color: #454545; $settings-profile-button-bg-color: #e7e7e7; $settings-profile-button-fg-color: $settings-profile-overlay-placeholder-fg-color; @@ -178,7 +178,7 @@ $button-link-bg-color: transparent; $togglesw-off-color: $room-highlight-color; $progressbar-fg-color: $accent-color; -$progressbar-bg-color: $system-dark; +$progressbar-bg-color: $system; $visual-bell-bg-color: #800; @@ -213,7 +213,7 @@ $user-tile-hover-bg-color: $header-panel-bg-color; $message-body-panel-fg-color: $secondary-fg-color; $message-body-panel-bg-color: #394049; // "Dark Tile" $message-body-panel-icon-fg-color: $secondary-fg-color; -$message-body-panel-icon-bg-color: $system-dark; // "System Dark" +$message-body-panel-icon-bg-color: $system; // "System Dark" $voice-record-stop-border-color: $quaternary-fg-color; $voice-record-waveform-incomplete-fg-color: $quaternary-fg-color; diff --git a/res/themes/legacy-light/css/_legacy-light.scss b/res/themes/legacy-light/css/_legacy-light.scss index 1a63c9bd07..0edf3b64f2 100644 --- a/res/themes/legacy-light/css/_legacy-light.scss +++ b/res/themes/legacy-light/css/_legacy-light.scss @@ -13,7 +13,7 @@ $font-family: 'Nunito', 'Twemoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Arial $monospace-font-family: 'Inconsolata', 'Twemoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Courier', monospace, 'Noto Color Emoji'; // Colors from Figma Compound https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0 -$system-light: #F4F6FA; +$system: #F4F6FA; // unified palette // try to use these colors when possible @@ -181,8 +181,8 @@ $eventtile-meta-color: $roomtopic-color; $composer-e2e-icon-color: #91a1c0; $header-divider-color: #91a1c0; -$toast-bg-color: $system-light; -$voipcall-plinth-color: $system-light; +$toast-bg-color: $system; +$voipcall-plinth-color: $system; // ******************** @@ -334,7 +334,7 @@ $user-tile-hover-bg-color: $header-panel-bg-color; $message-body-panel-fg-color: $secondary-fg-color; $message-body-panel-bg-color: #E3E8F0; $message-body-panel-icon-fg-color: $secondary-fg-color; -$message-body-panel-icon-bg-color: $system-light; +$message-body-panel-icon-bg-color: $system; // See non-legacy _light for variable information $voice-record-stop-symbol-color: #ff4b55; @@ -352,7 +352,7 @@ $composer-shadow-color: tranparent; // Bubble tiles $eventbubble-self-bg: #F0FBF8; -$eventbubble-others-bg: $system-light; +$eventbubble-others-bg: $system; $eventbubble-bg-hover: #FAFBFD; $eventbubble-avatar-outline: #fff; $eventbubble-reply-color: #C1C6CD; diff --git a/res/themes/light/css/_light.scss b/res/themes/light/css/_light.scss index eff9abe5af..8c79d82170 100644 --- a/res/themes/light/css/_light.scss +++ b/res/themes/light/css/_light.scss @@ -13,7 +13,7 @@ $font-family: 'Inter', 'Twemoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Arial' $monospace-font-family: 'Inconsolata', 'Twemoji', 'Apple Color Emoji', 'Segoe UI Emoji', 'Courier', monospace, 'Noto Color Emoji'; // Colors from Figma Compound https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0 -$system-light: #F4F6FA; +$system: #F4F6FA; // unified palette // try to use these colors when possible @@ -141,7 +141,7 @@ $blockquote-bar-color: #ddd; $blockquote-fg-color: #777; $settings-grey-fg-color: #a2a2a2; -$settings-profile-placeholder-bg-color: $system-light; +$settings-profile-placeholder-bg-color: $system; $settings-profile-overlay-placeholder-fg-color: #2e2f32; $settings-profile-button-bg-color: #e7e7e7; $settings-profile-button-fg-color: $settings-profile-overlay-placeholder-fg-color; @@ -170,8 +170,8 @@ $eventtile-meta-color: $roomtopic-color; $composer-e2e-icon-color: #91A1C0; $header-divider-color: #91A1C0; -$toast-bg-color: $system-light; -$voipcall-plinth-color: $system-light; +$toast-bg-color: $system; +$voipcall-plinth-color: $system; // ******************** @@ -330,7 +330,7 @@ $user-tile-hover-bg-color: $header-panel-bg-color; $message-body-panel-fg-color: $secondary-fg-color; $message-body-panel-bg-color: #E3E8F0; // "Separator" $message-body-panel-icon-fg-color: $secondary-fg-color; -$message-body-panel-icon-bg-color: $system-light; +$message-body-panel-icon-bg-color: $system; // These two don't change between themes. They are the $warning-color, but we don't // want custom themes to affect them by accident. @@ -354,7 +354,7 @@ $composer-shadow-color: rgba(0, 0, 0, 0.04); // Bubble tiles $eventbubble-self-bg: #F0FBF8; -$eventbubble-others-bg: $system-light; +$eventbubble-others-bg: $system; $eventbubble-bg-hover: #FAFBFD; $eventbubble-avatar-outline: $primary-bg-color; $eventbubble-reply-color: #C1C6CD; From bf5c94572c1420afd2305e3c567ffda685445a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 12 Aug 2021 16:20:30 +0200 Subject: [PATCH 12/43] $toast-bg-color -> $system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/structures/_ToastContainer.scss | 4 ++-- res/css/views/voip/_CallView.scss | 2 +- res/themes/dark/css/_dark.scss | 3 --- res/themes/legacy-dark/css/_legacy-dark.scss | 6 +++--- res/themes/legacy-light/css/_legacy-light.scss | 1 - res/themes/light/css/_light.scss | 1 - 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/res/css/structures/_ToastContainer.scss b/res/css/structures/_ToastContainer.scss index 2c3f1c705c..5cd938f1ce 100644 --- a/res/css/structures/_ToastContainer.scss +++ b/res/css/structures/_ToastContainer.scss @@ -28,7 +28,7 @@ limitations under the License. margin: 0 4px; grid-row: 2 / 4; grid-column: 1; - background-color: $toast-bg-color; + background-color: $system; box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.5); border-radius: 8px; } @@ -37,7 +37,7 @@ limitations under the License. grid-row: 1 / 3; grid-column: 1; color: $primary-fg-color; - background-color: $toast-bg-color; + background-color: $system; box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.5); border-radius: 8px; overflow: hidden; diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index 7752edddfa..b054c21686 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -39,7 +39,7 @@ limitations under the License. .mx_CallView_pip { width: 320px; padding-bottom: 8px; - background-color: $toast-bg-color; + background-color: $system; box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.20); border-radius: 8px; diff --git a/res/themes/dark/css/_dark.scss b/res/themes/dark/css/_dark.scss index 39658db962..0e1bf9e858 100644 --- a/res/themes/dark/css/_dark.scss +++ b/res/themes/dark/css/_dark.scss @@ -115,9 +115,6 @@ $eventtile-meta-color: $roomtopic-color; $header-divider-color: $header-panel-text-primary-color; $composer-e2e-icon-color: $header-panel-text-primary-color; -$quinary-content-color: #394049; -$toast-bg-color: $quinary-content-color; - // ******************** $theme-button-bg-color: #e3e8f0; diff --git a/res/themes/legacy-dark/css/_legacy-dark.scss b/res/themes/legacy-dark/css/_legacy-dark.scss index b9429318ac..3e3412c6c1 100644 --- a/res/themes/legacy-dark/css/_legacy-dark.scss +++ b/res/themes/legacy-dark/css/_legacy-dark.scss @@ -1,3 +1,6 @@ +// Colors from Figma Compound https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=559%3A741 +$system: #21262C; + // unified palette // try to use these colors when possible $bg-color: #181b21; @@ -111,9 +114,6 @@ $eventtile-meta-color: $roomtopic-color; $header-divider-color: $header-panel-text-primary-color; $composer-e2e-icon-color: $header-panel-text-primary-color; -$quinary-content-color: #394049; -$toast-bg-color: $quinary-content-color; - // ******************** $theme-button-bg-color: #e3e8f0; diff --git a/res/themes/legacy-light/css/_legacy-light.scss b/res/themes/legacy-light/css/_legacy-light.scss index 0edf3b64f2..3f722bcb30 100644 --- a/res/themes/legacy-light/css/_legacy-light.scss +++ b/res/themes/legacy-light/css/_legacy-light.scss @@ -181,7 +181,6 @@ $eventtile-meta-color: $roomtopic-color; $composer-e2e-icon-color: #91a1c0; $header-divider-color: #91a1c0; -$toast-bg-color: $system; $voipcall-plinth-color: $system; // ******************** diff --git a/res/themes/light/css/_light.scss b/res/themes/light/css/_light.scss index 8c79d82170..590a2a8a1c 100644 --- a/res/themes/light/css/_light.scss +++ b/res/themes/light/css/_light.scss @@ -170,7 +170,6 @@ $eventtile-meta-color: $roomtopic-color; $composer-e2e-icon-color: #91A1C0; $header-divider-color: #91A1C0; -$toast-bg-color: $system; $voipcall-plinth-color: $system; // ******************** From 065a70b63fad007d171fa85411e2bf284bf59af0 Mon Sep 17 00:00:00 2001 From: James Salter Date: Thu, 12 Aug 2021 17:46:28 +0100 Subject: [PATCH 13/43] Add copyright header --- src/sentry.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/sentry.ts b/src/sentry.ts index 26a1ffc2e9..94ee86838c 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -1,3 +1,19 @@ +/* +Copyright 2021 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 Sentry from "@sentry/browser"; import PlatformPeg from "./PlatformPeg"; import SdkConfig from "./SdkConfig"; From 7eabb85e61288011ceb61bf55c4b89f91adf4af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 13 Aug 2021 18:42:55 +0200 Subject: [PATCH 14/43] Fix PiP of held calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/voip/_CallView.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/res/css/views/voip/_CallView.scss b/res/css/views/voip/_CallView.scss index b054c21686..d36c3309a9 100644 --- a/res/css/views/voip/_CallView.scss +++ b/res/css/views/voip/_CallView.scss @@ -43,6 +43,7 @@ limitations under the License. box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.20); border-radius: 8px; + .mx_CallView_video_hold, .mx_CallView_voice { height: 180px; } From a6cde3256ec0ed2fc6e893c3a91dd3a1f4698b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 15 Aug 2021 12:56:29 +0200 Subject: [PATCH 15/43] Properly handle call change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index a6ae71713b..9d82291286 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -111,7 +111,7 @@ export default class CallView extends React.Component { constructor(props: IProps) { super(props); - const { primary, secondary } = this.getOrderedFeeds(this.props.call.getFeeds()); + const { primary, secondary } = CallView.getOrderedFeeds(this.props.call.getFeeds()); this.state = { isLocalOnHold: this.props.call.isLocalOnHold(), @@ -147,7 +147,16 @@ export default class CallView extends React.Component { dis.unregister(this.dispatcherRef); } - public componentDidUpdate(prevProps) { + static getDerivedStateFromProps(props: IProps): Partial { + const { primary, secondary } = CallView.getOrderedFeeds(props.call.getFeeds()); + + return { + primaryFeed: primary, + secondaryFeeds: secondary, + }; + } + + public componentDidUpdate(prevProps: IProps): void { if (this.props.call === prevProps.call) return; this.setState({ @@ -201,7 +210,7 @@ export default class CallView extends React.Component { }; private onFeedsChanged = (newFeeds: Array) => { - const { primary, secondary } = this.getOrderedFeeds(newFeeds); + const { primary, secondary } = CallView.getOrderedFeeds(newFeeds); this.setState({ primaryFeed: primary, secondaryFeeds: secondary, @@ -226,7 +235,7 @@ export default class CallView extends React.Component { this.buttonsRef.current?.showControls(); }; - private getOrderedFeeds(feeds: Array): { primary: CallFeed, secondary: Array } { + static getOrderedFeeds(feeds: Array): { primary: CallFeed, secondary: Array } { let primary; // Try to use a screensharing as primary, a remote one if possible From 64aa53ab246949773fad0ccef06a6b13702ef45e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 15 Aug 2021 13:33:49 +0200 Subject: [PATCH 16/43] Correctly handle media errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The methods need to be async since play() is async, otherwise there is no point in having the try catch blocks Signed-off-by: Šimon Brandner --- src/components/views/voip/AudioFeed.tsx | 4 ++-- src/components/views/voip/VideoFeed.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/voip/AudioFeed.tsx b/src/components/views/voip/AudioFeed.tsx index 3049d80c72..d6d1261343 100644 --- a/src/components/views/voip/AudioFeed.tsx +++ b/src/components/views/voip/AudioFeed.tsx @@ -72,7 +72,7 @@ export default class AudioFeed extends React.Component { } }; - private playMedia() { + private async playMedia() { const element = this.element.current; if (!element) return; this.onAudioOutputChanged(MediaDeviceHandler.getAudioOutput()); @@ -90,7 +90,7 @@ export default class AudioFeed extends React.Component { // should serialise the ones that need to be serialised but then be able to interrupt // them with another load() which will cancel the pending one, but since we don't call // load() explicitly, it shouldn't be a problem. - Dave - element.play(); + await element.load(); } catch (e) { logger.info("Failed to play media element with feed", this.props.feed, e); } diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 1430a7974a..4607b750eb 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -112,7 +112,7 @@ export default class VideoFeed extends React.PureComponent { } } - private playMedia() { + private async playMedia() { const element = this.element; if (!element) return; // We play audio in AudioFeed, not here @@ -129,7 +129,7 @@ export default class VideoFeed extends React.PureComponent { // should serialise the ones that need to be serialised but then be able to interrupt // them with another load() which will cancel the pending one, but since we don't call // load() explicitly, it shouldn't be a problem. - Dave - element.play(); + await element.play(); } catch (e) { logger.info("Failed to play media element with feed", this.props.feed, e); } From 84ad1bec6cf49f41d6c53146f9b1859ef90da954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 15 Aug 2021 14:40:31 +0200 Subject: [PATCH 17/43] Avoid access token overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/settings/tabs/user/_HelpUserSettingsTab.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/res/css/views/settings/tabs/user/_HelpUserSettingsTab.scss b/res/css/views/settings/tabs/user/_HelpUserSettingsTab.scss index fbbe9909e7..3e61e80a9d 100644 --- a/res/css/views/settings/tabs/user/_HelpUserSettingsTab.scss +++ b/res/css/views/settings/tabs/user/_HelpUserSettingsTab.scss @@ -36,6 +36,7 @@ limitations under the License. margin-top: 10px; padding: 10px; width: max-content; + max-width: 100%; .mx_HelpUserSettingsTab_copyButton { flex-shrink: 0; From c856d433d666aabd938bfec1ff6e8205b0578d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 16 Aug 2021 10:08:16 +0200 Subject: [PATCH 18/43] Trim long display names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/messages/_CallEvent.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/css/views/messages/_CallEvent.scss b/res/css/views/messages/_CallEvent.scss index 2d9caf1569..830cc0b1db 100644 --- a/res/css/views/messages/_CallEvent.scss +++ b/res/css/views/messages/_CallEvent.scss @@ -95,17 +95,23 @@ limitations under the License. flex-direction: row; align-items: center; margin-left: 12px; + min-width: 0; .mx_CallEvent_info_basic { display: flex; flex-direction: column; margin-left: 10px; // To match mx_CallEvent + min-width: 0; .mx_CallEvent_sender { font-weight: 600; font-size: 1.5rem; line-height: 1.8rem; margin-bottom: 3px; + + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } .mx_CallEvent_type { @@ -142,6 +148,7 @@ limitations under the License. color: $secondary-fg-color; margin-right: 16px; gap: 8px; + min-width: max-content; .mx_CallEvent_content_button { height: 24px; From bd2ae762d676dfa049e96472718585201afa10ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 16 Aug 2021 10:08:30 +0200 Subject: [PATCH 19/43] Adjust max-non-narrow-width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/messages/CallEvent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/messages/CallEvent.tsx b/src/components/views/messages/CallEvent.tsx index 594b0b7d99..f5a9d80b17 100644 --- a/src/components/views/messages/CallEvent.tsx +++ b/src/components/views/messages/CallEvent.tsx @@ -27,7 +27,7 @@ import classNames from 'classnames'; import AccessibleTooltipButton from '../elements/AccessibleTooltipButton'; import { formatCallTime } from "../../../DateUtils"; -const MAX_NON_NARROW_WIDTH = 400 / 70 * 100; +const MAX_NON_NARROW_WIDTH = 450 / 70 * 100; interface IProps { mxEvent: MatrixEvent; From c375b6058f67da627708e878dad35ea5c2ac098b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 16 Aug 2021 11:04:41 +0200 Subject: [PATCH 20/43] Fix call tile spacing issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/EventTile.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 301e33ec42..c97b28b368 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -856,13 +856,14 @@ export default class EventTile extends React.Component { render() { const msgtype = this.props.mxEvent.getContent().msgtype; + const eventType = this.props.mxEvent.getType() as EventType; const { tileHandler, isBubbleMessage, isInfoMessage } = getEventDisplayInfo(this.props.mxEvent); // This shouldn't happen: the caller should check we support this type // before trying to instantiate us if (!tileHandler) { const { mxEvent } = this.props; - console.warn(`Event type not supported: type:${mxEvent.getType()} isState:${mxEvent.isState()}`); + console.warn(`Event type not supported: type:${eventType} isState:${mxEvent.isState()}`); return
{ _t('This event could not be displayed') } @@ -886,7 +887,10 @@ export default class EventTile extends React.Component { mx_EventTile_sending: !isEditing && isSending, mx_EventTile_highlight: this.props.tileShape === TileShape.Notif ? false : this.shouldHighlight(), mx_EventTile_selected: this.props.isSelectedEvent, - mx_EventTile_continuation: this.props.tileShape ? '' : this.props.continuation, + mx_EventTile_continuation: ( + (this.props.tileShape ? '' : this.props.continuation) || + eventType === EventType.CallInvite + ), mx_EventTile_last: this.props.last, mx_EventTile_lastInSection: this.props.lastInSection, mx_EventTile_contextual: this.props.contextual, @@ -934,7 +938,7 @@ export default class EventTile extends React.Component { needsSenderProfile = true; } else if ( (this.props.continuation && this.props.tileShape !== TileShape.FileGrid) || - this.props.mxEvent.getType() === EventType.CallInvite + eventType === EventType.CallInvite ) { // no avatar or sender profile for continuation messages and call tiles avatarSize = 0; From 8770317b36fd8362acb54666e17274bcfeb8a856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 15 Aug 2021 12:56:29 +0200 Subject: [PATCH 21/43] Properly handle call change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index e56c34520c..1dfd9083e5 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -129,7 +129,7 @@ export default class CallView extends React.Component { constructor(props: IProps) { super(props); - const { primary, secondary } = this.getOrderedFeeds(this.props.call.getFeeds()); + const { primary, secondary } = CallView.getOrderedFeeds(this.props.call.getFeeds()); this.state = { isLocalOnHold: this.props.call.isLocalOnHold(), @@ -166,7 +166,16 @@ export default class CallView extends React.Component { dis.unregister(this.dispatcherRef); } - public componentDidUpdate(prevProps) { + static getDerivedStateFromProps(props: IProps): Partial { + const { primary, secondary } = CallView.getOrderedFeeds(props.call.getFeeds()); + + return { + primaryFeed: primary, + secondaryFeeds: secondary, + }; + } + + public componentDidUpdate(prevProps: IProps): void { if (this.props.call === prevProps.call) return; this.setState({ @@ -220,7 +229,7 @@ export default class CallView extends React.Component { }; private onFeedsChanged = (newFeeds: Array) => { - const { primary, secondary } = this.getOrderedFeeds(newFeeds); + const { primary, secondary } = CallView.getOrderedFeeds(newFeeds); this.setState({ primaryFeed: primary, secondaryFeeds: secondary, @@ -253,7 +262,7 @@ export default class CallView extends React.Component { this.showControls(); }; - private getOrderedFeeds(feeds: Array): { primary: CallFeed, secondary: Array } { + static getOrderedFeeds(feeds: Array): { primary: CallFeed, secondary: Array } { let primary; // Try to use a screensharing as primary, a remote one if possible From 16d02f24bd7269c8be6d833a058b1a8fedb4ed0e Mon Sep 17 00:00:00 2001 From: James Salter Date: Mon, 16 Aug 2021 13:06:19 +0100 Subject: [PATCH 22/43] lint --- src/components/structures/MatrixChat.tsx | 2 +- src/components/views/elements/ErrorBoundary.tsx | 2 +- src/components/views/rooms/EventTile.tsx | 2 ++ src/sentry.ts | 10 +++++----- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 7b3fe260d7..902d2a0921 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -108,7 +108,7 @@ import SoftLogout from './auth/SoftLogout'; import { makeRoomPermalink } from "../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../utils/strings"; import { PosthogAnalytics } from '../../PosthogAnalytics'; -import { initSentry, sendSentryReport } from "../../sentry"; +import { initSentry } from "../../sentry"; /** constants for MatrixChat.state.view */ export enum Views { diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index a1b67cb347..926d3da30c 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -71,7 +71,7 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> { private onBugReport = (): void => { Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { label: 'react-soft-crash', - error: this.state.error + error: this.state.error, }); }; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 884d004551..1bf65bf202 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -451,6 +451,8 @@ export default class EventTile extends React.Component { client.on("Room.receipt", this.onRoomReceipt); this.isListeningForReceipts = true; } + + throw new Error("oops"); } // TODO: [REACT-WARNING] Replace with appropriate lifecycle event diff --git a/src/sentry.ts b/src/sentry.ts index 94ee86838c..3cded20a83 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -21,7 +21,7 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; import { MatrixClient } from "../../matrix-js-sdk"; -async function getStorageOptions(): Record { +async function getStorageOptions(): Promise> { const result = {}; // add storage persistence/quota information @@ -65,7 +65,7 @@ function getEnabledLabs(): string { } } -async function getCryptoContext(client: MatrixClient): Record { +async function getCryptoContext(client: MatrixClient): Promise> { if (!client.isCryptoEnabled()) { return {}; } @@ -98,7 +98,7 @@ async function getCryptoContext(client: MatrixClient): Record { }; } -function getDeviceContext(client: MatrixClient): Record { +function getDeviceContext(client: MatrixClient): Record { const result = { "device_id": client?.deviceId, "mx_local_settings": localStorage.getItem('mx_local_settings'), @@ -114,7 +114,7 @@ function getDeviceContext(client: MatrixClient): Record { return result; } -async function getContexts() { +async function getContexts(): Promise> { const client = MatrixClientPeg.get(); return { "user": getUserContext(client), @@ -124,7 +124,7 @@ async function getContexts() { }; } -export async function sendSentryReport(userText: string, issueUrl: string, error: Error): void { +export async function sendSentryReport(userText: string, issueUrl: string, error: Error): Promise { const sentryConfig = SdkConfig.get()["sentry"]; if (!sentryConfig) return; From d0e82ee603304acaca4af62d523559b4bd42289d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 16 Aug 2021 13:18:10 +0100 Subject: [PATCH 23/43] Update changelog generator --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fa1258ef24..ce9af6e5c2 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "@typescript-eslint/eslint-plugin": "^4.17.0", "@typescript-eslint/parser": "^4.17.0", "@wojtekmaj/enzyme-adapter-react-17": "^0.6.1", - "allchange": "^0.0.1", + "allchange": "^1.0.0", "babel-jest": "^26.6.3", "chokidar": "^3.5.1", "concurrently": "^5.3.0", diff --git a/yarn.lock b/yarn.lock index d91b504757..7374276ccf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2005,10 +2005,10 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" -allchange@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/allchange/-/allchange-0.0.1.tgz#3f66f7b06314b942fd0c1630fef6ce2ac1b90972" - integrity sha512-YVg1ZcYzEE5/fEnexzlhfWIbPeGtjfFgJ73qUG2DNwl16Apt9sRJQE7z6dLbDPaL9tOlYpIgzf7Id74uS+ccjQ== +allchange@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/allchange/-/allchange-1.0.0.tgz#f5177b7d97f8e97a2d059a1524db9a72d94dc6d2" + integrity sha512-O0VIaMIORxOaReyYEijDfKdpudJhbzzVYLdJR1aROyUgOLBEp9e5V/TDXQpjX23W90IFCSRZxsDb3exLRD05HA== dependencies: "@actions/core" "^1.4.0" "@actions/github" "^5.0.0" From e3930638dcd24e8dd6565b83460c16f041fa2da2 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 16 Aug 2021 13:25:59 +0100 Subject: [PATCH 24/43] Fix dates --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a49685839f..a4a8985d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -Changes in [3.28.0-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v3.28.0-rc.1) (2021-07-11) +Changes in [3.28.0-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v3.28.0-rc.1) (2021-08-11) ============================================================================================================= ## ✨ Features @@ -61,7 +61,7 @@ Changes in [3.28.0-rc.1](https://github.com/vector-im/element-desktop/releases/t * Fix clicking pills inside replies ([\#6508](https://github.com/matrix-org/matrix-react-sdk/pull/6508)). Fixes vector-im/element-web#18283. Contributed by [SimonBrandner](https://github.com/SimonBrandner). * Fix grecaptcha regression ([\#6503](https://github.com/matrix-org/matrix-react-sdk/pull/6503)). Fixes vector-im/element-web#18284. Contributed by [Palid](https://github.com/Palid). -Changes in [3.27.0](https://github.com/vector-im/element-desktop/releases/tag/v3.27.0) (2021-07-02) +Changes in [3.27.0](https://github.com/vector-im/element-desktop/releases/tag/v3.27.0) (2021-08-02) =================================================================================================== ## 🔒 SECURITY FIXES From 6c2e98812bd7189eae3dc8317126a53b15d9e357 Mon Sep 17 00:00:00 2001 From: James Salter Date: Mon, 16 Aug 2021 13:26:46 +0100 Subject: [PATCH 25/43] Remove test code; good job we have tests --- src/components/views/rooms/EventTile.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 1bf65bf202..884d004551 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -451,8 +451,6 @@ export default class EventTile extends React.Component { client.on("Room.receipt", this.onRoomReceipt); this.isListeningForReceipts = true; } - - throw new Error("oops"); } // TODO: [REACT-WARNING] Replace with appropriate lifecycle event From 62e1a3053281aa92e847a7ea3826a8b9f2ad00f0 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 16 Aug 2021 14:21:59 +0100 Subject: [PATCH 26/43] Upgrade matrix-js-sdk to 12.3.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ce9af6e5c2..6aafae2b65 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.20", - "matrix-js-sdk": "12.3.0-rc.1", + "matrix-js-sdk": "12.3.0", "matrix-widget-api": "^0.1.0-beta.15", "minimist": "^1.2.5", "opus-recorder": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index 7374276ccf..61207aa03d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5738,10 +5738,10 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@12.3.0-rc.1: - version "12.3.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.3.0-rc.1.tgz#9e192f7bffb08d68deb1298e46082eda3273c6ee" - integrity sha512-sqvc5+y289qnoqFvq32XDiWFu3NPKOmmTTV6fB+OdtkP3VvU8In+6sXYWqY3Xz7ZD4nY+At6AijQmDPn2seJwQ== +matrix-js-sdk@12.3.0: + version "12.3.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.3.0.tgz#b4de14e9c26257e3137eb020b6b13678b01e37d7" + integrity sha512-ywdlpVnwTiddLCvh/sKaZ0/0CVTqqbKPsfpsKduH9GWzwXA/Jrkwt//ryU8l9MjJTrjLnwxTYgnjZgeEp4h5kQ== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 93fee442e659688485bab967a6e58e59cb320b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 16 Aug 2021 15:30:45 +0200 Subject: [PATCH 27/43] Fix call tile buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/messages/_CallEvent.scss | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/res/css/views/messages/_CallEvent.scss b/res/css/views/messages/_CallEvent.scss index 2d9caf1569..b938dc4159 100644 --- a/res/css/views/messages/_CallEvent.scss +++ b/res/css/views/messages/_CallEvent.scss @@ -144,11 +144,10 @@ limitations under the License. gap: 8px; .mx_CallEvent_content_button { - height: 24px; padding: 0px 12px; span { - padding: 8px 0; + padding: 1px 0; display: flex; align-items: center; @@ -162,6 +161,8 @@ limitations under the License. width: 16px; height: 16px; margin-right: 8px; + + flex-shrink: 0; } } } From 9dfa01e1a8190d827f0dda574e8e882e5239ace1 Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Mon, 16 Aug 2021 15:30:48 +0200 Subject: [PATCH 28/43] Fix error on accessing encrypted media without keys In case where the message is encrypted and you request cross-signed keys from another session you may end up in a situation where `media` doesn't exist as you didn't receive keys, yet you have the message's type. This commit fixes this problem by checking if the media is even available. --- src/components/views/messages/MFileBody.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/messages/MFileBody.tsx b/src/components/views/messages/MFileBody.tsx index 13fc4b01e7..216a0f6cbf 100644 --- a/src/components/views/messages/MFileBody.tsx +++ b/src/components/views/messages/MFileBody.tsx @@ -178,7 +178,7 @@ export default class MFileBody extends React.Component { private onPlaceholderClick = async () => { const mediaHelper = this.props.mediaEventHelper; - if (mediaHelper.media.isEncrypted) { + if (mediaHelper?.media.isEncrypted) { await this.decryptFile(); this.downloadFile(this.fileName, this.linkText); } else { @@ -192,7 +192,7 @@ export default class MFileBody extends React.Component { }; public render() { - const isEncrypted = this.props.mediaEventHelper.media.isEncrypted; + const isEncrypted = this.props.mediaEventHelper?.media.isEncrypted; const contentUrl = this.getContentUrl(); const fileSize = this.content.info ? this.content.info.size : null; const fileType = this.content.info ? this.content.info.mimetype : "application/octet-stream"; From fc50870ae5e8f8f2bc685e20f03dd3889b9fcb99 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 16 Aug 2021 14:45:12 +0100 Subject: [PATCH 29/43] Prepare changelog for v3.28.0 --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a8985d73..02a1956fe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -Changes in [3.28.0-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v3.28.0-rc.1) (2021-08-11) -============================================================================================================= +Changes in [3.28.0](https://github.com/vector-im/element-desktop/releases/tag/v3.28.0) (2021-08-16) +=================================================================================================== ## ✨ Features * Show how long a call was on call tiles ([\#6570](https://github.com/matrix-org/matrix-react-sdk/pull/6570)). Fixes vector-im/element-web#18405. Contributed by [SimonBrandner](https://github.com/SimonBrandner). @@ -23,6 +23,9 @@ Changes in [3.28.0-rc.1](https://github.com/vector-im/element-desktop/releases/t * Add support for screen sharing in 1:1 calls ([\#5992](https://github.com/matrix-org/matrix-react-sdk/pull/5992)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). ## 🐛 Bug Fixes + * [Release] Fix glare related regressions ([\#6622](https://github.com/matrix-org/matrix-react-sdk/pull/6622)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * [Release] Fix PiP of held calls ([\#6612](https://github.com/matrix-org/matrix-react-sdk/pull/6612)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * [Release] Fix toast colors ([\#6607](https://github.com/matrix-org/matrix-react-sdk/pull/6607)). Contributed by [SimonBrandner](https://github.com/SimonBrandner). * Fix [object Object] in Widget Permissions ([\#6560](https://github.com/matrix-org/matrix-react-sdk/pull/6560)). Fixes vector-im/element-web#18384. Contributed by [Palid](https://github.com/Palid). * Fix right margin for events on IRC layout ([\#6542](https://github.com/matrix-org/matrix-react-sdk/pull/6542)). Fixes vector-im/element-web#18354. * Mirror only usermedia feeds ([\#6512](https://github.com/matrix-org/matrix-react-sdk/pull/6512)). Fixes vector-im/element-web#5633. Contributed by [SimonBrandner](https://github.com/SimonBrandner). From c4de03ddb0dc5c3a7e4950ab2a17d6fb70835b5f Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 16 Aug 2021 14:45:13 +0100 Subject: [PATCH 30/43] v3.28.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6aafae2b65..00b187defb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.28.0-rc.1", + "version": "3.28.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 0f382efb4669313cd7f345ad0c2fd51a2b2ff32e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 16 Aug 2021 15:02:29 +0100 Subject: [PATCH 31/43] Resetting package fields for development --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 00b187defb..0d56a0051c 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "bin": { "reskindex": "scripts/reskindex.js" }, - "main": "./lib/index.js", + "main": "./src/index.js", "matrix_src_main": "./src/index.js", "matrix_lib_main": "./lib/index.js", "matrix_lib_typings": "./lib/index.d.ts", @@ -205,6 +205,5 @@ "coverageReporters": [ "text" ] - }, - "typings": "./lib/index.d.ts" + } } From 3fdf4d13ca3af53966ae2c4083ce5dc1bd4dd3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 17 Aug 2021 09:48:25 +0200 Subject: [PATCH 32/43] Proper init in constructors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/LoggedInView.tsx | 2 +- src/components/views/voip/AudioFeedArrayForCall.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 2392a8b28d..85fca1ae77 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -156,7 +156,7 @@ class LoggedInView extends React.Component { // use compact timeline view useCompactLayout: SettingsStore.getValue('useCompactLayout'), usageLimitDismissed: false, - activeCalls: [], + activeCalls: CallHandler.sharedInstance().getAllActiveCalls(), }; // stash the MatrixClient in case we log out before we are unmounted diff --git a/src/components/views/voip/AudioFeedArrayForCall.tsx b/src/components/views/voip/AudioFeedArrayForCall.tsx index 958ac2a8d4..a7dd0283ff 100644 --- a/src/components/views/voip/AudioFeedArrayForCall.tsx +++ b/src/components/views/voip/AudioFeedArrayForCall.tsx @@ -32,7 +32,7 @@ export default class AudioFeedArrayForCall extends React.Component Date: Tue, 17 Aug 2021 09:51:48 +0200 Subject: [PATCH 33/43] Properly listen for call_state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous thing should have never worked, since CallsChanged doesn't get emitted when a call is answered Signed-off-by: Šimon Brandner --- src/components/structures/LoggedInView.tsx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 85fca1ae77..4a8b77abec 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -55,7 +55,7 @@ import { getKeyBindingsManager, NavigationAction, RoomAction } from '../../KeyBi import { IOpts } from "../../createRoom"; import SpacePanel from "../views/spaces/SpacePanel"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import CallHandler, { CallHandlerEvent } from '../../CallHandler'; +import CallHandler from '../../CallHandler'; import { MatrixCall } from 'matrix-js-sdk/src/webrtc/call'; import AudioFeedArrayForCall from '../views/voip/AudioFeedArrayForCall'; import RoomView from './RoomView'; @@ -142,6 +142,7 @@ interface IState { class LoggedInView extends React.Component { static displayName = 'LoggedInView'; + private dispatcherRef: string; protected readonly _matrixClient: MatrixClient; protected readonly _roomView: React.RefObject; protected readonly _resizeContainer: React.RefObject; @@ -172,7 +173,7 @@ class LoggedInView extends React.Component { componentDidMount() { document.addEventListener('keydown', this.onNativeKeyDown, false); - CallHandler.sharedInstance().addListener(CallHandlerEvent.CallsChanged, this.onCallsChanged); + this.dispatcherRef = dis.register(this.onAction); this.updateServerNoticeEvents(); @@ -197,7 +198,7 @@ class LoggedInView extends React.Component { componentWillUnmount() { document.removeEventListener('keydown', this.onNativeKeyDown, false); - CallHandler.sharedInstance().removeListener(CallHandlerEvent.CallsChanged, this.onCallsChanged); + dis.unregister(this.dispatcherRef); this._matrixClient.removeListener("accountData", this.onAccountData); this._matrixClient.removeListener("sync", this.onSync); this._matrixClient.removeListener("RoomState.events", this.onRoomStateEvents); @@ -205,10 +206,16 @@ class LoggedInView extends React.Component { this.resizer.detach(); } - private onCallsChanged = () => { - this.setState({ - activeCalls: CallHandler.sharedInstance().getAllActiveCalls(), - }); + private onAction = (payload): void => { + switch (payload.action) { + case 'call_state': { + const activeCalls = CallHandler.sharedInstance().getAllActiveCalls(); + if (activeCalls !== this.state.activeCalls) { + this.setState({ activeCalls }); + } + break; + } + } }; public canResetTimelineInRoom = (roomId: string) => { From 1d664f091431fd4303ea10b55857ebd8fe51f25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 17 Aug 2021 10:23:54 +0200 Subject: [PATCH 34/43] Explicitly handle first state change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/CallHandler.tsx | 165 +++++++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 79 deletions(-) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index f2142f56f4..e11e828864 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -464,85 +464,7 @@ export default class CallHandler extends EventEmitter { this.removeCallForRoom(mappedRoomId); }); call.on(CallEvent.State, (newState: CallState, oldState: CallState) => { - if (!this.matchesCallForThisRoom(call)) return; - - this.setCallState(call, newState); - - switch (oldState) { - case CallState.Ringing: - this.pause(AudioID.Ring); - break; - case CallState.InviteSent: - this.pause(AudioID.Ringback); - break; - } - - if (newState !== CallState.Ringing) { - this.silencedCalls.delete(call.callId); - } - - switch (newState) { - case CallState.Ringing: { - const incomingCallPushRule = ( - new PushProcessor(MatrixClientPeg.get()).getPushRuleById(RuleId.IncomingCall) - ); - const pushRuleEnabled = incomingCallPushRule?.enabled; - const tweakSetToRing = incomingCallPushRule?.actions.some((action: Tweaks) => ( - action.set_tweak === TweakName.Sound && - action.value === "ring" - )); - - if (pushRuleEnabled && tweakSetToRing) { - this.play(AudioID.Ring); - } else { - this.silenceCall(call.callId); - } - break; - } - case CallState.InviteSent: { - this.play(AudioID.Ringback); - break; - } - case CallState.Ended: { - const hangupReason = call.hangupReason; - Analytics.trackEvent('voip', 'callEnded', 'hangupReason', hangupReason); - this.removeCallForRoom(mappedRoomId); - if (oldState === CallState.InviteSent && call.hangupParty === CallParty.Remote) { - this.play(AudioID.Busy); - - // Don't show a modal when we got rejected/the call was hung up - if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) break; - - let title; - let description; - // TODO: We should either do away with these or figure out a copy for each code (expect user_hangup...) - if (call.hangupReason === CallErrorCode.UserBusy) { - title = _t("User Busy"); - description = _t("The user you called is busy."); - } else { - title = _t("Call Failed"); - description = _t("The call could not be established"); - } - - Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { - title, description, - }); - } else if ( - hangupReason === CallErrorCode.AnsweredElsewhere && oldState === CallState.Connecting - ) { - Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { - title: _t("Answered Elsewhere"), - description: _t("The call was answered on another device."), - }); - } else if (oldState !== CallState.Fledgling && oldState !== CallState.Ringing) { - // don't play the end-call sound for calls that never got off the ground - this.play(AudioID.CallEnd); - } - - this.logCallStats(call, mappedRoomId); - break; - } - } + this.onCallStateChanged(newState, oldState, call); }); call.on(CallEvent.Replaced, (newCall: MatrixCall) => { if (!this.matchesCallForThisRoom(call)) return; @@ -598,6 +520,89 @@ export default class CallHandler extends EventEmitter { }); } + private onCallStateChanged = (newState: CallState, oldState: CallState, call: MatrixCall): void => { + if (!this.matchesCallForThisRoom(call)) return; + + const mappedRoomId = this.roomIdForCall(call); + this.setCallState(call, newState); + + switch (oldState) { + case CallState.Ringing: + this.pause(AudioID.Ring); + break; + case CallState.InviteSent: + this.pause(AudioID.Ringback); + break; + } + + if (newState !== CallState.Ringing) { + this.silencedCalls.delete(call.callId); + } + + switch (newState) { + case CallState.Ringing: { + const incomingCallPushRule = ( + new PushProcessor(MatrixClientPeg.get()).getPushRuleById(RuleId.IncomingCall) + ); + const pushRuleEnabled = incomingCallPushRule?.enabled; + const tweakSetToRing = incomingCallPushRule?.actions.some((action: Tweaks) => ( + action.set_tweak === TweakName.Sound && + action.value === "ring" + )); + + if (pushRuleEnabled && tweakSetToRing) { + this.play(AudioID.Ring); + } else { + this.silenceCall(call.callId); + } + break; + } + case CallState.InviteSent: { + this.play(AudioID.Ringback); + break; + } + case CallState.Ended: { + const hangupReason = call.hangupReason; + Analytics.trackEvent('voip', 'callEnded', 'hangupReason', hangupReason); + this.removeCallForRoom(mappedRoomId); + if (oldState === CallState.InviteSent && call.hangupParty === CallParty.Remote) { + this.play(AudioID.Busy); + + // Don't show a modal when we got rejected/the call was hung up + if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) break; + + let title; + let description; + // TODO: We should either do away with these or figure out a copy for each code (expect user_hangup...) + if (call.hangupReason === CallErrorCode.UserBusy) { + title = _t("User Busy"); + description = _t("The user you called is busy."); + } else { + title = _t("Call Failed"); + description = _t("The call could not be established"); + } + + Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { + title, description, + }); + } else if ( + hangupReason === CallErrorCode.AnsweredElsewhere && oldState === CallState.Connecting + ) { + Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { + title: _t("Answered Elsewhere"), + description: _t("The call was answered on another device."), + }); + } else if (oldState !== CallState.Fledgling && oldState !== CallState.Ringing) { + // don't play the end-call sound for calls that never got off the ground + this.play(AudioID.CallEnd); + } + + this.logCallStats(call, mappedRoomId); + break; + } + } + }; + private async logCallStats(call: MatrixCall, mappedRoomId: string) { const stats = await call.getCurrentCallStats(); logger.debug( @@ -861,6 +866,8 @@ export default class CallHandler extends EventEmitter { this.calls.set(mappedRoomId, call); this.emit(CallHandlerEvent.CallsChanged, this.calls); this.setCallListeners(call); + // Explicitly handle first state change + this.onCallStateChanged(call.state, null, call); // get ready to send encrypted events in the room, so if the user does answer // the call, we'll be ready to send. NB. This is the protocol-level room ID not From 6e82b064eca68b33b34b909a4a850c3554c12e65 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 17 Aug 2021 09:29:20 +0100 Subject: [PATCH 35/43] Upgrade matrix-js-sdk to 12.3.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 00b187defb..85706ff9d1 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.20", - "matrix-js-sdk": "12.3.0", + "matrix-js-sdk": "12.3.1", "matrix-widget-api": "^0.1.0-beta.15", "minimist": "^1.2.5", "opus-recorder": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index 61207aa03d..1c425e205c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5738,10 +5738,10 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@12.3.0: - version "12.3.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.3.0.tgz#b4de14e9c26257e3137eb020b6b13678b01e37d7" - integrity sha512-ywdlpVnwTiddLCvh/sKaZ0/0CVTqqbKPsfpsKduH9GWzwXA/Jrkwt//ryU8l9MjJTrjLnwxTYgnjZgeEp4h5kQ== +matrix-js-sdk@12.3.1: + version "12.3.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.3.1.tgz#efa9172e96722afb03cb0e866b047022a7c6cb17" + integrity sha512-ysF6FQIjz8NaQHpXRs0VD1uh5kNi4tZh7NNPq54nS9YoDC7F681n2srFhoQn4M/Bv5tBLWWGNjKufXTLHp5j5g== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 19746f7ac193e73a5d6c4ed5b0284ea858ff1f06 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 17 Aug 2021 09:40:10 +0100 Subject: [PATCH 36/43] Prepare changelog for v3.28.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a1956fe4..6f71c1414c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [3.28.1](https://github.com/vector-im/element-desktop/releases/tag/v3.28.1) (2021-08-17) +=================================================================================================== + +## 🐛 Bug Fixes + * Fix multiple VoIP regressions ([matrix-org/matrix-js-sdk#1860](https://github.com/matrix-org/matrix-js-sdk/pull/1860)). + Changes in [3.28.0](https://github.com/vector-im/element-desktop/releases/tag/v3.28.0) (2021-08-16) =================================================================================================== From 0dd479c46646971627796c1473ffe4f40566669e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 17 Aug 2021 09:40:11 +0100 Subject: [PATCH 37/43] v3.28.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85706ff9d1..e875ca28b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.28.0", + "version": "3.28.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From d5ffdf119673456746ca0f22aa828ecd749265d2 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 17 Aug 2021 09:42:20 +0100 Subject: [PATCH 38/43] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- yarn.lock | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 570c7d85b1..985a4210c1 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "katex": "^0.12.0", "linkifyjs": "^2.1.9", "lodash": "^4.17.20", - "matrix-js-sdk": "12.3.1", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "matrix-widget-api": "^0.1.0-beta.15", "minimist": "^1.2.5", "opus-recorder": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index 1c425e205c..5410819c06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5738,10 +5738,9 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@12.3.1: +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "12.3.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-12.3.1.tgz#efa9172e96722afb03cb0e866b047022a7c6cb17" - integrity sha512-ysF6FQIjz8NaQHpXRs0VD1uh5kNi4tZh7NNPq54nS9YoDC7F681n2srFhoQn4M/Bv5tBLWWGNjKufXTLHp5j5g== + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/3216d7e5a7a333212b00d4d7578e29a9f0e247d8" dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" From 0d9e27f34a9b338b47f1bf657f257d620c152566 Mon Sep 17 00:00:00 2001 From: James Salter Date: Tue, 17 Aug 2021 15:58:14 +0100 Subject: [PATCH 39/43] Fix import --- src/sentry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry.ts b/src/sentry.ts index 3cded20a83..b0fd00cfbe 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -19,7 +19,7 @@ import PlatformPeg from "./PlatformPeg"; import SdkConfig from "./SdkConfig"; import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; -import { MatrixClient } from "../../matrix-js-sdk"; +import { MatrixClient } from "matrix-js-sdk"; async function getStorageOptions(): Promise> { const result = {}; From f5cbc9f598119f5283fd120d13c496a46732ce3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 18 Aug 2021 10:02:42 +0200 Subject: [PATCH 40/43] Fix pagination and improve typing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/indexing/EventIndex.ts | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index a7142010f2..e3deb7510d 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -21,7 +21,7 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import { MatrixEvent } from 'matrix-js-sdk/src/models/event'; import { EventTimelineSet } from 'matrix-js-sdk/src/models/event-timeline-set'; import { RoomState } from 'matrix-js-sdk/src/models/room-state'; -import { TimelineWindow } from 'matrix-js-sdk/src/timeline-window'; +import { TimelineIndex, TimelineWindow } from 'matrix-js-sdk/src/timeline-window'; import { sleep } from "matrix-js-sdk/src/utils"; import { IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; @@ -859,13 +859,27 @@ export default class EventIndex extends EventEmitter { return Promise.resolve(true); } - const paginationMethod = async (timelineWindow, timeline, room, direction, limit) => { - const timelineSet = timelineWindow._timelineSet; - const token = timeline.timeline.getPaginationToken(direction); + const paginationMethod = async ( + timelineWindow: TimelineWindow, + timelineIndex: TimelineIndex, + room: Room, + direction: Direction, + limit: number, + ) => { + const timeline = timelineIndex.timeline; + const timelineSet = timeline.getTimelineSet(); + const token = timeline.getPaginationToken(direction); - const ret = await this.populateFileTimeline(timelineSet, timeline.timeline, room, limit, token, direction); + const ret = await this.populateFileTimeline( + timelineSet, + timeline, + room, + limit, + token, + direction, + ); - timeline.pendingPaginate = null; + timelineIndex.pendingPaginate = null; timelineWindow.extend(direction, limit); return ret; From ecd142f2a5503a7f7ed4fdaa47dd0b3f2dd28e10 Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 18 Aug 2021 09:21:57 +0100 Subject: [PATCH 41/43] Add type declarations --- src/sentry.ts | 62 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/src/sentry.ts b/src/sentry.ts index b0fd00cfbe..59152f66f2 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -21,7 +21,52 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; import { MatrixClient } from "matrix-js-sdk"; -async function getStorageOptions(): Promise> { +/* eslint-disable camelcase */ + +type StorageContext = { + storageManager_persisted?: string; + storageManager_quota?: string; + storageManager_usage?: string; + storageManager_usageDetails?: string; +}; + +type UserContext = { + username: string; + enabled_labs: string; + low_bandwidth: string; +}; + +type CryptoContext = { + device_keys?: string; + cross_signing_ready?: string; + cross_signing_supported_by_hs?: string; + cross_signing_key?: string; + cross_signing_privkey_in_secret_storage?: string; + cross_signing_master_privkey_cached?: string; + cross_signing_user_signing_privkey_cached?: string; + secret_storage_ready?: string; + secret_storage_key_in_account?: string; + session_backup_key_in_secret_storage?: string; + session_backup_key_cached?: string; + session_backup_key_well_formed?: string; +}; + +type DeviceContext = { + device_id: string; + mx_local_settings: string; + modernizr_missing_features?: string; +}; + +type Contexts = { + user: UserContext; + crypto: CryptoContext; + device: DeviceContext; + storage: StorageContext; +}; + +/* eslint-enable camelcase */ + +async function getStorageContext(): Promise { const result = {}; // add storage persistence/quota information @@ -40,9 +85,11 @@ async function getStorageOptions(): Promise> { result["storageManager_quota"] = String(estimate.quota); result["storageManager_usage"] = String(estimate.usage); if (estimate.usageDetails) { + const usageDetails = []; Object.keys(estimate.usageDetails).forEach(k => { - result[`storageManager_usage_${k}`] = String(estimate.usageDetails[k]); + usageDetails.push(`${k}: ${String(estimate.usageDetails[k])}`); }); + result[`storageManager_usage`] = usageDetails.join(", "); } } catch (e) {} } @@ -50,7 +97,7 @@ async function getStorageOptions(): Promise> { return result; } -function getUserContext(client: MatrixClient): Record { +function getUserContext(client: MatrixClient): UserContext { return { "username": client.credentials.userId, "enabled_labs": getEnabledLabs(), @@ -63,9 +110,10 @@ function getEnabledLabs(): string { if (enabledLabs.length) { return enabledLabs.join(", "); } + return ""; } -async function getCryptoContext(client: MatrixClient): Promise> { +async function getCryptoContext(client: MatrixClient): Promise { if (!client.isCryptoEnabled()) { return {}; } @@ -98,7 +146,7 @@ async function getCryptoContext(client: MatrixClient): Promise { +function getDeviceContext(client: MatrixClient): DeviceContext { const result = { "device_id": client?.deviceId, "mx_local_settings": localStorage.getItem('mx_local_settings'), @@ -114,13 +162,13 @@ function getDeviceContext(client: MatrixClient): Record { return result; } -async function getContexts(): Promise> { +async function getContexts(): Promise { const client = MatrixClientPeg.get(); return { "user": getUserContext(client), "crypto": await getCryptoContext(client), "device": getDeviceContext(client), - "storage": await getStorageOptions(), + "storage": await getStorageContext(), }; } From d836ed529182dce8248a653ab6e9a61d0a471383 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 18 Aug 2021 14:19:44 +0100 Subject: [PATCH 42/43] Fix name of Netlify workflow --- .github/workflows/{netflify.yaml => netlify.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{netflify.yaml => netlify.yaml} (100%) diff --git a/.github/workflows/netflify.yaml b/.github/workflows/netlify.yaml similarity index 100% rename from .github/workflows/netflify.yaml rename to .github/workflows/netlify.yaml From 23f70836b613dbe7142a1ac573c8a42875ded493 Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 18 Aug 2021 17:05:15 +0100 Subject: [PATCH 43/43] Update copy to indicate debug logs contain which UI elements you last interacted with --- src/components/views/dialogs/BugReportDialog.tsx | 4 ++-- src/components/views/elements/ErrorBoundary.tsx | 5 +++-- .../views/settings/tabs/user/HelpUserSettingsTab.tsx | 3 ++- src/i18n/strings/en_EN.json | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index cdb463976a..8f22c7ca9a 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -204,8 +204,8 @@ export default class BugReportDialog extends React.Component { { _t( "Debug logs contain application usage data including your " + "username, the IDs or aliases of the rooms or groups you " + - "have visited and the usernames of other users. They do " + - "not contain messages.", + "have visited, which UI elements you last interacted with, " + + "and the usernames of other users. They do not contain messages.", ) }

diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index 926d3da30c..03d331bd9f 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -94,8 +94,9 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> { "If you've submitted a bug via GitHub, debug logs can help " + "us track down the problem. Debug logs contain application " + "usage data including your username, the IDs or aliases of " + - "the rooms or groups you have visited and the usernames of " + - "other users. They do not contain messages.", + "the rooms or groups you have visited, which UI elements you " + + "last interacted with, and the usernames of other users. " + + "They do not contain messages.", ) }

{ _t("Submit debug logs") } diff --git a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index 904fdf0914..6984ccc6f3 100644 --- a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -268,7 +268,8 @@ export default class HelpUserSettingsTab extends React.Component "If you've submitted a bug via GitHub, debug logs can help " + "us track down the problem. Debug logs contain application " + "usage data including your username, the IDs or aliases of " + - "the rooms or groups you have visited and the usernames of " + + "the rooms or groups you have visited, which UI elements you " + + "last interacted with, and the usernames of " + "other users. They do not contain messages.", ) }
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index bf352a6294..e3b1978bee 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1291,7 +1291,7 @@ "For help with using %(brand)s, click here or start a chat with our bot using the button below.": "For help with using %(brand)s, click here or start a chat with our bot using the button below.", "Chat with %(brand)s Bot": "Chat with %(brand)s Bot", "Bug reporting": "Bug reporting", - "If you've submitted a bug via GitHub, debug logs can help us track down the problem. Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.": "If you've submitted a bug via GitHub, debug logs can help us track down the problem. Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.", + "If you've submitted a bug via GitHub, debug logs can help us track down the problem. Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages.": "If you've submitted a bug via GitHub, debug logs can help us track down the problem. Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages.", "Submit debug logs": "Submit debug logs", "To report a Matrix-related security issue, please read the Matrix.org Security Disclosure Policy.": "To report a Matrix-related security issue, please read the Matrix.org Security Disclosure Policy.", "Help & About": "Help & About", @@ -2168,7 +2168,7 @@ "Failed to send logs: ": "Failed to send logs: ", "Preparing to download logs": "Preparing to download logs", "Reminder: Your browser is unsupported, so your experience may be unpredictable.": "Reminder: Your browser is unsupported, so your experience may be unpredictable.", - "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.": "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.", + "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages.": "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages.", "Before submitting logs, you must create a GitHub issue to describe your problem.": "Before submitting logs, you must create a GitHub issue to describe your problem.", "Download logs": "Download logs", "GitHub issue": "GitHub issue",