livekit / python-sdks

LiveKit real-time and server SDKs for Python
https://docs.livekit.io
Apache License 2.0
123 stars 37 forks source link

server send data has no participant #203

Closed DeoLeung closed 2 months ago

DeoLeung commented 4 months ago

if i do

      req = SendDataRequest(room='abc',
                            data=json.dumps({
                                'event': 'a',
                                'data':'b'
                            }))
        await room.send_data(req)

rtc room will fail with

/livekit/rtc/room.py", line 455, in _retrieve_remote_participant
     participant = self.participants[sid]
                 ~~~~~~~~~~~~~~~~~^^^^^
 KeyError: ''

currently inherited Room to workaround

self.participants.get(sid)

just new to livekit and not sure if we need a participant for server sent data

theomonnom commented 2 months ago

Hey, this should be fixed with https://github.com/livekit/python-sdks/pull/215