Skip to content

feat(locallibrary): unpublish deleted sets and their recordings, and MusicBrainz IDs without the drive - #311

Merged
botandbang merged 3 commits into
mainfrom
bnb/publishing-hardening
Oct 30, 2026
Merged

botandbang merged 3 commits into
mainfrom
bnb/publishing-hardening

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

What and why

sets delete now deletes a published set's record, and its recording's record (computer.localnetwork.dj.recording under the same key, from sets upload), from the Atmosphere account before it removes the set, the set's record first. The publishing permission set grants delete on computer.localnetwork.dj.set and computer.localnetwork.dj.recording (settings and profile stay create and update), PUBLISH_SCOPES matches, and a new repo::delete_record sends a DPoP-bound com.atproto.repo.deleteRecord through the same session, account and scope checks as writes. The set stays when the session may not delete or the server refuses. Signed out, it deletes the set locally and sends nothing. The confirmation line names the records it removes. The mock PDS answers deleteRecord, and a new end-to-end CLI test walks sign-in (a written session), status check, the three publishes, import from the account, unpublish and sign-out against it.

A set made or edited with its drive unplugged now gets MusicBrainz IDs from the tags of the store's copy of each file, found through the libraries' latest snapshots. MusicBrainzIds::read reads a file whose name gives no type by its content.

Also: settings import says "1 setting" instead of "1 settings".

The swap to jacquard-lexicon's SchemaValidator (LOC-85, #187) is not in this PR: 0.12.2 doesn't check string formats, enums, nullable fields, blob limits or constraints inside unions, so it can't replace the current validator without keeping nearly all of it.

Fixes LOC-86
Fixes #188
Refs LOC-82 (the local part: unpublishing and the end-to-end CLI walk; the real-PDS sign-in and publish checks stay open)
Refs #184

How it was tested

On origin/main cc1e7a9 (after #272 and #273):

  • cargo fmt --check, and cargo clippy -p locallibrary -p locallibrary-cli --all-targets -- -D warnings.
  • cargo nextest run -p locallibrary -p locallibrary-cli filtered on atmosphere, publish, sets, lexicon, musicbrainz, account, bug, mock PDS, recording and upload tests: 417 pass. The new tests passed 3 runs with --retries 0, and deleting_a_published_set_deletes_its_record_and_recording fails with the recording left out of set_unpublish.
  • oxfmt --check on the changed lexicon.

Before the move onto cc1e7a9: cargo clippy -p locallibrary-cli --no-default-features -- -D warnings for the account-gated parts, the help, rpc, docs, schema, settings and store tests (498 pass), and each new test failed once with its fix broken.

Not run: the full suite and Windows clippy.

Checklist

  • Tests cover the change
  • For locallibrary: apps/locallibrary/CHANGELOG.md has a line under Unreleased, if people using it will notice
  • The READMEs, docs/ and --help still say what the code does (apps/locallibrary/docs/rpc/ too, for a sidecar change)

…without the drive

Planned as these commits, folded into one because they share files:

- fix(locallibrary): read MusicBrainz IDs from the store when the drive is unplugged
- feat(locallibrary): delete a published set's record and recording with sets delete
- fix(locallibrary-cli): say "1 setting" when one setting is imported
@botandbang
botandbang requested a review from bnb as a code owner October 30, 2026 16:16
@linear-code

linear-code Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

LOC-82

LOC-86

bnb
bnb previously approved these changes Oct 30, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation web The Local Network website (apps/web) locallibrary locallibrary and the loclib-* crates lexicons The computer.localnetwork.* lexicons locallibrary: cli The locallibrary command line locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: publishing The Atmosphere account, and the sets and profile published to it tests Tests, fixtures and test harnesses labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Coverage Report for apps/web

Status Category Percentage Covered / Total
🟢 Lines 95.12% (🎯 93%)
⬇️ -0.04 pp
7179 / 7547
🟢 Statements 93.72% (🎯 91%)
⬇️ -0.08 pp
10971 / 11706
🟢 Functions 94.13% (🎯 92%)
⬇️ -0.11 pp
2827 / 3003
🟢 Branches 84.14% (🎯 80%)
⬆️ +0.08 pp
5116 / 6080
File CoverageNo changed files found.
Generated in workflow #629 for commit 822eac1 by the Vitest Coverage Report Action

Size

Compared with main. KiB are 1,024 bytes.

This pull request main Change
Client JavaScript 654.4 KiB 657.1 KiB -2.6 KiB (-0.4%)
Client JavaScript, brotli 218 KiB 218.9 KiB -986 B (-0.4%)
Client CSS 89.4 KiB 89.5 KiB -33 B (-0%)
Client CSS, brotli 12.8 KiB 12.9 KiB -17 B (-0.1%)

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Rust coverage

From run 617. Both are held to the thresholds in .cargo/config.toml.

Tests Lines Functions Regions
All 97.43% (82793/84973) 96.55% (13193/13664) 95.7% (182084/190270)
Hegel property tests alone 95.56% (81196/84973) 94.26% (12880/13664) 93.66% (178209/190270)

@botandbang
botandbang merged commit d73ca26 into main Oct 30, 2026
68 checks passed
@botandbang
botandbang deleted the bnb/publishing-hardening branch October 30, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lexicons The computer.localnetwork.* lexicons locallibrary: cli The locallibrary command line locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: publishing The Atmosphere account, and the sets and profile published to it locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses web The Local Network website (apps/web)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

locallibrary: read MusicBrainz IDs from the store when the drive is unplugged

2 participants