@stream-io/video-client 1.27.2 → 1.27.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.27.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.27.2...@stream-io/video-client-1.27.3) (2025-08-07)
6
+
7
+ ### Bug Fixes
8
+
9
+ - extended telemetry data for the signal websocket ([#1881](https://github.com/GetStream/stream-video-js/issues/1881)) ([984703d](https://github.com/GetStream/stream-video-js/commit/984703dabb8c6189eaf4d6925421568f6d0fd7fc))
10
+
5
11
  ## [1.27.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.27.1...@stream-io/video-client-1.27.2) (2025-08-05)
6
12
 
7
13
  ### Bug Fixes
@@ -5914,7 +5914,7 @@ const aggregate = (stats) => {
5914
5914
  return report;
5915
5915
  };
5916
5916
 
5917
- const version = "1.27.2";
5917
+ const version = "1.27.3";
5918
5918
  const [major, minor, patch] = version.split('.');
5919
5919
  let sdkInfo = {
5920
5920
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -7633,19 +7633,22 @@ class Subscriber extends BasePeerConnection {
7633
7633
  }
7634
7634
 
7635
7635
  const createWebSocketSignalChannel = (opts) => {
7636
- const { endpoint, onMessage, tag } = opts;
7636
+ const { endpoint, onMessage, tag, tracer } = opts;
7637
7637
  const logger = getLogger(['SfuClientWS', tag]);
7638
7638
  logger('debug', 'Creating signaling WS channel:', endpoint);
7639
7639
  const ws = new WebSocket(endpoint);
7640
7640
  ws.binaryType = 'arraybuffer'; // do we need this?
7641
7641
  ws.addEventListener('error', (e) => {
7642
7642
  logger('error', 'Signaling WS channel error', e);
7643
+ tracer?.trace('signal.ws.error', e);
7643
7644
  });
7644
7645
  ws.addEventListener('close', (e) => {
7645
7646
  logger('info', 'Signaling WS channel is closed', e);
7647
+ tracer?.trace('signal.ws.close', e);
7646
7648
  });
7647
7649
  ws.addEventListener('open', (e) => {
7648
7650
  logger('info', 'Signaling WS channel is open', e);
7651
+ tracer?.trace('signal.ws.open', e);
7649
7652
  });
7650
7653
  ws.addEventListener('message', (e) => {
7651
7654
  try {
@@ -7655,7 +7658,9 @@ const createWebSocketSignalChannel = (opts) => {
7655
7658
  onMessage(message);
7656
7659
  }
7657
7660
  catch (err) {
7658
- logger('error', 'Failed to decode a message. Check whether the Proto models match.', { event: e, error: err });
7661
+ const message = 'Failed to decode a message. Check whether the Proto models match.';
7662
+ logger('error', message, { event: e, error: err });
7663
+ tracer?.trace('signal.ws.message.error', message);
7659
7664
  }
7660
7665
  });
7661
7666
  return ws;
@@ -7927,6 +7932,7 @@ class StreamSfuClient {
7927
7932
  this.signalWs = createWebSocketSignalChannel({
7928
7933
  tag: this.tag,
7929
7934
  endpoint: `${this.credentials.server.ws_endpoint}?${new URLSearchParams(params).toString()}`,
7935
+ tracer: this.tracer,
7930
7936
  onMessage: (message) => {
7931
7937
  this.lastMessageTimestamp = new Date();
7932
7938
  this.scheduleConnectionCheck();
@@ -7937,9 +7943,13 @@ class StreamSfuClient {
7937
7943
  this.dispatcher.dispatch(message, this.tag);
7938
7944
  },
7939
7945
  });
7946
+ let timeoutId;
7940
7947
  this.signalReady = makeSafePromise(Promise.race([
7941
7948
  new Promise((resolve, reject) => {
7949
+ let didOpen = false;
7942
7950
  const onOpen = () => {
7951
+ didOpen = true;
7952
+ clearTimeout(timeoutId);
7943
7953
  this.signalWs.removeEventListener('open', onOpen);
7944
7954
  resolve(this.signalWs);
7945
7955
  };
@@ -7947,19 +7957,25 @@ class StreamSfuClient {
7947
7957
  this.signalWs.addEventListener('close', (e) => {
7948
7958
  this.handleWebSocketClose(e);
7949
7959
  // Normally, this shouldn't have any effect, because WS should never emit 'close'
7950
- // before emitting 'open'. However, strager things have happened, and we don't
7951
- // want to leave signalReady in pending state.
7952
- reject(new Error(`SFU WS closed or connection can't be established`));
7960
+ // before emitting 'open'. However, stranger things have happened, and we don't
7961
+ // want to leave signalReady in a pending state.
7962
+ const message = didOpen
7963
+ ? `SFU WS closed: ${e.code} ${e.reason}`
7964
+ : `SFU WS connection can't be established: ${e.code} ${e.reason}`;
7965
+ this.tracer?.trace('signal.close', message);
7966
+ clearTimeout(timeoutId);
7967
+ reject(new Error(message));
7953
7968
  });
7954
7969
  }),
7955
7970
  new Promise((resolve, reject) => {
7956
- setTimeout(() => reject(new Error('SFU WS connection timed out')), this.joinResponseTimeout);
7971
+ timeoutId = setTimeout(() => {
7972
+ const message = `SFU WS connection failed to open after ${this.joinResponseTimeout}ms`;
7973
+ this.tracer?.trace('signal.timeout', message);
7974
+ reject(new Error(message));
7975
+ }, this.joinResponseTimeout);
7957
7976
  }),
7958
7977
  ]));
7959
7978
  };
7960
- this.cleanUpWebSocket = () => {
7961
- this.signalWs.removeEventListener('close', this.handleWebSocketClose);
7962
- };
7963
7979
  this.handleWebSocketClose = (e) => {
7964
7980
  this.signalWs.removeEventListener('close', this.handleWebSocketClose);
7965
7981
  getTimers().clearInterval(this.keepAliveInterval);
@@ -7971,7 +7987,7 @@ class StreamSfuClient {
7971
7987
  if (this.signalWs.readyState === WebSocket.OPEN) {
7972
7988
  this.logger('debug', `Closing SFU WS connection: ${code} - ${reason}`);
7973
7989
  this.signalWs.close(code, `js-client: ${reason}`);
7974
- this.cleanUpWebSocket();
7990
+ this.signalWs.removeEventListener('close', this.handleWebSocketClose);
7975
7991
  }
7976
7992
  this.dispose();
7977
7993
  };
@@ -14498,7 +14514,7 @@ class StreamClient {
14498
14514
  this.getUserAgent = () => {
14499
14515
  if (!this.cachedUserAgent) {
14500
14516
  const { clientAppIdentifier = {} } = this.options;
14501
- const { sdkName = 'js', sdkVersion = "1.27.2", ...extras } = clientAppIdentifier;
14517
+ const { sdkName = 'js', sdkVersion = "1.27.3", ...extras } = clientAppIdentifier;
14502
14518
  this.cachedUserAgent = [
14503
14519
  `stream-video-${sdkName}-v${sdkVersion}`,
14504
14520
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),