fix: prevent update banner from persisting after update#52
Merged
AmethystLiang merged 1 commit intomainfrom Mar 23, 2026
Merged
fix: prevent update banner from persisting after update#52AmethystLiang merged 1 commit intomainfrom
AmethystLiang merged 1 commit intomainfrom
Conversation
With allowPrerelease enabled, electron-updater may consider the current version as an "available" update, causing the update banner to reappear in a loop after restarting. Guard both update-available and update-downloaded handlers to skip when the reported version matches the running app version. Also preserve the userInitiated flag through the same-version guard so user-initiated checks still show the "latest version" toast. Co-Authored-By: Claude Opus 4.6 <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.
Problem
After updating the app and restarting, the update banner ("Version X is ready to install" + "Restart now") stays visible even though the user is already running the latest version. This creates an infinite loop: banner → restart → banner again.
Solution
With
allowPrereleaseenabled,electron-updatermay consider the current version as an "available" update via the atom feed. Added same-version guards in both theupdate-availableandupdate-downloadedevent handlers insrc/main/updater.ts— if the reported version matchesapp.getVersion(), we emitnot-availableinstead of showing the banner. Also preserved theuserInitiatedflag through the guard so user-initiated "Check for Updates" still shows the "You're on the latest version" toast.