Originally created by: Akarsh-Hegde
The tray registers no single-instance guard (tray/src-tauri/src/lib.rs has positioner/notification/opener plugins, but not tauri-plugin-single-instance). macOS therefore lets a second copy of Meridian.app (com.meridiona.tray) run alongside the first instead of focusing the running one.
meridian.db reads and the MLX server (port 7823).backend_install::ensure_backend_installed), two instances could both run the launchd bootout/bootstrap dance on the same agents concurrently.Invisible on a clean single-launch install, which is why it's a papercut, not a release blocker — but a real first-run/relaunch annoyance to close before ship.
tauri-plugin-single-instance (v2, matches the 2.11 stack) to tray/src-tauri/Cargo.toml.Register it first in the builder with a callback that focuses/shows the existing tray + popover on a second launch:
:::rust
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
if let Some(win) = app.get_webview_window("main") {
let _ = win.show();
let _ = win.set_focus();
}
}))
Verify: launch the built .app twice → second invocation focuses the first; no duplicate tray, no second poll loop.
.app displaced the running tray. See PR [#321].