Repository navigation
Skip crates deleted from crates.io during the Cargo update check - #5823
Merged
Merged
Conversation
A crate installed from crates.io and later deleted from it is still listed by `cargo install --list` without a source, so it counts as a crates.io package and the update check asks crates.io for its manifest. crates.io answers 404, FetchAsync turns that into an HttpRequestException, and nothing in the update loop caught it per crate: the first deleted crate aborted the whole listing. Cargo's update health never recorded a success and no update was ever offered for any other crate. The loop now skips a crate whose manifest crates.io answers with 404, logging a warning, and keeps checking the rest. Only 404 is skipped: it means the crate does not exist, the same way a 404 from a NuGet feed means the package is not on that feed. Any other failure, such as crates.io being down or rate-limiting, would hit every crate, so it still fails the check rather than recording an outage as a successful listing with no updates. Fixes #5818 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change allowing Cargo update checks to continue past deleted crates.
No open issues 🎉
What changed in this PR
Addresses #5818 by allowing Cargo update checks to continue when an installed crate has been deleted from crates.io.
Changes:
- Skips crates whose manifest request returns HTTP 404 and logs a warning.
- Preserves failure reporting for other HTTP errors.
- Adds regression tests for continuing after a 404 and propagating a 503.
| File | Description |
|---|---|
src/UniGetUI.PackageEngine.Tests/CargoInventoryTests.cs |
Tests deleted-crate handling and service-unavailable failures. |
src/UniGetUI.PackageEngine.Managers.Cargo/Cargo.cs |
Handles manifest HTTP 404 errors per crate without aborting update discovery. |
Review effort: Balanced
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "9306cc20-e77b-11f1-8504-878a587f0ed7",
"headSha": "cf953e6d738d95abe026ea1aab512e04ef7b1d2d",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
fix/cargo-deleted-crate-404
branch
November 23, 2026 21:43
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 #5818
Problem
A crate installed from crates.io and later deleted from it still appears in
cargo install --listwith no source, so UniGetUI treats it as a crates.io package and asks crates.io for its manifest during the update check. crates.io answers 404, and nothing in the update loop handled that per crate. The first deleted crate aborted the whole listing: Cargo never showed any update, and its update health never recorded a success.Fix
Cargo.GetPackagesnow skips a crate whose manifest crates.io answers with 404, logs a warning, and keeps checking the other crates.Only 404 is skipped. Any other failure, such as crates.io being down or rate-limiting, would affect every crate, so it still fails the check rather than recording an outage as a successful check with no updates. This matches how the NuGet managers treat a 404: the package is not on that feed, not a failed check.
Verified end to end (throwaway test, not committed)
The real Cargo manager ran the real
cargo.exe(1.95.0) against a sandboxCARGO_HOMEthat lists the crate from the report,holographic-memory 0.6.1, next tosd 0.7.0. It queried the real crates.io through the publicGetAvailableUpdates(), with the data folder and health file redirected to a temp folder:sd 0.7.0 -> 1.0.0LastSuccessUtcnullConsecutiveFailuresLastFailureReasonHttpRequestException: ... 404 (Not Found).