Skip to content

Commit 8f2dbef

Browse files
Correct a stale comment about decoded V0 cluster re-encode
The decode_body comment claimed re-encoding a decoded V0 ClusterRequest "still raises", but a decoded V0 frame carries the _decoded sentinel and re-encodes byte-identically (the encode_body exemption); only fresh format=0 construction is rejected. Reword to match the code and the class docstring. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 58f08e7 commit 8f2dbef

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/dqlitewire/messages/requests.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,9 +1159,10 @@ def decode_body(cls, data: bytes, schema: int = 0) -> "ClusterRequest":
11591159
raise DecodeError(f"ClusterRequest unsupported schema version {schema}")
11601160
# Decode-side accepts V0 so a relaying proxy / mock server /
11611161
# captured-traffic replay tool can round-trip a V0 frame
1162-
# without losing the original byte shape. Re-encoding a
1163-
# decoded V0 still raises (encode_body refuses) — only the
1164-
# decode → introspect → drop flow is supported.
1162+
# without losing the original byte shape. A decoded V0 frame
1163+
# carries the ``_decoded=True`` sentinel and re-encodes
1164+
# byte-identically (see ``encode_body``); only *fresh*
1165+
# ``format=0`` construction is rejected.
11651166
if len(data) != 8:
11661167
raise DecodeError(f"ClusterRequest body must be 8 bytes, got {len(data)}")
11671168
format_val = decode_uint64(data)

0 commit comments

Comments
 (0)