Skip to content

fix(updater): wrap Update instance in markRaw to unblock install#48

Merged
Nic-dorman merged 1 commit intomainfrom
fix/updater-markraw
Apr 22, 2026
Merged

fix(updater): wrap Update instance in markRaw to unblock install#48
Nic-dorman merged 1 commit intomainfrom
fix/updater-markraw

Conversation

@Nic-dorman
Copy link
Copy Markdown
Contributor

Summary

  • stores/updater.ts stored the Update instance returned by @tauri-apps/plugin-updater into Pinia state. Pinia's reactive Proxy wrapping breaks the class's private fields, so _update.downloadAndInstall() silently no-ops — the dialog opens, user clicks Update & Restart, and nothing happens.
  • One-line fix: markRaw(update) opts the object out of the Proxy wrapping so the class methods execute against the real instance.

How this was found

Built a local 0.6.2 binary pointed at the production latest.json on GitHub (on throwaway branch test/updater-older-version). Banner and dialog both showed v0.6.6 as available. Clicking Update & Restart did nothing. No stderr output, no network activity. Applied the markRaw fix, rebuilt, relaunched 0.6.2 — installer downloaded, v0.6.6 landed in C:\Program Files\Autonomi\.

Test plan

  • Local 0.6.2 build → updater detects 0.6.6 → button triggers download → installs to Program Files
  • Same test from a real MSI install of 0.6.2 (not a portable exe) — the auto-relaunch hand-off only works for MSI/NSIS-installed copies; I verified the download+install half, not the relaunch half
  • Smoke test 0.6.6 updater → 0.6.7 once tomorrow's release ships, to catch any regressions

Known limitation (not in scope)

If a user launches a portable .exe directly (not installed via MSI/NSIS), the updater downloads and runs the installer but can't find the right relaunch target. Real users install the MSI/NSIS so this doesn't affect them. Documented only for internal testing.

🤖 Generated with Claude Code

The Update class returned by @tauri-apps/plugin-updater uses private
class fields, which break when Pinia wraps the instance in its reactive
Proxy. `_update.downloadAndInstall()` silently no-ops — the dialog
looks stuck and nothing downloads.

Confirmed end-to-end on a local 0.6.2 build pointed at the production
latest.json: before the fix the Update & Restart button did nothing.
After wrapping with markRaw, the installer runs, v0.6.6 lands in
Program Files, and the auto-relaunch hand-off succeeds (for MSI
installs — portable-exe relaunch still fails, but that's a non-issue
for real users).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit 9ebe701 into main Apr 22, 2026
4 checks passed
@Nic-dorman Nic-dorman deleted the fix/updater-markraw branch April 22, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant