fix(dev): stop the in-app updater from hijacking the real install during local dev - #1141
Open
3laa-NA wants to merge 1 commit into
Open
fix(dev): stop the in-app updater from hijacking the real install during local dev#11413laa-NA wants to merge 1 commit into
3laa-NA wants to merge 1 commit into
Conversation
…ing local dev Dev builds (`pnpm tauri dev`) share the same Tauri app identifier (`app.harbor`) as the production release build by default. The in-app updater doesn't know or care which build triggered it: when "Update now" runs, it downloads and executes the actual production installer, which always targets the real Harbor install location on disk, regardless of whether a dev or release build kicked off the check. Result: running the dev build and clicking "Update now" silently updates and relaunches the user's separately installed real Harbor app instead of the dev build, which just looks like the dev build vanished. There is no way for the release installer to meaningfully "update" a dev build living at target/debug/harbor.exe in the first place, so the updater should never have run there at all. Fix: checkForUpdate() now returns immediately when import.meta.env.DEV is true, so the updater never checks or fires inside `pnpm tauri dev`. Zero effect on production builds, where import.meta.env.DEV is false. Also ignore src-tauri/tauri.dev.local.json: a new, personal, local-only Tauri config override (never committed) that gives a local dev build its own app identifier and deep-link scheme, so its app-data directory (settings, library, watch history) doesn't collide with a real installed app's data either. Usage: pnpm tauri dev --config src-tauri/tauri.dev.local.json Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents the in-app updater from ever running inside a
pnpm tauri devbuild, since it can only ever end up silently updating and relaunching a separately installed release build instead of the dev build itself.Why
Dev builds share the same Tauri app identifier as the production release build by default. The updater has no awareness of which build triggered it — "Update now" always downloads and runs the real production installer, which always targets the actual Harbor install location on disk. There's no way for that installer to meaningfully "update" a dev build living at
target/debug/harbor.exe; running the updater there just silently updates the user's separate real install and relaunches that instead, which looks like the dev build vanished.Verification
pnpm tauri dev, confirmed the updater no longer checks or shows the update prompt.import.meta.env.DEVisfalsein production builds, so this has zero effect there.tsc -b --pretty false— clean.Platform Impact
Verified on Windows. The fix is gated purely on
import.meta.env.DEV, so behavior should be identical on macOS/Linux.UI Changes
None — dev-only behavior change.
Checklist
vp checkfor the changed files. — Not available onbeta-branch(novite-plusdependency here yet; filed as a separate issue for visibility). Rantsc -b --pretty falseinstead.tsc -b --pretty false, see note above).Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com