This error seems to be happening inside VivoxServiceInternal
in the OnParticipantRemoved
method.
public void OnParticipantRemoved(object sender, KeyEventArg<string> keyEventArg)
{
var source = (IReadOnlyDictionary<string, IParticipant>)sender;
IParticipant participant = source[keyEventArg.Key];
var relevantChannelName = participant.ParentChannelSession.Channel.Name;
// The local player won't have the active channel anymore if they've left so don't try to remove participants it's gone.
if (m_ActiveChannels.Keys.Contains(relevantChannelName))
{
var channelWithPartToRemove = m_ActiveChannels.First(kvp => kvp.Key == relevantChannelName);
var participantToRemove = channelWithPartToRemove.Value.First(p => p.PlayerId == participant.Account.Name);
channelWithPartToRemove.Value.Remove(participantToRemove);
ParticipantRemovedFromChannel?.Invoke(participantToRemove);
}
}
I believe its one of these lines:
var channelWithPartToRemove = m_ActiveChannels.First(kvp => kvp.Key == relevantChannelName);
var participantToRemove = channelWithPartToRemove.Value.First(p => p.PlayerId == participant.Account.Name);
Since we’re getting this error: InvalidOperationException Sequence contains no matching element
It means that “.First()” is failing to find that element
Could I be doing something wrong to cause this error? I’m thinking that its a bug with the internal service since its before invoking an event that I listen to. I could be wrong. Any help or confirmation that this is a bug would be awesome! thank you~