VSETATTR: the attribute string is not validated, no error reply - #4129
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The argument text still incorrectly requires valid JSON; remove that requirement while retaining empty-string deletion.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates VSETATTR documentation to match runtime behavior.
Changes:
- Documents storage without JSON validation.
- Clarifies invalid JSON filtering behavior and RESP2/RESP3 replies.
| File | Summary |
|---|---|
content/commands/vsetattr.md |
Updates argument and return documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
A note on the choice made here. The page could have been kept and the code aligned to it instead, since an attribute that is not valid JSON is almost always a caller mistake, and today it surfaces only later, when This PR aligns the page to the code because the other sources agree with the code: the module README documents only the 0/1 replies, and the filtered search page states that elements with invalid JSON are treated as not matching without error. Adding validation would also be a behavior change (a If validating the attribute in |
dwdougherty
left a comment
There was a problem hiding this comment.
Thanks again, @Laurianti. Approved.
It's up to you whether or not you open a ticket on redis/redis.
|
Thanks! I opened redis/redis#15886 for the validation. |
Documents that VSETATTR stores the attribute string unvalidated and returns no error for it.
Documents that VSETATTR stores the attribute string unvalidated and returns no error for it.

The VSETATTR page says the command replies with an error "for improperly specified attribute string". It does not: the string is stored as given, without validation.
Checked against redis/redis at
20bb2cfc5:{brokenis not valid JSON in any form, while a quoted string such as"text"would be.VSETATTR_RedisCommandinmodules/vector-sets/vset.cdoes not parse the attribute, and the module README documents only the 0/1 replies. Elements whose attributes are not valid JSON are treated as not matching byFILTER, as the filtered search page already says.Now the Return information lists only the integer (RESP2) and boolean (RESP3) replies, and the
jsonargument says the string is stored without validation.