resolve downtrack.bind/close timing issue (#833)
* resolve downtrack.bind/close timing issue * fix test case
This commit is contained in:
@@ -974,8 +974,8 @@ func (p *ParticipantImpl) UpdateSubscribedTrackSettings(trackID livekit.TrackID,
|
||||
subTrack := p.subscribedTracks[trackID]
|
||||
if subTrack == nil {
|
||||
p.lock.Unlock()
|
||||
p.params.Logger.Warnw("could not find subscribed track", nil, "trackID", trackID)
|
||||
return errors.New("could not find subscribed track")
|
||||
p.params.Logger.Infow("could not find subscribed track", "trackID", trackID)
|
||||
return nil
|
||||
}
|
||||
p.lock.Unlock()
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ func TestJoinedState(t *testing.T) {
|
||||
t.Run("should be current time when a participant joins", func(t *testing.T) {
|
||||
s := time.Now().Unix()
|
||||
rm := newRoomWithParticipants(t, testRoomOpts{num: 1})
|
||||
require.Equal(t, s, rm.FirstJoinedAt())
|
||||
require.LessOrEqual(t, s, rm.FirstJoinedAt())
|
||||
require.Equal(t, int64(0), rm.LastLeftAt())
|
||||
})
|
||||
|
||||
@@ -55,7 +55,7 @@ func TestJoinedState(t *testing.T) {
|
||||
p0 := rm.GetParticipants()[0]
|
||||
s := time.Now().Unix()
|
||||
rm.RemoveParticipant(p0.Identity(), types.ParticipantCloseReasonClientRequestLeave)
|
||||
require.Equal(t, s, rm.LastLeftAt())
|
||||
require.LessOrEqual(t, s, rm.LastLeftAt())
|
||||
})
|
||||
|
||||
t.Run("LastLeftAt should not be set when there are still participants in the room", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user