roster is empty sometimes?
See original GitHub issueWhile using useRosterState
I see roster is empty sometimes.
const { roster } = useRosterState();
const attendees = Object.values(roster);
But the attendeeIdToTileId
has the right details. const { attendeeIdToTileId } = useRemoteVideoTileState();
I am not able to reproduce when is that happening exactly, but I see it empty sometimes. What could be the reason? Is there a way I can make sure, it is not empty.
Using it like
// userCreatedRoom.jsx not root
<MeetingProvider>
<div className={classes.root}>
<UserActivityProvider>
<MeetingView
id={id}
/>
</UserActivityProvider>
</div>
</MeetingProvider>
then in MeetingView
export default function MeetingView({
id,
}) {
const meetingManager = useMeetingManager();
const meetingStatus = useMeetingStatus();
const audioVideo = useAudioVideo();
const { attendeeIdToTileId } = useRemoteVideoTileState();
const { roster } = useRosterState();
const attendees = Object.values(roster);
console.log('attendees', attendees); // empty array
useEffect(() => {
join(); // calls meetingManager.join() and start()
return () => {
console.log('closing meeting for', id);
meetingManager.leave();
};
}, [id]);
return(
<NiceUI />
);
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Keeping your Roster empty until game day and filling it in right ...
it's gonna be hilarious when you leaving your roster empty for zero advantage screws you over because your internet goes out and your...
Read more >Leaving an active roster empty for game week?
Our league voted on allowing empty roster spots 2 years ago but as long as it's not used for collusion. Hard to prove...
Read more >Notations for Solutions - MathBitsNotebook(A1 - CCSS Math)
Examples of rosters: { } denotes the empty set. The empty set is also denoted with the symbol null , and sometimes referred...
Read more >ASN article: Double Pivots, Empty Buckets, and the U.S. Roster
Simply put, a double pivot utilizes two holding midfielders, each of whom advance at times while the other holds. The result is usually...
Read more >What is up with Vendors and shops being empty?
Also, make some work rosters. If you can, keep the shops closer together where there is a lot of traffic. Make sure they...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So you are saying we need to add
meetingManager.getAttendee
? ATM we arent using this at all. ThenmeetingManager.getAttendee
should be must when you are usinguseRosterState
.Hi @subhendukundu ,
The roster is initialized to
{}
when theRosterProvider
is re-mounted or un-mounted (check here) and hence the state you are seeing is{}
.The library currently does not do any state management to maintain app-refreshes (browser window refreshes). The
RosterProvider
is dependent on therealtimeSubscribeToAttendeeIdPresence
API from Amazon Chime SDK for JavaScript, which we un-subscribe while un-mounting and subscribe while mounting if a validaudioVideo
object is present from themeetingSession
created in theMeetingManager
when you calljoin
and thenstart
onmeetingManager
fromuseMeetingManager
. So, on browser window refresh, since, no attendee would be present as there is no re-joining taking place in themeetingManager
upon browser window refresh, the roster state will be{}
as expected.Now, I am a bit confused on the
useRemoteVideoTileState
issue. The roster management is audio driven and theRemoteVideoTileProvider
which provides the remote video tile state usinguseRemoteVideoTileState
isvideoTileDidUpdate
andvideoTileDidRemoved
driven. We do reset the state (check here) when the component un-mounts and hence the mapattendeeIdToTileId
should be getting cleared as well. I suspect in your case, since theaudioVideo
object is not valid hence upon window refresh, this RESET never runs and hence the mismatch in state. Can you please add a breakpoint and see if the RESET action is triggered?I tested this by joining a meeting and leaving the meeting in our react meeting demo and it worked as expected and went through the RESET flow. Unfortunately, as mentioned we do not support browser window refresh and I could not test it as our meeting demo is not setup to handle such use-case.
I tried to check your minimal app but I could not run it due to multiple errors. To debug this further, could you please add an updated README in your minimal app with repro steps? Also, it would be great if you could remove any components that are un-related to this issue to make this a small repro demo.