Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

refactor(desktop): remove uncalled web request hook cleanup

Hampus8789cc59df1e
diff --git a/fluxer_desktop/src/main/DesktopRuntimeSecurity.ts b/fluxer_desktop/src/main/DesktopRuntimeSecurity.ts
index 158e1c35f..956597def 100644
--- a/fluxer_desktop/src/main/DesktopRuntimeSecurity.ts
+++ b/fluxer_desktop/src/main/DesktopRuntimeSecurity.ts
@@ -27,13 +27,6 @@ interface DesktopRuntimeSecurityDependencies {
readonly localAppAuthorization?: DesktopLocalAppRequestAuthorization;
}
-class DesktopRuntimeSecurityClosedError extends Error {
- constructor() {
- super('Desktop runtime security policy is closed');
- this.name = 'DesktopRuntimeSecurityClosedError';
- }
-}
-
class InvalidWebRequestDetailsError extends TypeError {
constructor() {
super('Electron web request details have an invalid shape');
@@ -52,7 +45,6 @@ export class DesktopRuntimeSecurity {
private readonly logger: DesktopRuntimeSecurityLogger;
private readonly localAppAuthorization: DesktopLocalAppRequestAuthorization | null;
private readonly installedSessions = new Set<Electron.Session>();
- private acceptingChanges = true;
constructor(dependencies: DesktopRuntimeSecurityDependencies) {
this.logger = dependencies.logger;
@@ -60,7 +52,6 @@ export class DesktopRuntimeSecurity {
}
install(session: Electron.Session): void {
- this.requireAcceptingChanges();
if (this.installedSessions.has(session)) {
return;
}
@@ -78,13 +69,6 @@ export class DesktopRuntimeSecurity {
}
}
- cleanup(): void {
- this.acceptingChanges = false;
- for (const session of this.installedSessions) {
- this.uninstall(session);
- }
- }
-
private uninstall(session: Electron.Session): void {
this.installedSessions.delete(session);
try {
@@ -94,12 +78,6 @@ export class DesktopRuntimeSecurity {
}
}
- private requireAcceptingChanges(): void {
- if (!this.acceptingChanges) {
- throw new DesktopRuntimeSecurityClosedError();
- }
- }
-
private settleRequestHeaders(detailsValue: unknown, callbackValue: unknown): void {
let settlement: Record<string, unknown> = {};
try {