diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index d2b1ecb..54bab96 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -9,6 +9,7 @@ "core:window:allow-toggle-maximize", "core:window:allow-unminimize", "core:window:allow-close", + "core:window:allow-destroy", "core:window:allow-is-maximized", "core:window:allow-start-dragging", "dialog:allow-open", diff --git a/src/lib/telemetry.ts b/src/lib/telemetry.ts index 9880dd5..08222c5 100644 --- a/src/lib/telemetry.ts +++ b/src/lib/telemetry.ts @@ -48,7 +48,12 @@ function randomHex(bytes: number): string { export async function tracedInvoke(command: string, args?: Record): Promise { if (frontendShuttingDown) { - throw new Error("Application is shutting down"); + // The window is on its way out and nothing calls preventDefault() on the + // close event, so it will finish closing regardless. Never resolving + // avoids surfacing a spurious "shutting down" error in whatever UI catch + // block happens to be awaiting an in-flight operation (e.g. a pull/push + // that makes several sequential calls) when the close request lands. + return new Promise(() => {}); } if (!telemetryEnabled) return invoke(command, args); const startedAtMs = Date.now();