feat(desktop): stop the daemon when you quit the app (#2454)

Quitting the desktop app now shuts down the daemon it started, so
"restart the app" is a complete reset users can act on without first
learning what a daemon is. The old default kept it alive; the toggle
under Settings > Host still opts back in.

Existing installs already persisted `keepRunningAfterQuit: true` from
the old default, so a new default alone would only reach fresh installs.
A one-time migration resets it, and an explicit toggle afterwards
persists the migration flag and is never overridden again.

Only a desktop-managed daemon is stopped — one started with
`paseo daemon start` is left alone.
This commit is contained in:
Mohamed Boudra
2026-07-26 21:55:37 +02:00
committed by GitHub
parent fe28850fad
commit 392095c1b2
7 changed files with 67 additions and 9 deletions
@@ -7,12 +7,12 @@ import {
stopDesktopManagedDaemonOnQuitIfNeeded,
} from "./quit-lifecycle";
const SETTINGS_KEEP_RUNNING = DEFAULT_DESKTOP_SETTINGS;
const SETTINGS_STOP_ON_QUIT = {
const SETTINGS_STOP_ON_QUIT = DEFAULT_DESKTOP_SETTINGS;
const SETTINGS_KEEP_RUNNING = {
...DEFAULT_DESKTOP_SETTINGS,
daemon: {
...DEFAULT_DESKTOP_SETTINGS.daemon,
keepRunningAfterQuit: false,
keepRunningAfterQuit: true,
},
};
@@ -29,7 +29,7 @@ function waitForQuitLifecycle(): Promise<void> {
}
describe("quit-lifecycle", () => {
it("only stops when keepRunningAfterQuit is explicitly disabled", () => {
it("stops by default and only keeps running when keepRunningAfterQuit is enabled", () => {
expect(shouldStopDesktopManagedDaemonOnQuit(SETTINGS_STOP_ON_QUIT)).toBe(true);
expect(shouldStopDesktopManagedDaemonOnQuit(SETTINGS_KEEP_RUNNING)).toBe(false);
});