fix: correct get_default_project() query to check for True instead of not NULL - #521
Conversation
… not NULL The query `Project.is_default.is_not(None)` matched ANY project with a non-NULL is_default value, including both True and False. When multiple projects exist with different boolean values, find_one() raises MultipleResultsFound. Changed to `Project.is_default.is_(True)` to explicitly match only the project marked as default. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 1m 28s —— View job Code Review: PR #521SummaryThis is a critical bug fix that correctly queries for the default project. The change is minimal, correct, and well-explained in the commit message. The BugThe original query: query = self.select().where(Project.is_default.is_not(None))This matched any project where The fix: query = self.select().where(Project.is_default.is_(True))Now explicitly matches only projects where Review Checklist✅ Code Quality & Standards
|
…values Verifies that get_default_project() returns only the project with is_default=True when multiple projects exist with True, False, and None values. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task in 1m 19s —— View job PR Review Complete ✓I've reviewed PR #521 against the Basic Memory team checklist. This PR addresses a critical bug and adds appropriate test coverage. SummaryThe Fix: Changed The Bug: The original query matched ANY project with a non-NULL The Test: Added Code Quality & Standards ✅
Notes:
Testing & Documentation ✅
Test Quality: The regression test
The existing test Basic Memory Architecture ✅
Notes:
Security & Performance ✅
Performance: Query performance unchanged - still uses indexed Compatibility ✅
Review Checklist Assessment
Recommendation: Approve and Merge ✅This is a critical bug fix with excellent test coverage. The PR:
The previous Claude review requested this exact test, and the author delivered. Well done! Unblocks: basic-memory-cloud PR #398 | Branch: |
… not NULL (basicmachines-co#521) Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
get_default_project()inproject_repository.pyto useis_(True)instead ofis_not(None)is_defaultvalue (both True and False), causingMultipleResultsFoundwhen multiple projects existTest plan
tests/repository/test_project_repository.py)PUT /v2/projects/{id}/defaultUnblocks basic-memory-cloud PR #398.
🤖 Generated with Claude Code