Skip to content

fix: upgrade tauri to 2.12 so a second dot x launch always exits - #277

Merged
Andreas-Froyland merged 1 commit into
mainfrom
fix/single-instance-race
Nov 17, 2026
Merged

Andreas-Froyland merged 1 commit into
mainfrom
fix/single-instance-race

Conversation

@Andreas-Froyland

Copy link
Copy Markdown
Member

Everything below this line was written by AI. Agent: Claude Code. Model: Claude Opus 5.5.

Problem

Two copies of Dot X started in the same second at login, and both stayed running. The second copy couldn't create its webview, started its plugins anyway ("Frontend not ready after 10s; auto-starting plugins anyway"), and ran a second MQTT Publisher with the same client ID. The broker drops one session whenever the other connects, so MQTT reconnected every 5 seconds.

The cause is in tauri-plugin-single-instance 2.3.6 on Windows. The first instance creates its named mutex slightly before its message window. A second instance that starts in that gap sees the mutex, fails to find the window, and then neither exits nor takes the lock. On the affected machine, only the first process owned the com.dot-x.dev-sic window. The second had no window and kept running.

Solution

Upgrade to tauri-plugin-single-instance 2.5.5, which fixes this race (tauri-apps/plugins-workspace#3704): the second instance waits up to 1 s for the window and then always exits. 2.5.5 needs Tauri 2.12, so this also upgrades:

  • tauri to 2.12.5 and tauri-build to 2.7.4
  • @tauri-apps/api and @tauri-apps/cli to 2.12.4, so the CLI version check still passes
  • tauri-plugin-mcp-bridge (debug builds only) from 0.11 to 0.13.2, because 0.11 doesn't compile against the webview2-com that wry 0.57 uses

Verification

  • cargo test --locked: 43 passed. The 11 warnings are existing dead-code and deprecation warnings.
  • yarn check:capabilities, yarn typecheck, yarn build:web, yarn test:emulator and yarn test:release pass.
  • yarn test:build-env fails with ERR_LOAD_URL for a temp probe.ts. It fails the same way on main on this Windows machine, so it's unrelated to this change.
  • Race test: built a debug binary with a temporary identifier (TAURI_CONFIG='{"identifier":"com.dot-x.racetest"}') so it couldn't touch the installed app. Launched three copies at once, 15 times. Every round, exactly one stayed running and the other two exited with code 0.
  • Not run:
    • yarn build, because cargo-license isn't installed, so rust_licenses.json hasn't been regenerated for the new crates.
    • A release build.
    • Device, MIDI and tray behavior on the new Tauri.
    • Linux and macOS.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:XXL 1,000+ changed lines. vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Nov 16, 2026
@Andreas-Froyland
Andreas-Froyland merged commit b1bf87d into main Nov 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines. vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant