refactor(server): extract the wishlist routes into routers/wanted.py (R3) - #847
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe wishlist API handlers moved from ChangesWanted API router extraction
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/routers/wanted.py`:
- Line 19: The MetadataDB.list_wanted() method reads the shared SQLite
connection without synchronization. Wrap its SELECT/query operation in with
self._lock:, matching add_wanted() and remove_wanted(), so concurrent
wanted-list reads are serialized with writes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 98a3a51a-7068-4ae0-94ab-8579ced997f0
📒 Files selected for processing (3)
docs/size-exemptions.mdlib/routers/wanted.pyserver.py
|
The unlocked |
…(R3) Free after _clean_str moved to lib (#841): wanted's deps are JSONResponse, _clean_str (reqfields), app + meta_db (seam). 3 routes (list/add/remove), 0 setattr targets, 0 helpers to relocate. Bodies verbatim; @app -> @router, meta_db -> appstate.meta_db. include_router at the original site; 143-route table identical. No test retargeting. server.py: 8,003 -> 7,974 (this branch is independent of the chart PR). Verified: pyflakes clean; route table identical; pytest 2401 passed (52 in test_wanted_api); eslint 0. Boot smoke: add wishlist entry -> list -> delete, 400 on missing artist+title (_clean_str path). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
f0ab584 to
4525a92
Compare
Free after
_clean_strmoved tolib/reqfields.py(#841):wanted's deps areJSONResponse,_clean_str,app+meta_db(seam). 0setattrtargets, 0 helpers. 3 routes (list/add/remove).Bodies verbatim;
include_routerat the original site; 143-route table identical. No test retargeting.server.py: 8,003 → 7,974 (independent branch offorigin/main, parallel to the chart PR #846 — the register line will need reconciling for whichever merges second).Verification
pyflakesclean.pytest2401 passed (52 intest_wanted_api);npm run lint0.400on missing artist+title.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Refactor