Repository navigation
fix(b01): reassemble fragmented B01/Q7 live map responses - #1048
Open
saruk-vedant wants to merge 1 commit into
Open
saruk-vedant wants to merge 1 commit into
saruk-vedant wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Large live maps arrive split into several MQTT messages sharing the same random and timestamp: non-final parts use protocol 300 and the final part uses 301. The B01/Q7 channel only matched 301 and decoded each message on its own, so a trailing fragment failed the AES block size check and the live map froze.
This ports the V1 reassembly from #1004 to the B01/Q7 map channel: parts are buffered per (random, timestamp), out-of-order arrival is handled, and the frame is decoded once the final part and every preceding seq are present. A lone final part whose decoded length is not a multiple of the AES block size is buffered as a trailing fragment instead of failing the decode.
How to test
uv run pytest tests/devices/rpc/test_b01_q7_channel.py(22 passed, including 5 new tests for in-order and out-of-order fragmented frames, a lone trailing fragment, and an incomplete frame)uv run pytest(2284 passed, 11 deselected, 53 xfailed)uv run ruff check roborock testsanduv run ruff format --checkon the changed files (clean)uv run mypy roborock testsshows the same 19 pre-existing errors as the base commit; no new errorsFixes #1043