Add config option to autorageshake when key backup is not enabled (#7741)

* report on not enabled

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add setting

Signed-off-by: Kerry Archibald <kerrya@element.io>

* check key backup status after crypto init

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove log

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test encryption setup in DeviceListener

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* sendLogs for key backup auto-report event

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove reloadOnChagneController

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry 2022-02-11 14:00:37 +01:00 committed by GitHub
parent d06ec845ee
commit b5e7d12f76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 290 additions and 1 deletions

View file

@ -24,6 +24,7 @@ import defaultDispatcher from '../dispatcher/dispatcher';
import { AsyncStoreWithClient } from './AsyncStoreWithClient';
import { ActionPayload } from '../dispatcher/payloads';
import SettingsStore from "../settings/SettingsStore";
import { Action } from "../dispatcher/actions";
// Minimum interval of 1 minute between reports
const RAGESHAKE_INTERVAL = 60000;
@ -62,7 +63,10 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
}
protected async onAction(payload: ActionPayload) {
// we don't actually do anything here
switch (payload.action) {
case Action.ReportKeyBackupNotEnabled:
this.onReportKeyBackupNotEnabled();
}
}
protected async onReady() {
@ -152,6 +156,16 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
});
}
}
private async onReportKeyBackupNotEnabled(): Promise<void> {
if (!SettingsStore.getValue("automaticKeyBackNotEnabledReporting")) return;
await sendBugReport(SdkConfig.get().bug_report_endpoint_url, {
userText: `Auto-reporting key backup not enabled`,
sendLogs: true,
labels: ["web", Action.ReportKeyBackupNotEnabled],
});
}
}
window.mxAutoRageshakeStore = AutoRageshakeStore.instance;