Skip to content

Commit

Permalink
Invalid cache when adding lower bound to lockfile (#8230)
Browse files Browse the repository at this point in the history
## 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 #8208.
  • Loading branch information
charliermarsh authored Oct 15, 2024
1 parent 9a76e47 commit beab67e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/uv/src/commands/project/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit beab67e

Please sign in to comment.