Conversation
| participant, | ||
| event.participant_encryption_status_changed.is_encrypted, | ||
| ) | ||
| elif which == "participant_permissions_changed": |
There was a problem hiding this comment.
🔴 Mismatched protobuf oneof field name causes permission change events to be silently dropped
The elif branch at line 791 checks which == "participant_permissions_changed" (plural, with 's'), but the protobuf WhichOneof("message") returns "participant_permission_changed" (singular, no 's'). This means the branch never matches and permission change events are silently ignored.
Root Cause
In livekit-rtc/livekit/rtc/room.py:640-641, which is set via event.WhichOneof("message"). According to the protobuf definition in livekit-rtc/livekit/rtc/_proto/room_pb2.pyi:1468, the valid oneof values include "participant_permission_changed" (singular). However, line 791 compares against "participant_permissions_changed" (plural with 's'):
elif which == "participant_permissions_changed": # WRONG: extra 's'
identity = event.participant_permission_changed.participant_identity # correct field accessNote that the field access on line 792 (event.participant_permission_changed) correctly uses the singular form, confirming this is a typo in the which == comparison only.
Impact: The participant_permissions_changed event will never be emitted to listeners, and participant._info.permission will never be updated when permissions change. Users subscribing to "participant_permissions_changed" events will never receive callbacks, and participant.permissions will return stale data.
| elif which == "participant_permissions_changed": | |
| elif which == "participant_permission_changed": | |
Was this helpful? React with 👍 or 👎 to provide feedback.
depends on #568 (comment)