Skip to content

Reconnection complete before remote track set causing an incorrect state sync #859

@jingxizheng

Description

@jingxizheng

Describe the bug
At the start of the call, the user's network changed (in our scenario, the user left the office and entered an elevator), switching from Wi-Fi to cellular, a brief network outage occurred.

  • After the network was restored, a quick reconnection occurred, the WebSocket connection was completed, marked as {{1}} in log.

  • A response (ParticipantUpdate) was received from the server, marked as {{2}} in log.

  • The client then began constructing a state synchronization request (SyncState), but unfortunately, the actual remote track was not yet ready, marked as {{3}} in log.

    This caused an error in UpdateSubscription within SyncState. The incorrect UpdateSubscription is as follows:

    { "track_sids": ["TR_AMTuXiKoMxwLbW"], "subscribe": false }
  • PeerConnection onTrack event fired, but it was too late, server is unsubscribing (LiveKit Server rtc/subscriptionmanager.go:181), then the user could no longer hear the sound, marked as {{4}} in log.

SDK Version
2.10.0

iOS/macOS Version
26.1

Logs
Please refer to the attachment and pay attention to the marked locations.

debug.log

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingroom

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions