Skip to content

Navigation Menu

Sign in
Sign up

Text/byte stream handling bug, documentation issues - #379

Open
onorabil wants to merge 5 commits into
livekit:main from
onorabil:patch-1
Open

Text/byte stream handling bug, documentation issues #379
onorabil wants to merge 5 commits into
livekit:main from
onorabil:patch-1

Conversation

@onorabil

@onorabil onorabil commented Mar 1, 2025

Copy link
Copy Markdown

Fix for RuntimeWarning: coroutine 'RoomManager.handle_text_stream' was never awaited This occurs when a message is received from a text (or byte) stream.

As shown in the documentation here, https://docs.livekit.io/home/client/data/text-streams/ a stream should register a handle like this:

room.register_text_stream_handler(
 "my-topic",
 handle_text_stream
)

But this results in the error above.

Furthmore, some documentation from the text-streams page above is wrong.

  1. handling streams > python > f' ID: {info.id}\n' should read f' ID: {info.stream_id}\n'
  2. handling streams > javascript > room.registerTextStreamHandler('my-topic', (reader, participantInfo) => { should read room.registerTextStreamHandler('my-topic', async (reader, participantInfo) => {

onorabil added 2 commits March 1, 2025 17:43
Fix for RuntimeWarning: coroutine 'RoomManager.handle_text_stream' was never awaited
This occurs when a message is received from a text stream.

CLAassistant commented Mar 1, 2025
edited
Loading

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@onorabil thanks for the fix. we've got a couple of CI failures, do you mind taking a look?

onorabil commented Mar 2, 2025

Copy link
Copy Markdown
Author

You're welcome! 1/2 failures fixed, the second one appears to be github actions related / branch not in livekit/python-sdks.

2025年03月01日T23:26:57.8896834Z ##[group]Run actions/checkout@v3
2025年03月01日T23:26:57.8897662Z with:
2025年03月01日T23:26:57.8898053Z submodules: true
2025年03月01日T23:26:57.8898473Z ref: patch-1 #this branch is not available in livekit/python-sdks
2025年03月01日T23:26:57.8898908Z repository: livekit/python-sdks
...
2025年03月01日T23:26:58.1860097Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +refs/heads/patch-1*:refs/remotes/origin/patch-1* +refs/tags/patch-1*:refs/tags/patch-1* #main issue
2025年03月01日T23:26:58.4375152Z The process '/usr/bin/git' failed with exit code 1

lukasIO commented Mar 2, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

This was done on purpose, the responsibility for asynchronous management for the handler was supposed to live in user land, so having a synchronous callback and using asyncio task handling within the callback.

the docs need an update to reflect that.

curious to hear @theomonnom take on this

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

Reviewers

@lukasIO lukasIO Awaiting requested review from lukasIO lukasIO is a code owner
@longcw longcw Awaiting requested review from longcw

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /