feat(system): enable window destroy capability and stabilize shutdown
publish / Build and publish Ubuntu AppImage (release) Successful in 22m40s
publish / Build and publish Windows installer (release) Successful in 31m3s
publish / Build and publish gitty-desktop to AUR (release) Successful in 50m26s

Adds a new window capability to allow destroying the window.
It also changes shutdown handling in telemetry to avoid errors.

- Add core:window:allow-destroy to default capabilities
- Avoid shutdown errors by returning a pending promise in tracedInvoke
- Improve stability during shutdown for in-flight telemetry calls
This commit is contained in:
Christoph Brandau
2026-08-13 22:11:45 +02:00
parent 56467f481d
commit f621638eb3
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -9,6 +9,7 @@
"core:window:allow-toggle-maximize", "core:window:allow-toggle-maximize",
"core:window:allow-unminimize", "core:window:allow-unminimize",
"core:window:allow-close", "core:window:allow-close",
"core:window:allow-destroy",
"core:window:allow-is-maximized", "core:window:allow-is-maximized",
"core:window:allow-start-dragging", "core:window:allow-start-dragging",
"dialog:allow-open", "dialog:allow-open",
+6 -1
View File
@@ -48,7 +48,12 @@ function randomHex(bytes: number): string {
export async function tracedInvoke<T>(command: string, args?: Record<string, unknown>): Promise<T> { export async function tracedInvoke<T>(command: string, args?: Record<string, unknown>): Promise<T> {
if (frontendShuttingDown) { 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<T>(() => {});
} }
if (!telemetryEnabled) return invoke<T>(command, args); if (!telemetryEnabled) return invoke<T>(command, args);
const startedAtMs = Date.now(); const startedAtMs = Date.now();