Repository navigation
fix(api): honor namespace filter on GET /room/memories (#1288) - #1290
Merged
Merged
Conversation
GET /room/memories parsed only room_id, limit, and author; any namespace query param was silently ignored, so callers asking for their own namespace in a cross-namespace room got a 200 with the full unfiltered list (issue reports a 6-namespace room returning 72 entries instead of 19). Core: recall_room becomes a compatibility wrapper delegating to a new recall_room_scoped(room_id, author, namespace, limit). The duplicate 4-variant SQL collapses into one dynamically composed WHERE clause — literal fragments stay in SQL text, every value is bound as a parameter (same owned Box<dyn ToSql> pattern as bulk.rs), so no string interpolation of inputs. Server: parse the namespace query param and pass it through; usage string and /tools endpoint-registry description updated (docs regenerated). Tests: core multi-namespace room test (scoped, combined author+namespace, legacy signature unchanged, nonexistent ns yields empty) and an HTTP-level server test. Validation: cargo fmt --check, clippy -D warnings, full workspace tests EXIT=0, feature-matrix checks, docgen fresh.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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
GET /room/memoriesnow honors thenamespacequery param: parse it in the handler and pass it through to a newUteke::recall_room_scoped(room_id, author, namespace, limit).Store::recall_roombecomes a compatibility wrapper delegating torecall_room_scoped(additive, no caller breakage); the duplicate 4-variant SQL collapses into one dynamically composed WHERE clause — literal fragments stay in SQL text, every value is bound as a parameter (same ownedBox<dyn ToSql>pattern as bulk.rs).uteke-serveendpoint listing) and/toolsAPI-registry description updated;docs/api-reference.mdregenerated via docgen.route().Why
#1288: the endpoint parsed only
room_id,limit, andauthor; anynamespacequery param was silently ignored, so a caller asking for its own namespace in a cross-namespace room got a 200 with the full unfiltered list (issue repro: 72 entries returned instead of 19). Filtering at the SQL level (inside the same LIMIT) also avoids the fetch-then-post-filter trap where LIMIT applies before filtering.Testing
cargo fmt --all -- --check✅cargo clippy --workspace --all-targets -- -D warnings✅cargo test --workspace— EXIT=0, no failures ✅check -p uteke-core --no-default-features --features vecq/onnx,vecq,build -p uteke-server --no-default-features --features vecq✅cargo run -p docgenfresh (no stale-docs failure) ✅Closes #1288