livekit-client 1.15.8 → 1.15.10

Sign up to get free protection for your applications and to get access to all the features.
package/src/room/Room.ts CHANGED
@@ -772,6 +772,30 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
772
772
  // @ts-expect-error function is private
773
773
  await this.engine.client.handleOnClose('simulate resume-disconnect');
774
774
  break;
775
+ case 'disconnect-signal-on-resume':
776
+ postAction = async () => {
777
+ // @ts-expect-error function is private
778
+ await this.engine.client.handleOnClose('simulate resume-disconnect');
779
+ };
780
+ req = new SimulateScenario({
781
+ scenario: {
782
+ case: 'disconnectSignalOnResume',
783
+ value: true,
784
+ },
785
+ });
786
+ break;
787
+ case 'disconnect-signal-on-resume-no-messages':
788
+ postAction = async () => {
789
+ // @ts-expect-error function is private
790
+ await this.engine.client.handleOnClose('simulate resume-disconnect');
791
+ };
792
+ req = new SimulateScenario({
793
+ scenario: {
794
+ case: 'disconnectSignalOnResumeNoMessages',
795
+ value: true,
796
+ },
797
+ });
798
+ break;
775
799
  case 'full-reconnect':
776
800
  this.engine.fullReconnectOnNext = true;
777
801
  // @ts-expect-error function is private
@@ -808,11 +832,12 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
808
832
  },
809
833
  });
810
834
  break;
835
+
811
836
  default:
812
837
  }
813
838
  if (req) {
814
- this.engine.client.sendSimulateScenario(req);
815
- postAction();
839
+ await this.engine.client.sendSimulateScenario(req);
840
+ await postAction();
816
841
  }
817
842
  }
818
843
 
@@ -1648,6 +1673,10 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
1648
1673
  this.log.warn('detected connection state mismatch', {
1649
1674
  ...this.logContext,
1650
1675
  numFailures: consecutiveFailures,
1676
+ engine: {
1677
+ closed: this.engine.isClosed,
1678
+ transportsConnected: this.engine.verifyTransport(),
1679
+ },
1651
1680
  });
1652
1681
  if (consecutiveFailures >= 3) {
1653
1682
  this.recreateEngine();
@@ -1799,7 +1828,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
1799
1828
  await window.navigator.mediaDevices.getUserMedia({ video: true })
1800
1829
  ).getVideoTracks()[0]
1801
1830
  : createDummyVideoStreamTrack(
1802
- 160 * participantOptions.aspectRatios[0] ?? 1,
1831
+ 160 * (participantOptions.aspectRatios[0] ?? 1),
1803
1832
  160,
1804
1833
  true,
1805
1834
  true,
@@ -1849,7 +1878,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
1849
1878
  const p = this.getOrCreateParticipant(info.identity, info);
1850
1879
  if (participantOptions.video) {
1851
1880
  const dummyVideo = createDummyVideoStreamTrack(
1852
- 160 * participantOptions.aspectRatios[i % participantOptions.aspectRatios.length] ?? 1,
1881
+ 160 * (participantOptions.aspectRatios[i % participantOptions.aspectRatios.length] ?? 1),
1853
1882
  160,
1854
1883
  false,
1855
1884
  true,
@@ -12,6 +12,7 @@ export const enum ConnectionErrorReason {
12
12
  ServerUnreachable,
13
13
  InternalError,
14
14
  Cancelled,
15
+ LeaveRequest,
15
16
  }
16
17
 
17
18
  export class ConnectionError extends LivekitError {
package/src/room/types.ts CHANGED
@@ -40,7 +40,9 @@ export type SimulationScenario =
40
40
  // overrides server-side bandwidth estimator with set bandwidth
41
41
  // this can be used to test application behavior when congested or
42
42
  // to disable congestion control entirely (by setting bandwidth to 100Mbps)
43
- | 'subscriber-bandwidth';
43
+ | 'subscriber-bandwidth'
44
+ | 'disconnect-signal-on-resume'
45
+ | 'disconnect-signal-on-resume-no-messages';
44
46
 
45
47
  export type LoggerOptions = {
46
48
  loggerName?: string;