Skip to content

Commit 46bceb2

Browse files
Lash-LCopilot
andauthored
chore: apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 37d7cf1 commit 46bceb2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

roborock/protocol.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ def _parse(self, stream, context, path):
366366
stream_seek(stream, current_pos + start_index, 0, path)
367367
else:
368368
_LOGGER.debug("No valid version header found in stream, continuing anyways...")
369+
# Seek back to the original position to avoid parsing at EOF
370+
stream_seek(stream, current_pos, 0, path)
369371

370372
return super()._parse(stream, context, path)
371373

tests/devices/test_local_decoder_padding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_decoder_4byte_padding():
4444

4545

4646
def test_decoder_variable_padding():
47-
"""Test proposed fix: variable length padding should be skipped."""
47+
"""Test variable length padding handling."""
4848
encoder = create_local_encoder(TEST_LOCAL_KEY, connect_nonce=123, ack_nonce=456)
4949
decoder = create_local_decoder(TEST_LOCAL_KEY, connect_nonce=123, ack_nonce=456)
5050

0 commit comments

Comments
 (0)