Conversation
|
Addressed all five review comments in f1f5e24 and pushed the changes to this branch. The archive traits now follow the existing push/listener contract: selections return after publication, Validation: 1,440 passed, 53 expected failures and 92 snapshots passed on both Python 3.11 and 3.14; all pre-commit hooks and both package builds passed. The PR description now reflects the final API and protocol limitations. |
| ## Q10 archive updates | ||
|
|
||
| Q10 traits are push driven. `refresh_detail()` publishes a selection and returns | ||
| when the command has been sent. It does not wait for the map response. Register |
There was a problem hiding this comment.
this the same as all other traits for q10 right?
I don't think we should encourage people to build blocking updates on this. Instead they can just update their object state when we invoke their callback...
| ) -> None: | ||
| record = CleanRecordConverter.parse_record(RECORD_A) | ||
| assert record is not None | ||
| if failure == "cancel": |
There was a problem hiding this comment.
lets not have a conditional inside the test. just make a separate test instead.
FWIW i'm not sure the concurrency is worth testing.
|
|
||
|
|
||
| async def test_refresh_detail_sends_full_raw_record( | ||
| async def test_refresh_detail_publishes_without_waiting_for_push( |
There was a problem hiding this comment.
"test_refresh_detail_publishes_without_waiting_for_push" is not a useful concept for q10. No rpc or refresh commands wait for a push. This is just recording the history of your conversation in a test, not adding direct value.
Q10 archives arrive on independent push streams. This adds read-only saved-map previews and clean-history map/path details while keeping archive data separate from the live map.
Public API and data flow
mapsowns saved-map metadata and the latest received preview.detail_map_idcomes from the pushed packet itself.clean_historyinherits its public data and derived accessors from theCleanHistorydataclass, aRoborockBasemodel. It exposes the latest received archive map, historical path and rendered bytes.refresh_detail()methods return after publishing. Device pushes populate the read models and notifyadd_update_listener()subscribers. Anasyncio.Lockserializes publication only; missing responses do not block later requests.Q10PropertiesApiroutes typedQ10CleanRecordDetailand saved-map packets to their archive owners. Archive updates cannot replace live-map state.detail_image_content.Consumer expectations and protocol limits
Subscribe before requesting an archive, then read the trait when its listener fires.
roborock/devices/README.mddocuments persistent-view usage and a one-shot listener/event example with a consumer-owned deadline. Trait methods do not create response-waiting tasks or futures.Clean-record detail packets carry no record identifier. Delayed pushes and selections from another client cannot be attributed reliably to a local selection, so this API exposes latest received detail without a
detail_recordassociation. Saved-map packets identify the map, but contain no request ID; consumers should inspectdetail_map_idbefore displaying a preview. A later received preview replaces the previous preview regardless of arrival order.Live-map updates use the normal trait listener API without revision counters. The CLI subscribes before requesting a push, waits for an update satisfying its state predicate, and unsubscribes on success, timeout or cancellation. Its existing 30-second deadline and optional cached-map fallback remain at the CLI boundary.
Dependencies
Archive parser support from #936 is merged, alongside #933, #908 and #965. This branch includes upstream
mainthroughb3a98b9(7.12.0).Validation
Validation of
f1f5e24:No physical-device run was performed for this revision. No private map captures or account data are included. Related: #767.