-
Notifications
You must be signed in to change notification settings - Fork 16
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
Allow returning user IDs from useParticipantIds
#7
Comments
See daily-co#7 for discussion.
@rileyjshaw I have been noodling on this a little longer now and wanted to provide an update: Rather than only changing This will be a bigger change and it will take a bit to get it done and wrapped up, but I think it's a more concise path forward compared to changing only a few hooks to allow for better support of Let me know in case you think this doesn't sound like the right approach to the underlying issue, or if you have additional thoughts or context on the usage of Cheers, |
@Regaddi thanks for following up! It’s an interesting idea, but it would not work for my use case. Needing to standardize on either I also think the Sorry for the push-back, just sharing my honest initial reaction. I think I’d end up needing to frequently toggle |
…and for what it’s worth, I am a fan of eventually being able to use |
Thank you for the thoughtful reply! We wouldn't change underlying daily-js APIs to accept In adding support for The proposal to add a top-level control via Perhaps it would require some more work to achieve the desired granularity in working with different parts of our API. Anyway I don't think that introducing an API change in I think my general proposal to achieve this would look something like this:
The actual change really depends on the migration path. And I definitely agree that we wouldn't want to introduce a fragile transition period. |
Thanks @Regaddi, that makes sense. I agree that it’s probably best to keep this on the backburner. My main issue is that I need to manage multiple sets of IDs, and that’s not specific to the Further contextMy app manages most user state outside of Daily. Users have unique IDs, and exist in a big user map: const users = {
"1234-abcd-5678-efgh": {
name: "Wendy",
avatar: 7,
// ...
sessionId: "lmno-pqrs-tuvw",
},
"2345-bcde-6789-fghi": {
name: "George",
avatar: 3,
// ...
sessionId: "wxyz-abcd-efgh",
},
...
} When a user joins the Daily call, I set their This works, but it’s cumbersome for situations where I need to see combine user state with Daily state. For instance, if I want a list of Daily screenshares and their associated user names, I need to do something like this: // ...
const sessionIds = useParticipantIds({ filter: 'screen' });
sessionIds.map(sessionId => {
return {
name: users.find(user => user.sessionId === sessionId.slice(-6)).name,
sessionId,
};
); If I could use Thanks for listening! 😅 and please let me know if you think I’m overlooking something. |
FWIW, the solution that works for us is grabbing the
|
Hi again! Since my last feature request sparked some good discussion, I’m adding another idea.
Feature request
Add an
idType
param to useParticipantIds to allow returning user IDs, instead of the default behaviour which returns session IDs.Why you need this
My application stores user data in a map keyed by participant user IDs. It would be really helpful to get a list of user IDs directly from this hook, rather than needing to store them in a separate
callState
object as shown here.Alternatives you've considered
This could go into its own hook called
useUserIds
oruseParticipantUserIds
, but that feels a bit heavy vs. the above proposal.Additional context
I can make a quick draft PR if this sounds useful.
The text was updated successfully, but these errors were encountered: