Commit Graph
2 Commits
Author SHA1 Message Date
ricoromaandClaude Opus 5.5 8fe467ace0 fix: check cursor fields instead of re-encoding
628b5f2 accepted a cursor only if re-encoding the parsed key gave the
same string. That closed the format both ways: any encoding change, even
a compatible one (an optional field, key order, to_rfc3339 shared with
API responses), would turn cursors issued by a replica of the other
version into 400 during make rolling_update, which the tests cannot see.

decode_cursor now checks the fields one by one: v must be exactly the
integer 1, t and i must be strings, i must be in the server's notation
(lowercase 8-4-4-4-12). Unknown fields are ignored, so a tampered cursor
is still a 400 while the format stays open for compatible changes. The
rule records how to change the format: a new CURSOR_VERSION, with both
versions accepted while replicas are replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:11:57 +03:00
ricoromaandClaude Opus 5.5 c5d5a1ab25 test: cover tampered cursors and UUID input forms
Add black-box tests for the strict-id-validation change: a server-issued
cursor with one field changed (non-string or non-canonical item id,
v=true, extra field) on both lists, member_ids with values of other JSON
types, a non-array member_ids and other UUID notations, and chat_id in
the path of the three chat endpoints. Sync the change's delta specs into
api-conventions, chats and pagination so the coverage check knows the
new scenarios.

The cursor and UUID-notation tests fail on the current code by design;
the fix follows in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 12:51:16 +03:00