Skip to content

Commit fc7eeeb

Browse files
fix: clear _continuation_expected before decode_body in failure branch
Moved the flag clear to before FailureResponse.decode_body() in decode_continuation(). Previously if decode_body itself raised (e.g., truncated failure body), the flag stayed True alongside a poisoned buffer. Now the flag is always cleared when the continuation sequence is terminated, regardless of whether subsequent operations raise. Closes #125 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 082454a commit fc7eeeb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/dqlitewire/codec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ def decode_continuation(self) -> RowsResponse | None:
302302
)
303303

304304
if header.msg_type == ResponseType.FAILURE:
305-
failure = FailureResponse.decode_body(body, schema=header.schema)
306305
self._continuation_expected = False
306+
failure = FailureResponse.decode_body(body, schema=header.schema)
307307
raise ProtocolError(
308308
f"Server error during ROWS continuation: [{failure.code}] {failure.message}"
309309
)

0 commit comments

Comments
 (0)