-
Notifications
You must be signed in to change notification settings - Fork 81
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
Update useParticipants to listen for any Participant's info changes #980
Conversation
🦋 Changeset detectedLatest commit: b3ec185 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
what do you think @lukasIO? |
Thanks for catching this! We missed to update those events in the event group. |
.changeset/calm-rivers-behave.md
Outdated
@@ -0,0 +1,5 @@ | |||
--- | |||
'@livekit/components-core': minor |
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.
'@livekit/components-core': minor | |
'@livekit/components-core': patch |
as it's primarily a bugfix, I think we should mark it as a patch update
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.
Fixed, ready for merge @lukasIO !
@lebaudantoine feel free to open a subsequent PRs for the other missing events, we'd definitely want them to be part of |
Extended allRemoteParticipantRoomEvents to include participant state events, aligning with @Ocupe's original intent in livekit#306: covering "all room events that trigger state changes on a participant by default." Since both name and metadata are treated as participant info in some observers, it makes sense to include these events. Name changes won’t cause frequent re-renders, but attributes might. This raises larger questions: Does the current naming accurately reflect that not all remote participant events are covered? Should participantInfoObserver also track attributes, if we consider them part of the participant's information? Feedback and edits are more than welcome
Issue
This is my first contribution! I’d love any advice on how to contribute to the repo. While working with the
useParticipants
hook, I expected it to keep the participants list updated with their names. However, I found thatuseParticipants
only listens to metadata changes by default and does not react to updates in names or attributes.To ensure the participants list updates correctly, I called the hook as follows:
Additionally, I noticed that the term
updateOnlyOn
could be misleading, as it always includes three events. While the documentation clarifies this, it may cause confusion when reading the code.Solution
I found the previous implementation a bit convoluted. I propose that
useParticipants
should update on all room events that trigger state changes for a participant, as originally intended by @Ocupe. Additionally, please note that a few events related to end-to-end encryption and permissions are still missing from the current setup.