Skip to content

Explain WinGet updates the publisher refuses and offer to ignore them - #5799

Open
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
mainfrom
fix/winget-upgrade-not-supported
Open

Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
mainfrom
fix/winget-upgrade-not-supported

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

Addresses #5597 (first part).

Problem

Packages such as MSYS2 declare UpgradeBehavior: deny in their WinGet manifest. winget upgrade always refuses them with 0x8A150114 (APPINSTALLER_CLI_ERROR_INSTALL_UPGRADE_NOT_SUPPORTED), but UniGetUI kept listing the update, showed a generic failure, offered retries that can never succeed, and automatic updates retried it every cycle.

Changes

  • Detection and message: operation helpers gain UpdateWasRefusedByPublisher (default false). The WinGet helper recognises 0x8A150114 and explains it through the existing GetFailureExplanation hook: "WinGet cannot update {package}. Its publisher requires updating it another way, for example from within the app itself".
  • No endless retries: the refused version is hidden through the stuck-update suppression from [BUG] Update Loop (Unkown) #5158, so automatic updates stop retrying it. A newer version is offered again.
  • Ignore action: the failure dialog's main button becomes Ignore updates for this package, with Retry and the other retry options in its drop-down. The operation panel's menu offers it too, Retry failed skips these operations, and IPC operation payloads carry updateRefusedByPublisher (documented in docs/IPC.md).
  • One ignore helper: UpgradablePackagesLoader.IgnoreUpdatesAsync replaces five copies of the ignore-and-remove sequence (dialog, panel, Updates page, TUI). It resolves the row the loader actually lists, so ignoring from another copy of the package removes the right row.

Bundled Pinget doesn't enforce UpgradeBehavior: deny (it runs the installer instead), so there's no Pinget refusal to detect.

Not in this PR

The issue's other half: hiding these updates before anyone tries them, and keeping RequireExplicitUpgrade packages out of "Update all". WinGet's COM IsUpdateAvailable doesn't apply either flag, and it isn't yet known whether COM exposes them.

Testing

  • New tests in WinGetManagerTests (message, refusal flag, bulk-retry skip, version hidden only until a newer one, no effect on installs) and UpgradablePackagesLoaderTests (ignore helper with another instance, and with nothing listed).
  • WinGetManagerTests, UpgradablePackagesLoaderTests, PackageOperationsTests, the IPC operation tests and the TUI ignore/skip/pause E2E tests pass. Both dotnet format gates pass.
  • Real WinGet: with MSYS2 20260611 installed, winget upgrade returns 0x8A150114. Updating through a dev build showed the new message, set updateRefusedByPublisher, dropped MSYS2 from the update list after a reload, and the dialog's Ignore action worked in the UI.
  • Not covered by automated tests: the TUI Installed-page ignore toggle and "Retry failed".

🤖 Generated with Claude Code

Packages such as MSYS2 publish `UpgradeBehavior: deny`, so `winget upgrade`
always fails with 0x8A150114 (INSTALL_UPGRADE_NOT_SUPPORTED). UniGetUI still
listed the update, showed a generic failure and offered retries that could
never succeed (#5597).

- Operation helpers gain `UpdateWasRefusedByPublisher`; the WinGet helper
  recognises 0x8A150114 and explains the failure through the existing
  `GetFailureExplanation` hook, so PackageOperations stays manager-agnostic.
- A refused update hides that version through the stuck-update suppression
  (#5158), so automatic updates stop retrying it; a newer version is offered
  again.
- The failure dialog's main action becomes "Ignore updates for this package",
  with Retry kept in its drop-down; the operation panel menu offers it too,
  "Retry failed" skips these operations, and IPC operation payloads carry
  `updateRefusedByPublisher`.
- Ignoring updates goes through one `UpgradablePackagesLoader.IgnoreUpdatesAsync`
  helper, used by the dialog, panel, Updates page and TUI. It resolves the row
  the loader actually lists, so ignoring from another copy of the package
  removes the right row.

Bundled Pinget does not enforce `UpgradeBehavior: deny` and runs the installer,
so there is no Pinget refusal to detect.

Verified against real WinGet with MSYS2 20260611 installed: winget returns
0x8A150114, the dev build shows the new message, sets the IPC flag and drops
the update from the list, and the dialog's Ignore action works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Persistent suppression is skipped when CLI listing reports an Unknown installed version, allowing a refused upgrade to reappear after reload and be retried every automatic-update cycle.

1 open issue
What changed in this PR

This PR addresses the failure-handling portion of #5597: explaining publisher-refused WinGet updates and offering an Ignore action. It reuses stuck-update suppression from #5158; filtering these updates before an attempt remains out of scope.

Changes:

  • Detects WinGet error 0x8A150114, explains the refusal, and records version-specific suppression.
  • Adds Ignore actions, excludes refused updates from bulk retries, and exposes the refusal through IPC.
  • Centralizes ignore-update handling and adds regression tests.
File Description
src/​UniGetUI.Tui/​Infrastructure/​TuiPackageActions.cs Delegates ignore actions to the shared loader helper.
src/​UniGetUI.Tui/​Infrastructure/​TuiOperationRegistry.cs Skips publisher-refused updates in bulk retries.
src/​UniGetUI.PackageEngine.Tests/​WinGetManagerTests.cs Tests refusal detection, messaging, and suppression.
src/​UniGetUI.PackageEngine.Tests/​UpgradablePackagesLoaderTests.cs Tests ignoring through another instance or without a listed update.
src/​UniGetUI.PackageEngine.PackageManagerClasses/​Manager/​Helpers/​BasePkgOperationHelper.cs Provides default refusal detection.
src/​UniGetUI.PackageEngine.PackageManagerClasses/​Manager/​Classes/​NullPackageManager.cs Implements the refusal contract for the null manager.
src/​UniGetUI.PackageEngine.PackageLoader/​UpgradablePackagesLoader.cs Centralizes ignore persistence and listed-row removal.
src/​UniGetUI.PackageEngine.Operations/​PackageOperations.cs Tracks refusals and exposes ignore/retry eligibility.
src/​UniGetUI.PackageEngine.Managers.WinGet/​Helpers/​WinGetPkgOperationHelper.cs Recognizes, explains, and suppresses refused updates.
src/​UniGetUI.PackageEngine.Interfaces/​ManagerHelpers/​IPackageOperationHelper.cs Adds the publisher-refusal detection contract.
src/​UniGetUI.Interface.IpcApi/​IpcOperationApi.cs Exposes publisher refusal in operation payloads.
src/​UniGetUI.Avalonia/​Views/​SoftwarePages/​SoftwareUpdatesPage.cs Uses shared ignore, skip, and pause handling.
src/​UniGetUI.Avalonia/​Views/​DialogPages/​OperationFailedDialog.axaml.cs Makes Ignore the primary action for refused updates.
src/​UniGetUI.Avalonia/​ViewModels/​DialogPages/​OperationViewModel.cs Adds Ignore to the operation menu.
src/​UniGetUI.Avalonia/​Infrastructure/​AvaloniaOperationRegistry.cs Excludes refused updates from desktop bulk retries.
src/​Languages/​lang_en.json Adds the English refusal explanation.
docs/​IPC.md Documents the refusal flag and ignore command.

Review effort: Balanced

When WinGet's CLI lists an update with an `Unknown` installed version,
ParseAvailableUpdates skipped ConsumeAlreadyUpgradedSuppression entirely to
keep the one-shot "already upgraded" mark from being cleared. That also
skipped the persistent IsStuckUpgradeLoop check, which the COM listing paths
apply unconditionally. A refused update (0x8A150114) therefore reappeared on
the next CLI reload and automatic updates retried it every cycle.

Unknown-version rows now still check IsStuckUpgradeLoop; only the one-shot
mark is left alone. The bypass predates this branch (#5167) and also let
#5158's stuck-update suppression slip through for such rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the changes to publisher-refused WinGet update handling.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "d4093270-e399-11f1-97d1-d2e21871d1d5",
	"headSha": "930318f667649cd8bb252d12f5b4b03139dc12f6",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

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

Development

Successfully merging this pull request may close these issues.

2 participants