@stream-io/video-client 1.44.2 → 1.44.3

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
@@ -4025,6 +4025,8 @@ const retryable = async (rpc, signal, maxRetries = Number.POSITIVE_INFINITY) =>
4025
4025
  do {
4026
4026
  if (attempt > 0)
4027
4027
  await sleep(retryInterval(attempt));
4028
+ if (signal?.aborted)
4029
+ throw new Error(signal.reason);
4028
4030
  try {
4029
4031
  result = await rpc({ attempt });
4030
4032
  }
@@ -6301,7 +6303,7 @@ const getSdkVersion = (sdk) => {
6301
6303
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
6302
6304
  };
6303
6305
 
6304
- const version = "1.44.2";
6306
+ const version = "1.44.3";
6305
6307
  const [major, minor, patch] = version.split('.');
6306
6308
  let sdkInfo = {
6307
6309
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8602,6 +8604,7 @@ class StreamSfuClient {
8602
8604
  this.isClosingClean = false;
8603
8605
  this.pingIntervalInMs = 5 * 1000;
8604
8606
  this.unhealthyTimeoutInMs = 15 * 1000;
8607
+ this.subscriptionsConcurrencyTag = Symbol('subscriptionsConcurrencyTag');
8605
8608
  /**
8606
8609
  * Promise that resolves when the JoinResponse is received.
8607
8610
  * Rejects after a certain threshold if the response is not received.
@@ -8709,8 +8712,10 @@ class StreamSfuClient {
8709
8712
  this.close(StreamSfuClient.NORMAL_CLOSURE, reason.substring(0, 115));
8710
8713
  };
8711
8714
  this.updateSubscriptions = async (tracks) => {
8712
- await this.joinTask;
8713
- return retryable((invocationMeta) => this.rpc.updateSubscriptions({ sessionId: this.sessionId, tracks }, { invocationMeta }), this.abortController.signal);
8715
+ return withoutConcurrency(this.subscriptionsConcurrencyTag, async () => {
8716
+ await this.joinTask;
8717
+ return retryable((invocationMeta) => this.rpc.updateSubscriptions({ sessionId: this.sessionId, tracks }, { invocationMeta }), this.abortController.signal);
8718
+ });
8714
8719
  };
8715
8720
  this.setPublisher = async (data) => {
8716
8721
  await this.joinTask;
@@ -15903,7 +15908,7 @@ class StreamClient {
15903
15908
  this.getUserAgent = () => {
15904
15909
  if (!this.cachedUserAgent) {
15905
15910
  const { clientAppIdentifier = {} } = this.options;
15906
- const { sdkName = 'js', sdkVersion = "1.44.2", ...extras } = clientAppIdentifier;
15911
+ const { sdkName = 'js', sdkVersion = "1.44.3", ...extras } = clientAppIdentifier;
15907
15912
  this.cachedUserAgent = [
15908
15913
  `stream-video-${sdkName}-v${sdkVersion}`,
15909
15914
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),