@stream-io/video-client 1.23.1 → 1.23.2

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.23.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.23.1...@stream-io/video-client-1.23.2) (2025-05-22)
6
+
7
+ ### Bug Fixes
8
+
9
+ - rpc error tracing ([#1801](https://github.com/GetStream/stream-video-js/issues/1801)) ([a9e86d5](https://github.com/GetStream/stream-video-js/commit/a9e86d5e51e72b15d044e012f5fcc5a44907c325))
10
+
5
11
  ## [1.23.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.23.0...@stream-io/video-client-1.23.1) (2025-05-21)
6
12
 
7
13
  ### Bug Fixes
@@ -3411,22 +3411,18 @@ const withHeaders = (headers) => {
3411
3411
  const withRequestLogger = (logger, level) => {
3412
3412
  return {
3413
3413
  interceptUnary: (next, method, input, options) => {
3414
- let invocation;
3415
- try {
3416
- invocation = next(method, input, options);
3417
- }
3418
- finally {
3419
- logger(level, `Invoked SFU RPC method ${method.name}`, {
3420
- request: invocation?.request,
3421
- headers: invocation?.requestHeaders,
3422
- response: invocation?.response,
3423
- });
3424
- }
3414
+ const invocation = next(method, input, options);
3415
+ logger(level, `Invoked SFU RPC method ${method.name}`, {
3416
+ request: invocation.request,
3417
+ headers: invocation.requestHeaders,
3418
+ response: invocation.response,
3419
+ });
3425
3420
  return invocation;
3426
3421
  },
3427
3422
  };
3428
3423
  };
3429
3424
  const withRequestTracer = (trace) => {
3425
+ const traceError = (name, input, err) => trace(`${name}OnFailure`, [err, input]);
3430
3426
  const exclusions = {
3431
3427
  SendStats: true,
3432
3428
  };
@@ -3435,14 +3431,14 @@ const withRequestTracer = (trace) => {
3435
3431
  if (exclusions[method.name]) {
3436
3432
  return next(method, input, options);
3437
3433
  }
3438
- try {
3439
- trace(method.name, input);
3440
- return next(method, input, options);
3441
- }
3442
- catch (err) {
3443
- trace(`${method.name}OnFailure`, [input, err]);
3444
- throw err;
3445
- }
3434
+ trace(method.name, input);
3435
+ const unaryCall = next(method, input, options);
3436
+ unaryCall.then((invocation) => {
3437
+ const err = invocation.response?.error;
3438
+ if (err)
3439
+ traceError(method.name, input, err);
3440
+ }, (err) => traceError(method.name, input, err));
3441
+ return unaryCall;
3446
3442
  },
3447
3443
  };
3448
3444
  };
@@ -5680,7 +5676,7 @@ const aggregate = (stats) => {
5680
5676
  return report;
5681
5677
  };
5682
5678
 
5683
- const version = "1.23.1";
5679
+ const version = "1.23.2";
5684
5680
  const [major, minor, patch] = version.split('.');
5685
5681
  let sdkInfo = {
5686
5682
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -13787,7 +13783,7 @@ class StreamClient {
13787
13783
  this.getUserAgent = () => {
13788
13784
  if (!this.cachedUserAgent) {
13789
13785
  const { clientAppIdentifier = {} } = this.options;
13790
- const { sdkName = 'js', sdkVersion = "1.23.1", ...extras } = clientAppIdentifier;
13786
+ const { sdkName = 'js', sdkVersion = "1.23.2", ...extras } = clientAppIdentifier;
13791
13787
  this.cachedUserAgent = [
13792
13788
  `stream-video-${sdkName}-v${sdkVersion}`,
13793
13789
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),