switch to a single redis subscriber, close properly
This commit is contained in:
+2
-2
@@ -102,7 +102,7 @@ func (r *Room) Join(participant types.Participant) error {
|
||||
"oldState", oldState)
|
||||
r.broadcastParticipantState(p)
|
||||
|
||||
if oldState == livekit.ParticipantInfo_JOINING && p.State() == livekit.ParticipantInfo_JOINED {
|
||||
if p.State() == livekit.ParticipantInfo_ACTIVE {
|
||||
// subscribe participant to existing publishedTracks
|
||||
for _, op := range r.GetParticipants() {
|
||||
if p.ID() == op.ID() {
|
||||
@@ -215,7 +215,7 @@ func (r *Room) onTrackAdded(participant types.Participant, track types.Published
|
||||
// skip publishing participant
|
||||
continue
|
||||
}
|
||||
if !existingParticipant.IsReady() {
|
||||
if existingParticipant.State() != livekit.ParticipantInfo_ACTIVE {
|
||||
// not fully joined. don't subscribe yet
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ func TestRoomJoin(t *testing.T) {
|
||||
|
||||
stateChangeCB := p.OnStateChangeArgsForCall(0)
|
||||
assert.NotNil(t, stateChangeCB)
|
||||
p.StateReturns(livekit.ParticipantInfo_JOINED)
|
||||
stateChangeCB(p, livekit.ParticipantInfo_JOINING)
|
||||
p.StateReturns(livekit.ParticipantInfo_ACTIVE)
|
||||
stateChangeCB(p, livekit.ParticipantInfo_JOINED)
|
||||
|
||||
// it should become a subscriber when connectivity changes
|
||||
for _, op := range rm.GetParticipants() {
|
||||
@@ -176,9 +176,9 @@ func TestNewTrack(t *testing.T) {
|
||||
rm := newRoomWithParticipants(t, 3)
|
||||
participants := rm.GetParticipants()
|
||||
p0 := participants[0].(*typesfakes.FakeParticipant)
|
||||
p0.IsReadyReturns(false)
|
||||
p0.StateReturns(livekit.ParticipantInfo_JOINED)
|
||||
p1 := participants[1].(*typesfakes.FakeParticipant)
|
||||
p1.IsReadyReturns(true)
|
||||
p1.StateReturns(livekit.ParticipantInfo_ACTIVE)
|
||||
|
||||
pub := participants[2].(*typesfakes.FakeParticipant)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user