Summary
Confirming "Replace" for a source held by another package removed the installed package first. If the new package then failed to download, verify or describe, the user was left with neither. This happened in testing with the official QQ Music source.
Changes
- A replacement now takes over the source id only after the new package is downloaded, verified and passes its describe check. Until then the current package stays installed and usable.
- Contract note in
catalog.md.
Test plan
-
cargo test --release --lib: newa_failed_replacement_keeps_the_current_packagecovers an incompatible registry major and a describe major mismatch; it fails on main and passes here -
cargo clippy: clean - Release app: a good replacement still installs (official QQ Music replaced by a local-registry build). The failure path is covered by the unit test, not by a manual run
Note: #699 edits the same paragraph of docs/references/contracts/catalog.md; whichever merges second needs a small rebase.