Skip to content

Commit 85dc99d

Browse files
authored
Fix missing offer in syncState (#1028)
It appears that the server is not using this field anyway, but this aligns with the other SDKs.
1 parent 85b94bd commit 85dc99d

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

.changes/fix-syncstate-offer

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patch type="fixed" "Include last server offer in SyncState during reconnection"

lib/src/core/engine.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,7 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
12311231
required List<String> trackSidsDisabled,
12321232
}) async {
12331233
final previousAnswer = (await subscriber?.pc.getLocalDescription())?.toPBType();
1234+
final previousOffer = (await subscriber?.pc.getRemoteDescription())?.toPBType();
12341235

12351236
// Build data channel receive states for reliability
12361237
final dataChannelReceiveStates = <lk_rtc.DataChannelReceiveState>[];
@@ -1245,6 +1246,7 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
12451246
}
12461247
signalClient.sendSyncState(
12471248
answer: previousAnswer,
1249+
offer: previousOffer,
12481250
subscription: subscription,
12491251
publishTracks: publishTracks,
12501252
dataChannelInfo: dataChannelInfo(),

lib/src/core/signal_client.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ extension SignalClientRequests on SignalClient {
485485
@internal
486486
void sendSyncState({
487487
required lk_rtc.SessionDescription? answer,
488+
required lk_rtc.SessionDescription? offer,
488489
required lk_rtc.UpdateSubscription subscription,
489490
required Iterable<lk_rtc.TrackPublishedResponse>? publishTracks,
490491
required Iterable<lk_rtc.DataChannelInfo>? dataChannelInfo,
@@ -494,6 +495,7 @@ extension SignalClientRequests on SignalClient {
494495
_sendRequest(lk_rtc.SignalRequest(
495496
syncState: lk_rtc.SyncState(
496497
answer: answer,
498+
offer: offer,
497499
subscription: subscription,
498500
publishTracks: publishTracks,
499501
dataChannels: dataChannelInfo,

0 commit comments

Comments
 (0)