You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop saved versions from pinning updates and report Chocolatey no-op updates - #5700
A per-package Version to install saved from the options dialog was also applied to updates. Chocolatey turned it into choco upgrade <id> --version=<saved> --allow-downgrade. When the saved version is the installed one, that upgrades nothing, exits 0, and UniGetUI reported "updated successfully" while the update kept coming back. .NET Tool, Pip and Cargo applied a saved version to updates the same way.
Changes
A saved version is install-only. Both options dialogs (Avalonia and TUI) only allow setting it for Install. An update operation now drops it unless it was explicitly requested through the new transient InstallOptions.VersionIsExplicit, which the CLI/IPC path sets. History, the update list and reinstall-on-update follow the same rule. The saved options on disk are not modified.
Chocolatey no-op updates are judged correctly. Chocolatey exits 0 even when it upgrades nothing, so the last upgraded X/Y summary decides. When nothing was upgraded:
if Chocolatey's newest available version already reaches the offered one, the update is a success (the package was already current);
otherwise it is a failure with a reason.
Failure explanations. The reason comes from a new IPackageOperationHelper.GetFailureExplanation hook. It returns nothing by default, so other managers are unchanged. Two new English strings were added to lang_en.json.
Automatic retries are judged on their own output. The AutoRetry loop never wrote the separator that resets captured output, so every manager also judged a retried attempt on the previous attempt's lines. In the live test, a successful elevated retry was read as a failure because of the unelevated attempt's upgraded 0/0. The loop now writes the same separator a manual retry does.
Pinned Chocolatey packages are not offered as updates.choco upgrade always skips them, so they would otherwise fail on every run. They are read from the Pinned column of choco outdated.
The #5686 reinstall test, which kept a saved version on update, is now a theory: only an explicit version on a manager that supports it is reused.
Testing
Unit tests: new tests cover the saved and explicit version rules, reinstall-on-update, history, Chocolatey no-op classification and explanations, pinned parsing, and AutoRetry output isolation. With the operations changes reverted, exactly the new dependent cases fail.
Build and checks:UniGetUI.Windows.slnx builds with no new warnings. dotnet format whitespace, dotnet format style and Verify-Translations.ps1 all pass.
Live on Chocolatey 2.7.4, through a headless debug build and uniget package update, with a saved Version: 8.17.0 for curl:
Without the fix: arguments --version=8.17.0 --allow-downgrade, upgraded 0/1, reported "Curl was updated successfully", curl still at 8.17.0. This reproduces the issue.
With the fix: no --version was sent, and curl was upgraded 8.17.0 → 8.23.0 through the elevated retry. Reported as a success.
Already-current package: reported as a success.
Explicit --version 8.23.0: still passed to choco.
Not covered
Pinned packages were not tested on a real package, because pinning needs admin rights. The column layout was confirmed from Chocolatey's own log.
Retrying from operation history does not reuse an explicit update version, because the flag is not saved with the history record.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Explicit-version no-op updates are misclassified as failures, while standalone update commands retain saved version pins and behave inconsistently with queued updates.
This PR addresses #5672 by preventing saved installation versions from pinning queued updates and improving Chocolatey’s reporting when an update changes nothing.
Changes:
Distinguishes explicitly requested versions from saved installation preferences, including reinstall and history behavior.
Classifies Chocolatey no-op updates, provides failure explanations, and filters pinned packages from available updates.
Isolates automatic-retry output and adds regression tests.
This explanation persists across retries of the same operation. If a Chocolatey no-op first fails because its sources only offer the old version, then a manual retry fails for a different reason (such as a network error with a nonzero exit code), GetFailureExplanation returns null and the previous source/version explanation is still displayed as the retry's failure message. Restore the generic failure message at the start of each attempt before applying any attempt-specific explanations.
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
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 #5672
Problem
A per-package Version to install saved from the options dialog was also applied to updates. Chocolatey turned it into
choco upgrade <id> --version=<saved> --allow-downgrade. When the saved version is the installed one, that upgrades nothing, exits 0, and UniGetUI reported "updated successfully" while the update kept coming back. .NET Tool, Pip and Cargo applied a saved version to updates the same way.Changes
InstallOptions.VersionIsExplicit, which the CLI/IPC path sets. History, the update list and reinstall-on-update follow the same rule. The saved options on disk are not modified.upgraded X/Ysummary decides. When nothing was upgraded:IPackageOperationHelper.GetFailureExplanationhook. It returns nothing by default, so other managers are unchanged. Two new English strings were added tolang_en.json.upgraded 0/0. The loop now writes the same separator a manual retry does.choco upgradealways skips them, so they would otherwise fail on every run. They are read from thePinnedcolumn ofchoco outdated.The #5686 reinstall test, which kept a saved version on update, is now a theory: only an explicit version on a manager that supports it is reused.
Testing
UniGetUI.Windows.slnxbuilds with no new warnings.dotnet format whitespace,dotnet format styleandVerify-Translations.ps1all pass.uniget package update, with a savedVersion: 8.17.0for curl:--version=8.17.0 --allow-downgrade,upgraded 0/1, reported "Curl was updated successfully", curl still at 8.17.0. This reproduces the issue.--versionwas sent, and curl was upgraded 8.17.0 → 8.23.0 through the elevated retry. Reported as a success.--version 8.23.0: still passed to choco.Not covered
🤖 Generated with Claude Code