livekit / python-sdks

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

room: allow RemoteParticipant to be None #215

Closed nbsp closed 1 month ago

nbsp commented 1 month ago

should fix the bug when receiving messages from the server: this allows Python to fail gracefully to retrieve the remote participant.

davidzhao commented 1 month ago

looks like we need to update the return type too

nbsp commented 1 month ago

unsure why this is still erroring, i've got assert isinstance guards there..

davidzhao commented 1 month ago

unsure why this is still erroring, i've got assert isinstance guards there..

have you tried isinstance(obj, Participant) or if obj is not None ?

nbsp commented 1 month ago

unsure why this is still erroring, i've got assert isinstance guards there..

have you tried isinstance(obj, Participant) or if obj is not None ?

found a fix by using typing.cast