Repository navigation
fix(server): reject unknown keys in remember payloads with a 400 - #1254
Merged
Merged
Conversation
POST /remember and POST /room/remember silently dropped unrecognized fields: a payload using the v1-style `ns` key returned 200 while the memory landed in the default namespace, making it invisible to recalls scoped to the intended namespace. Align these write endpoints with the otherwise strict validation (missing required fields already return "Invalid JSON: missing field ...") by denying unknown fields - the error now names the offending key. Closes #1251
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Sep 15, 2026
Closed
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
POST /rememberandPOST /room/remembernow reject payloads containing unknown keys with a 400 that names the offending key (#[serde(deny_unknown_fields)]on both request structs), instead of silently dropping them.Why
A v1-style payload (
{"content": "...", "ns": "repo-vetio"}) was accepted with 200 whilenswas silently ignored - the memory landed in thedefaultnamespace and was invisible to recalls scoped torepo-vetio, with no error anywhere. This contradicts the otherwise strict validation on the same endpoints (missing required fields already returnInvalid JSON: missing field ...). Closes #1251.Testing
read_body: unknownns(androom) keys are rejected with the key named in the error; a fully valid payload still parses. Verified red before the fix (payload parsed OK) and green after.cargo test -p uteke-server: 44 passed / 0 failed across lib + integration suites (incl. 35 HTTP-route handler tests - no internal caller sends extra fields).cargo fmt --check+cargo clippy -p uteke-server --lib -- -D warningsclean.