-
Notifications
You must be signed in to change notification settings - Fork 112
expose participant permissions #568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| participant, | ||
| event.participant_encryption_status_changed.is_encrypted, | ||
| ) | ||
| elif which == "participant_permissions_changed": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 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)