fix(daily): queue outbound messages until transport joins#3615
Open
omChauhanDev wants to merge 3 commits intopipecat-ai:mainfrom
Open
fix(daily): queue outbound messages until transport joins#3615omChauhanDev wants to merge 3 commits intopipecat-ai:mainfrom
omChauhanDev wants to merge 3 commits intopipecat-ai:mainfrom
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
aconchillo
reviewed
Feb 7, 2026
| self._audio_task = None | ||
| self._video_task = None | ||
| self._message_queue: Optional[asyncio.Queue] = None | ||
| self._message_task = None |
Contributor
There was a problem hiding this comment.
I don't think we need an additional task. We can just queue the messages and flush them in join() when we know we are joined.
Also, maybe rename _message_queue to _join_message_queue so it's a bit more clear what it is.
Contributor
There was a problem hiding this comment.
I'd just add a small function self._flush_join_messages().
Contributor
Author
There was a problem hiding this comment.
yes, this sounds much cleaner....done thanks
9525584 to
a4e187e
Compare
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.
Please describe the changes in your PR. If it is addressing an issue, please reference that as well.
Fixes #3578
Problem
A race condition exists during pipeline startup when using
RTVIObserverwithDailyTransport. The observer emits messages (e.g.,bot-ready, metrics) immediately upon receiving theStartFrame, butDailyTransport.join()is asynchronous. This causes the transport to reject messages withERROR | Unable to send message: Unable to send messages before joining.Solution
Buffer outbound messages in
_join_message_queueand flush them once join succeeds.Testing
Before :

After :

Also verified(at client side) that initial messages are now successfully received after the transport joins.