Invalid cache when adding lower bound to lockfile (#8230)

## Summary

This was already properly handled, but the operation itself was in a
`debug_assert!`, so it wasn't running at all in production builds...

Closes https://github.com/astral-sh/uv/issues/8208.
This commit is contained in:
Charlie Marsh 2024-10-15 16:09:55 -07:00 committed by GitHub
parent 9a76e47888
commit beab67e225
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -748,7 +748,8 @@ async fn lock_and_sync(
let url = Url::from_file_path(project.project_root())
.expect("project root is a valid URL");
let version_id = VersionId::from_url(&url);
debug_assert!(state.index.distributions().remove(&version_id).is_some());
let existing = state.index.distributions().remove(&version_id);
debug_assert!(existing.is_some(), "distribution should exist");
}
// If the file was modified, we have to lock again, though the only expected change is