Repository navigation
Allow metadata on multiple devices in parallel for REST - #15128
Merged
Merged
Conversation
Nir-Az
reviewed
May 31, 2026
Nir-Az
left a comment
Collaborator
There was a problem hiding this comment.
🤖 rs-agentic bot — automated PR review
This review was auto-generated by the rs-agentic bot. It covers potential bugs, enhancements, and guideline compliance for the multi-device-metadata change.
Summary
The core approach (per-device daemon threads + run_coroutine_threadsafe onto the FastAPI main loop) is architecturally sound and fixes the root cause. Several correctness and robustness issues are flagged inline.
⚠️ Missing Test Coverage
There is no test exercising the primary fix: two (or more) devices streaming simultaneously and both receiving metadata overlays. A test like:
def test_multi_device_metadata_parallel():
# start_broadcast for device_A and device_B
# assert both threads are alive and emitting
# stop_broadcast for each
# assert both threads terminate cleanlywould prevent regressions and document the expected multi-device contract.
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.
run_until_complete) torun_coroutine_threadsafeon the FastAPI main loop — required so N broadcasters can emit concurrently without racing on a shared loop.stop_streamcallsstop_broadcast(device_id);stop_sensorcalls it when the last sensor on a device stops.start_broadcasttarget had metadata).