Repository navigation
id(fileops): unique archive tag names so same-second replaces never overwrite (#1612) - #1706
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fixes #1612 (queue task 1854, per triage task 1719).
Problem
Archive tags were named
{name}.archive.{ts}with a second-resolution timestamp and set unconditionally at three sites, so two replaces of the same destination within one second produced the same archive name and the second silently overwrote the first — the first replaced version lost its only archive reference and GC protection.Change
free_archive_name(pkgs/id/src/fileops.rs): returns{name}.archive.{ts}, bumping the numeric suffix (ts+1,ts+2, …) past any archive tag that already exists. The suffix stays all digits —deleteenumerates a file's archives by exactly that shape, and the web layer'sclassify_tagparses the suffix as the archive timestamp, so neither enumerator needed changes.FileOps::archive_existing,FileOps::rename's original archive, and the web layer'sarchive_original_tag(pkgs/id/src/web/routes.rs).Tests
fileops::archive_name_tests: same-second archives never overwrite (first archive keeps its hash, second is bumped, a third bumps past both) and the uncontested name is exactly the historic shape.cargo test --lib archive— 5 passed, including the existing protocol testsdelete_only_removes_numeric_archive_suffixes,delete_removes_name_metadata_and_archives, andrename_moves_metadata_and_archives_the_original. Full suite runs in CI on this PR.Need help on this PR? Tag
@codesmith-botwith what you need.