Skip to content

NOR-98/NOR-94: Fix Bookdrop paging and stable library publication - #73

Merged
logabell merged 4 commits into
mainfrom
logan/nor-98-bug-grimmory-library-setup-fails-grimmory-returned-an
Oct 15, 2026
Merged

logabell merged 4 commits into
mainfrom
logan/nor-98-bug-grimmory-library-setup-fails-grimmory-returned-an

Conversation

@logabell

@logabell logabell commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Grimmory 3.5.0's nested Spring paging response made even an empty Bookdrop queue fail folder verification. Library publication also failed when the destination root's inode changed after a write, and retry reused that stale identity.

  • Read legacy and nested Bookdrop paging with bounded termination, consistent metadata, ordered unique IDs and valid file evidence. Preserve Bookdrop access checks when automatic delivery is off and the separate direct-library verification path.
  • Anchor new destination receipts and shared locks to a persistent random marker's device and file inode. Publication, combine/separate, seeding rename, cancellation, recovery and companion placement use the same identity contract. A copied token or changed/replaced marker does not authorize publication.
  • Keep old receipts strict. Explicit cancellation may clean a verified unpublished stage so a fresh import can start; published, missing or ambiguous staging remains held for review. Recovery scans remain read-only.

Fixes NOR-98. Closes #65.

Refs NOR-94 and #61. Keep the Unraid report open for validation on the reporter's mount. NOR-82's remaining feature scope is unchanged.

Validation:

  • Reproduced the exact empty-queue parser error and the root-transition publication failure before fixing them.
  • 219 focused filesystem tests passed, including real local replacement, marker and lock races, old receipts, retry/cancellation, recovery, conversion, seeding moves, combining and ebook placement.
  • 142 contract/API/worker tests passed against an isolated PostgreSQL database, including folder activation with automation off, Bookdrop handoff/restart recovery, fresh/retried imports, safe cancellation/restart and both ebook/audiobook import orders with multiple narrations.
  • Ruff lint/format and git diff --check passed. All tests ran serially through python3 scripts/check.py; no full suite.

Limits and rollout: filesystem changes were simulated over real local files, not tested on live Unraid/cache-mover or a live Grimmory deployment. Marker file identity changes still require review; this does not trust the token alone. Stop old workers when upgrading so all writers use the new lock protocol. Storage behavior and recovery steps are documented in docs/STORAGE-COMPATIBILITY.md.

PR review follow-up

The shared library-review browser check could fail when “Save and review next” displayed the completed-link status and the next catalog-search status together. The fixture now holds that next lookup pending, checks both messages separately, and waits for the lookup to finish before continuing. The ambiguous assertion failed under this controlled timing before the fix; no product behavior or timeout was changed.

CI also found eight stale staging assertions that expected the destination root to contain only the private staging directory. They now require the persistent root marker as well, and verify that its bytes and inode survive both resume and cancellation. The failure reproduced locally before correction. Follow-up validation: 177 focused checks passed via python3 scripts/check.py unit tests/unit/test_library_mount_staging.py tests/unit/test_destination_identity.py tests/unit/test_import_publication.py tests/unit/test_combine_parts.py; the library-review browser journey passed after the current production build. Existing live-mount limitations remain unchanged.

@linear-code

linear-code Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

NOR-94

NOR-98

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T12:57:19.964575Z 67bce6e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Grimmory library setup fails: "Grimmory returned an invalid Bookdrop queue" (Spring paged response format)

1 participant