Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/DeviceListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,6 @@ export default class DeviceListener extends TypedEventEmitter<DeviceListenerEven
if (allSystemsReady) {
logSpan.info("No toast needed");
await this.setDeviceState("ok", logSpan);

this.checkKeyBackupStatus();
} else {
// make sure our keys are finished downloading
await crypto.getUserDeviceInfo([cli.getSafeUserId()]);
Expand Down Expand Up @@ -549,9 +547,6 @@ export default class DeviceListener extends TypedEventEmitter<DeviceListenerEven
});
await this.setDeviceState("key_storage_out_of_sync", logSpan);
}
if (this.dismissedThisDeviceToast) {
this.checkKeyBackupStatus();
}
}

// This needs to be done after awaiting on getUserDeviceInfo() above, so
Expand Down Expand Up @@ -733,16 +728,6 @@ export default class DeviceListener extends TypedEventEmitter<DeviceListenerEven
});
}

/**
* Check if key backup is enabled, and if not, raise an `Action.ReportKeyBackupNotEnabled` event (which will
* trigger an auto-rageshake).
*/
private checkKeyBackupStatus = async (): Promise<void> => {
if (!(await this.isKeyBackupUploadActive(logger))) {
dis.dispatch({ action: Action.ReportKeyBackupNotEnabled });
}
};

/**
* Is key backup enabled? Use a cached answer if we have one.
*/
Expand Down
6 changes: 0 additions & 6 deletions src/dispatcher/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,6 @@ export enum Action {
*/
PseudonymousAnalyticsReject = "pseudonymous_analytics_reject",

/**
* Fires after crypto is setup if key backup is not enabled
* Used to trigger auto rageshakes when configured
*/
ReportKeyBackupNotEnabled = "report_key_backup_not_enabled",

/**
* Dispatched after leave room or space is finished
*/
Expand Down
1 change: 0 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,6 @@
"ask_to_join": "Enable ask to join",
"automatic_debug_logs": "Automatically send debug logs on any error",
"automatic_debug_logs_decryption": "Automatically send debug logs on decryption errors",
"automatic_debug_logs_key_backup": "Automatically send debug logs when key backup is not functioning",
"beta_description": "What's next for %(brand)s? Labs are the best way to get things early, test out new features and help shape them before they actually launch.",
"beta_feature": "This is a beta feature",
"beta_feedback_leave_button": "To leave the beta, visit your settings.",
Expand Down
6 changes: 0 additions & 6 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ export interface Settings {
"developerMode": IBaseSetting<boolean>;
"automaticErrorReporting": IBaseSetting<boolean>;
"automaticDecryptionErrorReporting": IBaseSetting<boolean>;
"automaticKeyBackNotEnabledReporting": IBaseSetting<boolean>;
"debug_scroll_panel": IBaseSetting<boolean>;
"debug_timeline_panel": IBaseSetting<boolean>;
"debug_registration": IBaseSetting<boolean>;
Expand Down Expand Up @@ -1320,11 +1319,6 @@ export const SETTINGS: Settings = {
default: false,
controller: new ReloadOnChangeController(),
},
"automaticKeyBackNotEnabledReporting": {
displayName: _td("labs|automatic_debug_logs_key_backup"),
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: false,
},
"debug_scroll_panel": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
Expand Down
18 changes: 1 addition & 17 deletions src/stores/AutoRageshakeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import defaultDispatcher from "../dispatcher/dispatcher";
import { AsyncStoreWithClient } from "./AsyncStoreWithClient";
import { type 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;
Expand Down Expand Up @@ -66,12 +65,7 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
return AutoRageshakeStore.internalInstance;
}

protected async onAction(payload: ActionPayload): Promise<void> {
switch (payload.action) {
case Action.ReportKeyBackupNotEnabled:
this.onReportKeyBackupNotEnabled();
}
}
protected async onAction(_payload: ActionPayload): Promise<void> {}

protected async onReady(): Promise<void> {
if (!SettingsStore.getValue("automaticDecryptionErrorReporting")) return;
Expand Down Expand Up @@ -187,16 +181,6 @@ 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;
23 changes: 0 additions & 23 deletions test/unit-tests/DeviceListener-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import * as SetupEncryptionToast from "../../src/toasts/SetupEncryptionToast";
import * as UnverifiedSessionToast from "../../src/toasts/UnverifiedSessionToast";
import * as BulkUnverifiedSessionsToast from "../../src/toasts/BulkUnverifiedSessionsToast";
import { isSecretStorageBeingAccessed } from "../../src/SecurityManager";
import dis from "../../src/dispatcher/dispatcher";
import { Action } from "../../src/dispatcher/actions";
import SettingsStore from "../../src/settings/SettingsStore";
import { SettingLevel } from "../../src/settings/SettingLevel";
Expand All @@ -57,7 +56,6 @@ jest.mock("../../src/utils/device/snoozeBulkUnverifiedDeviceReminder", () => ({

const userId = "@user:server";
const deviceId = "my-device-id";
const mockDispatcher = mocked(dis);
const flushPromises = async () => await new Promise(process.nextTick);

const readySecretStorageStatus: SecretStorageStatus = {
Expand Down Expand Up @@ -498,27 +496,6 @@ describe("DeviceListener", () => {
expect(mockCrypto.getActiveSessionBackupVersion).toHaveBeenCalled();
});

it("dispatches keybackup event when key backup is not enabled", async () => {
mockCrypto!.isCrossSigningReady.mockResolvedValue(true);

// current device is verified
mockCrypto!.getDeviceVerificationStatus.mockResolvedValue(
new DeviceVerificationStatus({
trustCrossSignedDevices: true,
crossSigningVerified: true,
}),
);

mockCrypto.getActiveSessionBackupVersion.mockResolvedValue(null);
mockClient.getAccountDataFromServer.mockImplementation((eventType) =>
eventType === BACKUP_DISABLED_ACCOUNT_DATA_KEY ? ({ disabled: true } as any) : null,
);
await createAndStart();
expect(mockDispatcher.dispatch).toHaveBeenCalledWith({
action: Action.ReportKeyBackupNotEnabled,
});
});

it("does not check key backup status again after check is complete", async () => {
mockCrypto.getActiveSessionBackupVersion.mockResolvedValue("1");
const instance = await createAndStart();
Expand Down
Loading