Skip to content

Commit 1dbb6b6

Browse files
committed
fix: use app.exit(0) instead of app.quit() when duplicate instance detected
When requestSingleInstanceLock returns false, app.quit() only schedules an asynchronous shutdown but does not stop the current Effect pipeline. This allows the startup sequence in DesktopApp to continue with whenReady, backend bootstrap, and window creation — potentially causing port conflicts and duplicate backends. app.exit(0) immediately terminates the process, which is the correct behavior for a duplicate instance with no windows or state to clean up.
1 parent 640dc63 commit 1dbb6b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/desktop/src/app/DesktopCloudAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ const make = Effect.gen(function* () {
292292

293293
const hasInstanceLock = yield* electronApp.requestSingleInstanceLock;
294294
if (!hasInstanceLock) {
295-
return yield* electronApp.quit;
295+
return yield* electronApp.exit(0);
296296
}
297297

298298
yield* electronApp.on<[Electron.Event, string]>("open-url", (event, rawUrl) => {

0 commit comments

Comments
 (0)