Skip to content

fix(b01): reassemble fragmented B01/Q7 live map responses - #1048

Open
saruk-vedant wants to merge 1 commit into
Python-roborock:mainfrom
saruk-vedant:roborock-1043-b01-map-reassembly
Open

saruk-vedant wants to merge 1 commit into
Python-roborock:mainfrom
saruk-vedant:roborock-1043-b01-map-reassembly

Conversation

@saruk-vedant

Copy link
Copy Markdown

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 tests and uv run ruff format --check on the changed files (clean)
  • uv run mypy roborock tests shows the same 19 pre-existing errors as the base commit; no new errors
  • No real Q7 hardware was available, so the fix is verified with synthetic fragmented frames matching the captured logs in B01/Q7: fragmented live map responses (protocol 300 + 301) are not reassembled — map image freezes #1043.

Fixes #1043

Copilot AI balanced review requested due to automatic review settings November 14, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B01/Q7: fragmented live map responses (protocol 300 + 301) are not reassembled — map image freezes

2 participants