@stream-io/video-client 1.15.3 → 1.15.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -3599,6 +3599,9 @@ const withoutConcurrency = createRunner(wrapWithContinuationTracking);
3599
3599
  */
3600
3600
  const withCancellation = createRunner(wrapWithCancellation);
3601
3601
  const pendingPromises = new Map();
3602
+ function hasPending(tag) {
3603
+ return pendingPromises.has(tag);
3604
+ }
3602
3605
  async function settled(tag) {
3603
3606
  await pendingPromises.get(tag)?.promise;
3604
3607
  }
@@ -7355,7 +7358,7 @@ const aggregate = (stats) => {
7355
7358
  return report;
7356
7359
  };
7357
7360
 
7358
- const version = "1.15.3";
7361
+ const version = "1.15.5";
7359
7362
  const [major, minor, patch] = version.split('.');
7360
7363
  let sdkInfo = {
7361
7364
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -10064,7 +10067,7 @@ class Call {
10064
10067
  }
10065
10068
  }));
10066
10069
  this.leaveCallHooks.add(
10067
- // cancel auto-drop when call is
10070
+ // cancel auto-drop when call is accepted or rejected
10068
10071
  createSubscription(this.state.session$, (session) => {
10069
10072
  if (!this.ringing)
10070
10073
  return;
@@ -10076,6 +10079,13 @@ class Call {
10076
10079
  if (isAcceptedByMe || isRejectedByMe) {
10077
10080
  this.cancelAutoDrop();
10078
10081
  }
10082
+ const isAcceptedElsewhere = isAcceptedByMe && this.state.callingState === exports.CallingState.RINGING;
10083
+ if ((isAcceptedElsewhere || isRejectedByMe) &&
10084
+ !hasPending(this.joinLeaveConcurrencyTag)) {
10085
+ this.leave().catch(() => {
10086
+ this.logger('error', 'Could not leave a call that was accepted or rejected elsewhere');
10087
+ });
10088
+ }
10079
10089
  }));
10080
10090
  this.leaveCallHooks.add(
10081
10091
  // "ringing" mode effects and event handlers
@@ -10245,6 +10255,7 @@ class Call {
10245
10255
  this.sfuClient = undefined;
10246
10256
  this.dynascaleManager.setSfuClient(undefined);
10247
10257
  this.state.setCallingState(exports.CallingState.LEFT);
10258
+ this.state.setParticipants([]);
10248
10259
  this.state.dispose();
10249
10260
  // Call all leave call hooks, e.g. to clean up global event handlers
10250
10261
  this.leaveCallHooks.forEach((hook) => hook());
@@ -12852,7 +12863,7 @@ class StreamClient {
12852
12863
  return await this.wsConnection.connect(this.defaultWSTimeout);
12853
12864
  };
12854
12865
  this.getUserAgent = () => {
12855
- const version = "1.15.3";
12866
+ const version = "1.15.5";
12856
12867
  return (this.userAgent ||
12857
12868
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12858
12869
  };