From e905abe5ce9b409973a4f8d2d16bea055581f159 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 9 Oct 2019 11:59:10 +0100 Subject: [PATCH] Add label to rageshakes for React soft crashes This adds a label all rageshakes submitted via the React error boundary marking them as soft crashes for triage. Fixes https://github.com/vector-im/riot-web/issues/11072 --- src/components/views/dialogs/BugReportDialog.js | 2 ++ src/components/views/elements/ErrorBoundary.js | 4 +++- src/rageshake/submit-rageshake.js | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index a72983427c..a3fe58a598 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -2,6 +2,7 @@ Copyright 2017 OpenMarket Ltd Copyright 2018 New Vector Ltd Copyright 2019 Michael Telatynski <7t3chguy@gmail.com> +Copyright 2019 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. @@ -71,6 +72,7 @@ export default class BugReportDialog extends React.Component { userText, sendLogs: true, progressCallback: this._sendProgressCallback, + label: this.props.label, }).then(() => { if (!this._unmounted) { this.props.onFinished(false); diff --git a/src/components/views/elements/ErrorBoundary.js b/src/components/views/elements/ErrorBoundary.js index 630b369caa..e53e1ec0fa 100644 --- a/src/components/views/elements/ErrorBoundary.js +++ b/src/components/views/elements/ErrorBoundary.js @@ -64,7 +64,9 @@ export default class ErrorBoundary extends React.PureComponent { if (!BugReportDialog) { return; } - Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, {}); + Modal.createTrackedDialog('Bug Report Dialog', '', BugReportDialog, { + label: 'react-soft-crash', + }); }; render() { diff --git a/src/rageshake/submit-rageshake.js b/src/rageshake/submit-rageshake.js index a93997a794..99c412a6ab 100644 --- a/src/rageshake/submit-rageshake.js +++ b/src/rageshake/submit-rageshake.js @@ -1,6 +1,7 @@ /* Copyright 2017 OpenMarket Ltd Copyright 2018 New Vector Ltd +Copyright 2019 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. @@ -81,6 +82,10 @@ export default async function sendBugReport(bugReportEndpoint, opts) { body.append('device_id', client.deviceId); } + if (opts.label) { + body.append('label', opts.label); + } + if (opts.sendLogs) { progressCallback(_t("Collecting logs")); const logs = await rageshake.getLogsForReport();