Skip to content

feat(v3/updater): add Config.OnUpdateApplied for post-update bookkeeping - #6202

Draft
AlbinoGeek wants to merge 3 commits into
wailsapp:masterfrom
Rethunk-AI:feat/v3-updater-on-update-applied
Draft

AlbinoGeek wants to merge 3 commits into
wailsapp:masterfrom
Rethunk-AI:feat/v3-updater-on-update-applied

Conversation

@AlbinoGeek

@AlbinoGeek AlbinoGeek commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

WEP: #6203

Apps had no hook for post-update bookkeeping, such as refreshing an NSIS DisplayVersion.

Config.OnUpdateApplied(previousVersion) is called once from Init on the first launch after Restart replaced the app. The helper passes the replaced version via a temp-dir marker keyed by the target path, so it works through open -n on macOS where environment variables do not survive.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • WEP (proposal only; no implementation)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Added tests in helper_test.go and updater_test.go for the marker round trip and the once-only callback.

cd v3 && go test ./pkg/updater/... && go vet ./pkg/updater/... pass on this branch alone; gofmt -l on the changed files is empty.

  • Windows
  • macOS
  • Linux (unit tests only; Fedora Linux 44, amd64, go1.26.x). I did not run a full update end to end on other platforms.

Test Configuration

Fedora Linux 44 Workstation, amd64, GNOME on Wayland. Only the pkg/updater unit tests were run for this change, so no wails doctor output applies.

Checklist:

  • (v2 only) I have updated website/src/pages/changelog.mdx with details of this PR (v3 changelog entries are added automatically)
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

An entry is added to v3/UNRELEASED_CHANGELOG.md and the updater guide is updated.

This adds public API (a new optional config field, non-breaking), so it follows the WEP process: the proposal is #6203. This PR is its draft reference implementation and stays in draft until the WEP is decided.

Overlap with sibling PRs: this is one of three independent updater PRs from the same author (EXDEV staging, AppImage self-path, OnUpdateApplied). Each branch is based on master and passes on its own. They touch the same files in a few places (spawn.go, helper.go, updater.go, the guide, and the changelog), including the small resolveTarget helper that two of them also add, so whichever merges second may need a trivial textual rebase.

The code and this description were written with an AI assistant (Claude). I reviewed the diff and ran the tests listed above.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added Bug Something isn't working v3 Documentation Improvements or additions to documentation labels Sep 30, 2026
@AlbinoGeek
AlbinoGeek force-pushed the feat/v3-updater-on-update-applied branch from 981884b to 465e734 Compare October 4, 2026 07:13
@AlbinoGeek
AlbinoGeek force-pushed the feat/v3-updater-on-update-applied branch from 465e734 to 40ce22b Compare October 6, 2026 05:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Documentation Improvements or additions to documentation v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant