fix: stop re-prompting update after user skips or upgrades#25
Merged
Conversation
Fixes #24. Three bugs caused TRX to keep prompting the same update indefinitely: 1. Dead code: App::should_update field was initialized to None and never written to; the guard it gated was always true. Removed the field and cleaned up the guard. 2. No skip persistence: pressing Esc on the update prompt dismissed the dialog in-memory only. On the next launch the same version was fetched and the prompt appeared again. Now the skipped version is written to ~/.config/trx/config.toml (settings.skipped_update_version) so it survives restarts. When a genuinely newer release appears the stored version no longer matches and the prompt resurfaces automatically. 3. check_for_updates now accepts skipped_version: Option<&str> and returns None immediately when the latest release matches the user's persisted skip, so the background thread never sends the stale event. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses repeated update prompts by persisting “skipped” update state in the user config and using that persisted value to suppress prompts for the same GitHub release across restarts.
Changes:
- Add
settings.skipped_update_versionto the persisted config and default it toNone. - Update the updater to accept an optional skipped version and early-return when it matches the latest tag.
- Remove the dead
App::should_updatefield and persist the skipped version when the user dismisses the update prompt (Esc/q).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/config.rs |
Adds persisted skipped_update_version setting (default None). |
src/updater.rs |
Adds skipped_version parameter and suppresses prompt when it matches latest. |
src/ui/app.rs |
Removes unused should_update, passes persisted skip into update check thread, persists skip on dismiss. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+17
| /// Version the user explicitly skipped. Cleared automatically when a | ||
| /// genuinely newer release appears, so the prompt resurfaces then. |
The doc comment said the field was "cleared automatically" when a newer release appears, but the code only ignored the stale value — the config file still held the old skipped version string. Now, when the background thread returns a new update event (meaning the latest tag is genuinely newer than the skipped version), the app clears skipped_update_version and persists the config before showing the prompt. This keeps the stored config tidy and makes the behavior match the docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Fixes #24.
Root causes fixed
Three bugs caused TRX to keep showing the update dialog on every launch:
1. Dead
should_updatefield removedApp::should_update: Option<String>was initialized toNoneand never written to anywhere. The guard&& self.should_update.is_none()was alwaystrue(dead code). Field and guard removed.2. Skip is now persisted across restarts
Pressing Esc or q on the update prompt previously only dismissed the dialog in-memory. On the next launch the same GitHub release was fetched and the user was prompted again, forever.
Fix: when the user dismisses the prompt, the skipped version string is written to
~/.config/trx/config.tomlassettings.skipped_update_version. The value survives restarts. When a genuinely newer tag appears on GitHub the stored version no longer matches, so the prompt resurfaces automatically — users are never silently stuck on an old version.3.
check_for_updatesskips early for persisted skipThe signature changed from
check_for_updates()→check_for_updates(skipped_version: Option<&str>). The background thread is handed the persisted value at startup and returnsNoneimmediately if the latest release matches — so the channel event is never sent and the UI never receives a stale prompt.Files changed
src/config.rsskipped_update_version: Option<String>toSettings(defaults toNone)src/updater.rsskipped_versionparam; early-return when it matches latestsrc/ui/app.rsTesting
cargo build # compiles clean, zero warningsManual test flow:
~/.config/trx/config.toml:skipped_update_versionfield is set