File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " livekit-client " : patch
3+ ---
4+
5+ fix: ensure offerId is only increased when offers are actually generated
Original file line number Diff line number Diff line change @@ -258,10 +258,6 @@ export default class PCTransport extends EventEmitter {
258258 const unlock = await this . offerLock . lock ( ) ;
259259
260260 try {
261- // increase the offer id at the start to ensure the offer is always > 0 so that we can use 0 as a default value for legacy behavior
262- const offerId = this . latestOfferId + 1 ;
263- this . latestOfferId = offerId ;
264-
265261 if ( this . onOffer === undefined ) {
266262 return ;
267263 }
@@ -290,6 +286,9 @@ export default class PCTransport extends EventEmitter {
290286
291287 // actually negotiate
292288 this . log . debug ( 'starting to negotiate' , this . logContext ) ;
289+ // increase the offer id at the start to ensure the offer is always > 0 so that we can use 0 as a default value for legacy behavior
290+ const offerId = this . latestOfferId + 1 ;
291+ this . latestOfferId = offerId ;
293292 const offer = await this . pc . createOffer ( options ) ;
294293 this . log . debug ( 'original offer' , { sdp : offer . sdp , ...this . logContext } ) ;
295294
You can’t perform that action at this time.
0 commit comments