Skip to content

Discard updates whose offered version is not newer than the installed… - #5462

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/5344-backwards-winget-update
Sep 30, 2026
Merged

Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
fix/5344-backwards-winget-update

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves the logic for determining whether a package update should be considered valid, specifically in scenarios where the offered update is not actually newer than the installed version. It also adds comprehensive tests to ensure the new logic behaves as expected, including edge cases involving unparsable or unknown versions.

Update validation logic

  • Updated IsPackageValid in UpgradablePackagesLoader.cs to reject updates where the offered version is not newer than the installed version, logging a message when this occurs. This check uses CompareVersions and only applies when the new version can be normalized.

Test coverage improvements

  • Added unit tests in UpgradablePackagesLoaderTests.cs to verify:
    • Packages with an offered version older than installed are rejected.
    • Updates are accepted if the offered version cannot be parsed (e.g., "stable", "latest", "2.0.0_rc1").
    • Updates are accepted when the installed version is unknown.

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.

Copilot review overview

🟡 Changes recommended

Valid zero-valued versions bypass the new comparison and can expose downgrades as updates.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Filters package updates whose offered version is not newer than the installed version.

Changes:

  • Adds manager-specific version comparison and logging.
  • Adds tests for older, unknown, and unparsable versions.
File Description
UpgradablePackagesLoader.cs Rejects non-newer offered versions.
UpgradablePackagesLoaderTests.cs Tests update-version validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Copilot review overview

🔵 Needs a closer look

Zero-valued versions still bypass comparison and are incorrectly retained as updates.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@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": "088d3a50-bd07-11f1-851e-3b41d8ac2285",
	"headSha": "eed4cd45024aaf8ef7953457898ad7981b1cede9",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit 01c3e43 into main Sep 30, 2026
7 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/5344-backwards-winget-update branch September 30, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] (Enter your description here)Potplayer (260819) için eski sürüm (210428) öneriyor unigetui neden?

2 participants