Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(desktop): allow dev and production instances to coexist (#1155)

LinYushene3a1b951fb73
diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts
index 876d6fcb2c..1fd30736f4 100644
--- a/apps/desktop/src/main/index.ts
+++ b/apps/desktop/src/main/index.ts
@@ -94,6 +94,18 @@ function createWindow(): void {
}
}
+// --- Dev / production isolation -------------------------------------------
+// Give dev mode a separate app name and userData path so it gets its own
+// single-instance lock file and doesn't conflict with the packaged production
+// app. Must run BEFORE requestSingleInstanceLock() because the lock location
+// is derived from the userData path. (Same approach VS Code uses for
+// Stable / Insiders coexistence.)
+
+if (is.dev) {
+ app.setName("Multica Dev");
+ app.setPath("userData", join(app.getPath("appData"), "Multica Dev"));
+}
+
// --- Protocol registration -----------------------------------------------
if (process.defaultApp) {
@@ -125,7 +137,9 @@ if (!gotTheLock) {
});
app.whenReady().then(() => {
- electronApp.setAppUserModelId("ai.multica.desktop");
+ electronApp.setAppUserModelId(
+ is.dev ? "ai.multica.desktop.dev" : "ai.multica.desktop",
+ );
app.on("browser-window-created", (_, window) => {
optimizer.watchWindowShortcuts(window);