Repository navigation
fix(locallibrary): drive-safety fixes for jobs, backups, racy stamps, player names, my tags and exports - #308
Merged
Merged
Conversation
…r names, My Tags and exports Planned as these commits, folded into one because they share files: - fix(locallibrary): plan a job's step again only over the job's own writes - fix(locallibrary): carry the journal and player name in backups - fix(locallibrary): tell racy size-and-mtime matches by content - fix(locallibrary): leave a stick without onelibrary unnamed - fix(locallibrary): check my tag ids against exportext.pdb when planning - fix(locallibrary): count cloud downloads in the export's space check - fix(locallibrary): name skipped history lists, merge into the same folder, hide disks under the test switch
bnb
previously approved these changes
Oct 30, 2026
# Conflicts: # apps/locallibrary/CHANGELOG.md # apps/locallibrary/TODO.md # crates/locallibrary/src/tree.rs # crates/locallibrary/src/tree/tests.rs
…2 when the next one is taken
botandbang
enabled auto-merge
November 1, 2026 16:38
Contributor
Author
|
Closing and reopening so CI runs against current main (with #353's CodeQL fix). Branch unchanged. |
auto-merge was automatically disabled
November 1, 2026 16:49
Pull request was closed
botandbang
enabled auto-merge
November 1, 2026 16:50
bnb
previously approved these changes
Nov 1, 2026
Rust coverageFrom run 64. Both are held to the thresholds in .cargo/config.toml.
|
bnb
approved these changes
Nov 1, 2026
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.
What and why
This fixes data-safety bugs in the code that writes to drives.
Jobs (
refresh,prep) plan a step again after a stale plan only when the drive is as the job's own earlier steps left it. Each plan's probes are measured before and after every piece of work. A change from anywhere else, such as a rekordbox export mid-job, stops the job with the stale plan.Backups now carry the drive's journal (with its staged files) and the remembered player name and colour, and restoring one puts both back. Undo then redo, or an older backup and then a newer one, leaves the journal matching the drive. The undo plan says how many recorded edits go back on the journal. A replay seals its backup when it starts and after each step (each step's commit seals it through
commit::under_backup), so a replay cut off part way can be undone without--force. Backups from earlier versions are restored as before.There is now one racy-stamp rule,
fsutil::settled, which the hash cache and scrub use.HashIndex::racyflags copies recorded too soon after their source was written. Sync, pack and collection export compare those by content, and so does the after-a-set comparison.library_write::copyrecords its copies in the target's hash index so they can be told apart. Unembed checks each file against a hash the embed now records (EmbeddedFile.hash, a new optional field in the RPC contract).A sync or pack onto a stick with no exportLibrary.db leaves it without a player name or colour, and the plan says so. Stamps that differ only by an empty name or colour 0 no longer count as a change.
My Tags: exportExt.pdb gets the smallest free category id when the next one would be past u32, and planning refuses any exportExt.pdb id that can't fit.
Collection export counts online-only downloads in its space check when their cloud folder is on the target's disk, and warns which file it's waiting on after 10 s.
A lenient replay that finds none of the history lists to delete names them. Merging the same drive into a folder again merges into the folder the first merge made, by name, and adds nothing.
format::disk_atrefuses underLOCALLIBRARY_VOLUMESwithout running disk tools.Two tests that asserted the old behaviour were updated: the nameless history-list note, and the second merge's "Club (2)" folder. The My Tag id property's model now allows the smallest free id.
Fixes LOC-72
Fixes #173
Fixes LOC-64
Fixes #165
Fixes LOC-48
Fixes #148
Fixes LOC-62
Fixes #163
Fixes LOC-37
Fixes #137
Fixes LOC-36 (prefetching the next downloads is still open in TODO.md)
Fixes #136
Refs LOC-65 (items 3 to 5; items 1 and 2 are in bnb/cli-store-reads)
Refs #166
How it was tested
cargo fmt --all --check, andcargo clippy -p locallibrary --all-targets -- -D warnings.cargo nextest run -p locallibraryfiltered on the sync, pack, export, scrub, tree, embed, journal, replay, merge, tags, format, watch and jobs tests: 852 of 854 passed, and the 2 failures (setup in two new tests) were fixed and pass.--retries 0: no failures.docs/rpcregenerated, addingEmbeddedFile.hashand theneeded_bytesdoc.the_contract_in_docs_is_current) and Windows clippy.Checklist
apps/locallibrary/CHANGELOG.mdhas a line under Unreleased, if people using it will noticedocs/and--helpstill say what the code does (apps/locallibrary/docs/rpc/too, for a sidecar change)