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.
This commit is contained in:
Faye Duxovni 2022-01-26 14:30:45 -05:00 committed by GitHub
parent 2f209c4346
commit 31e6b942f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

View file

@ -96,7 +96,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
userText, userText,
sendLogs: true, sendLogs: true,
progressCallback: this.sendProgressCallback, progressCallback: this.sendProgressCallback,
label: this.props.label, labels: [this.props.label],
}).then(() => { }).then(() => {
if (!this.unmounted) { if (!this.unmounted) {
this.props.onFinished(false); this.props.onFinished(false);
@ -128,7 +128,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
await downloadBugReport({ await downloadBugReport({
sendLogs: true, sendLogs: true,
progressCallback: this.downloadProgressCallback, progressCallback: this.downloadProgressCallback,
label: this.props.label, labels: [this.props.label],
}); });
this.setState({ this.setState({

View file

@ -28,10 +28,11 @@ import SettingsStore from "../settings/SettingsStore";
import SdkConfig from "../SdkConfig"; import SdkConfig from "../SdkConfig";
interface IOpts { interface IOpts {
label?: string; labels?: string[];
userText?: string; userText?: string;
sendLogs?: boolean; sendLogs?: boolean;
progressCallback?: (s: string) => void; progressCallback?: (s: string) => void;
customApp?: string;
customFields?: Record<string, string>; customFields?: Record<string, string>;
} }
@ -67,7 +68,7 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true) {
const body = new FormData(); const body = new FormData();
body.append('text', opts.userText || "User did not supply any additional text."); body.append('text', opts.userText || "User did not supply any additional text.");
body.append('app', 'element-web'); body.append('app', opts.customApp || 'element-web');
body.append('version', version); body.append('version', version);
body.append('user_agent', userAgent); body.append('user_agent', userAgent);
body.append('installed_pwa', installedPWA); body.append('installed_pwa', installedPWA);
@ -120,8 +121,10 @@ async function collectBugReport(opts: IOpts = {}, gzipLogs = true) {
} }
} }
if (opts.label) { if (opts.labels) {
body.append('label', opts.label); for (const label of opts.labels) {
body.append('label', label);
}
} }
// add labs options // add labs options

View file

@ -98,7 +98,8 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
const rageshakeURL = await sendBugReport(SdkConfig.get().bug_report_endpoint_url, { const rageshakeURL = await sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
userText: "Auto-reporting decryption error (recipient)", userText: "Auto-reporting decryption error (recipient)",
sendLogs: true, sendLogs: true,
label: "Z-UISI", labels: ["Z-UISI", "web", "uisi-recipient"],
customApp: SdkConfig.get().uisi_autorageshake_app,
customFields: { "auto_uisi": JSON.stringify(eventInfo) }, customFields: { "auto_uisi": JSON.stringify(eventInfo) },
}); });
@ -123,7 +124,8 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
await sendBugReport(SdkConfig.get().bug_report_endpoint_url, { await sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
userText: `Auto-reporting decryption error (sender)\nRecipient rageshake: ${recipientRageshake}`, userText: `Auto-reporting decryption error (sender)\nRecipient rageshake: ${recipientRageshake}`,
sendLogs: true, sendLogs: true,
label: "Z-UISI", labels: ["Z-UISI", "web", "uisi-sender"],
customApp: SdkConfig.get().uisi_autorageshake_app,
customFields: { customFields: {
"recipient_rageshake": recipientRageshake, "recipient_rageshake": recipientRageshake,
"auto_uisi": JSON.stringify(messageContent), "auto_uisi": JSON.stringify(messageContent),