Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 31e6b94

Browse files
authored
Redirect UISI autorageshakes to separate repo and add more labels for filtering (#7598)
This adds a new key `uisi_autorageshake_app` to config.json, holding an optional custom app name for UISI autorageshakes so that the rageshake server can file them separately from user-submitted rageshakes.
1 parent 2f209c4 commit 31e6b94

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/components/views/dialogs/BugReportDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
9696
userText,
9797
sendLogs: true,
9898
progressCallback: this.sendProgressCallback,
99-
label: this.props.label,
99+
labels: [this.props.label],
100100
}).then(() => {
101101
if (!this.unmounted) {
102102
this.props.onFinished(false);
@@ -128,7 +128,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
128128
await downloadBugReport({
129129
sendLogs: true,
130130
progressCallback: this.downloadProgressCallback,
131-
label: this.props.label,
131+
labels: [this.props.label],
132132
});
133133

134134
this.setState({

src/rageshake/submit-rageshake.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ import SettingsStore from "../settings/SettingsStore";
2828
import SdkConfig from "../SdkConfig";
2929

3030
interface IOpts {
31-
label?: string;
31+
labels?: string[];
3232
userText?: string;
3333
sendLogs?: boolean;
3434
progressCallback?: (s: string) => void;
35+
customApp?: string;
3536
customFields?: Record<string, string>;
3637
}
3738

@@ -67,7 +68,7 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true) {
6768

6869
const body = new FormData();
6970
body.append('text', opts.userText || "User did not supply any additional text.");
70-
body.append('app', 'element-web');
71+
body.append('app', opts.customApp || 'element-web');
7172
body.append('version', version);
7273
body.append('user_agent', userAgent);
7374
body.append('installed_pwa', installedPWA);
@@ -120,8 +121,10 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true) {
120121
}
121122
}
122123

123-
if (opts.label) {
124-
body.append('label', opts.label);
124+
if (opts.labels) {
125+
for (const label of opts.labels) {
126+
body.append('label', label);
127+
}
125128
}
126129

127130
// add labs options

src/stores/AutoRageshakeStore.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
9898
const rageshakeURL = await sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
9999
userText: "Auto-reporting decryption error (recipient)",
100100
sendLogs: true,
101-
label: "Z-UISI",
101+
labels: ["Z-UISI", "web", "uisi-recipient"],
102+
customApp: SdkConfig.get().uisi_autorageshake_app,
102103
customFields: { "auto_uisi": JSON.stringify(eventInfo) },
103104
});
104105

@@ -123,7 +124,8 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
123124
await sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
124125
userText: `Auto-reporting decryption error (sender)\nRecipient rageshake: ${recipientRageshake}`,
125126
sendLogs: true,
126-
label: "Z-UISI",
127+
labels: ["Z-UISI", "web", "uisi-sender"],
128+
customApp: SdkConfig.get().uisi_autorageshake_app,
127129
customFields: {
128130
"recipient_rageshake": recipientRageshake,
129131
"auto_uisi": JSON.stringify(messageContent),

0 commit comments

Comments
 (0)