@stream-io/video-client 1.38.2 → 1.39.1
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 +16 -0
- package/dist/index.browser.es.js +42 -18
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +42 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +42 -18
- package/dist/index.es.js.map +1 -1
- package/dist/src/StreamVideoClient.d.ts +5 -0
- package/package.json +7 -2
- package/src/StreamVideoClient.ts +40 -6
- package/src/__tests__/StreamVideoClient.test.ts +106 -0
- package/src/rpc/__tests__/createClient.test.ts +41 -0
- package/src/rpc/createClient.ts +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.39.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.39.0...@stream-io/video-client-1.39.1) (2025-12-18)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **provenance:** add repository info to every package ([4159633](https://github.com/GetStream/stream-video-js/commit/4159633b908afe6542b4be53151da6218175426c))
|
|
10
|
+
|
|
11
|
+
## [1.39.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.38.2...@stream-io/video-client-1.39.0) (2025-12-18)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **react:** Retryable call watching ([#2046](https://github.com/GetStream/stream-video-js/issues/2046)) ([7205011](https://github.com/GetStream/stream-video-js/commit/7205011a451995585848b89388c91ae9a1b0bc64))
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- add response tracing for the SetPublisher RPC ([#2055](https://github.com/GetStream/stream-video-js/issues/2055)) ([a25d9a8](https://github.com/GetStream/stream-video-js/commit/a25d9a89870db47be046f31c85888995e43d44cd))
|
|
20
|
+
|
|
5
21
|
## [1.38.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.38.1...@stream-io/video-client-1.38.2) (2025-12-11)
|
|
6
22
|
|
|
7
23
|
### Bug Fixes
|
package/dist/index.browser.es.js
CHANGED
|
@@ -3730,22 +3730,23 @@ const withRequestLogger = (logger, level) => {
|
|
|
3730
3730
|
};
|
|
3731
3731
|
};
|
|
3732
3732
|
const withRequestTracer = (trace) => {
|
|
3733
|
+
const exclusions = new Set(['SendStats']);
|
|
3734
|
+
const responseInclusions = new Set(['SetPublisher']);
|
|
3733
3735
|
const traceError = (name, input, err) => trace(`${name}OnFailure`, [err, input]);
|
|
3734
|
-
const exclusions = {
|
|
3735
|
-
SendStats: true,
|
|
3736
|
-
};
|
|
3737
3736
|
return {
|
|
3738
3737
|
interceptUnary(next, method, input, options) {
|
|
3739
|
-
|
|
3738
|
+
const name = method.name;
|
|
3739
|
+
if (exclusions.has(name))
|
|
3740
3740
|
return next(method, input, options);
|
|
3741
|
-
|
|
3742
|
-
trace(method.name, input);
|
|
3741
|
+
trace(name, input);
|
|
3743
3742
|
const unaryCall = next(method, input, options);
|
|
3744
3743
|
unaryCall.then((invocation) => {
|
|
3745
|
-
const
|
|
3746
|
-
if (
|
|
3747
|
-
traceError(
|
|
3748
|
-
|
|
3744
|
+
const response = invocation.response;
|
|
3745
|
+
if (response.error)
|
|
3746
|
+
traceError(name, input, response.error);
|
|
3747
|
+
if (responseInclusions.has(name))
|
|
3748
|
+
trace(`${name}Response`, response);
|
|
3749
|
+
}, (error) => traceError(name, input, error));
|
|
3749
3750
|
return unaryCall;
|
|
3750
3751
|
},
|
|
3751
3752
|
};
|
|
@@ -5993,7 +5994,7 @@ const getSdkVersion = (sdk) => {
|
|
|
5993
5994
|
return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
|
|
5994
5995
|
};
|
|
5995
5996
|
|
|
5996
|
-
const version = "1.
|
|
5997
|
+
const version = "1.39.1";
|
|
5997
5998
|
const [major, minor, patch] = version.split('.');
|
|
5998
5999
|
let sdkInfo = {
|
|
5999
6000
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -14992,7 +14993,7 @@ class StreamClient {
|
|
|
14992
14993
|
this.getUserAgent = () => {
|
|
14993
14994
|
if (!this.cachedUserAgent) {
|
|
14994
14995
|
const { clientAppIdentifier = {} } = this.options;
|
|
14995
|
-
const { sdkName = 'js', sdkVersion = "1.
|
|
14996
|
+
const { sdkName = 'js', sdkVersion = "1.39.1", ...extras } = clientAppIdentifier;
|
|
14996
14997
|
this.cachedUserAgent = [
|
|
14997
14998
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
14998
14999
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|
|
@@ -15196,12 +15197,7 @@ class StreamVideoClient {
|
|
|
15196
15197
|
.map((call) => call.cid);
|
|
15197
15198
|
if (callsToReWatch.length <= 0)
|
|
15198
15199
|
return;
|
|
15199
|
-
this.
|
|
15200
|
-
this.queryCalls({
|
|
15201
|
-
watch: true,
|
|
15202
|
-
filter_conditions: { cid: { $in: callsToReWatch } },
|
|
15203
|
-
sort: [{ field: 'cid', direction: 1 }],
|
|
15204
|
-
}).catch((err) => {
|
|
15200
|
+
this.rewatchCalls(callsToReWatch).catch((err) => {
|
|
15205
15201
|
this.logger.error('Failed to re-watch calls', err);
|
|
15206
15202
|
});
|
|
15207
15203
|
}));
|
|
@@ -15265,6 +15261,34 @@ class StreamVideoClient {
|
|
|
15265
15261
|
this.logger.error(`Failed to init call from event ${e.type}`, err);
|
|
15266
15262
|
}
|
|
15267
15263
|
};
|
|
15264
|
+
/**
|
|
15265
|
+
* Rewatches the given calls with retry logic.
|
|
15266
|
+
* @param callsToReWatch array of call IDs to rewatch
|
|
15267
|
+
*/
|
|
15268
|
+
this.rewatchCalls = async (callsToReWatch) => {
|
|
15269
|
+
this.logger.info(`Rewatching calls ${callsToReWatch.join(', ')}`);
|
|
15270
|
+
const maxRetries = 3;
|
|
15271
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
15272
|
+
try {
|
|
15273
|
+
this.logger.info(`Rewatching calls ${callsToReWatch.join(', ')} attempt ${attempt + 1}`);
|
|
15274
|
+
await this.queryCalls({
|
|
15275
|
+
watch: true,
|
|
15276
|
+
filter_conditions: { cid: { $in: callsToReWatch } },
|
|
15277
|
+
});
|
|
15278
|
+
return;
|
|
15279
|
+
}
|
|
15280
|
+
catch (err) {
|
|
15281
|
+
if (err instanceof ErrorFromResponse && err.unrecoverable) {
|
|
15282
|
+
throw err;
|
|
15283
|
+
}
|
|
15284
|
+
this.logger.warn(`Failed to re-watch calls (attempt ${attempt + 1}/${maxRetries}), retrying.`, err);
|
|
15285
|
+
if (attempt === maxRetries - 1) {
|
|
15286
|
+
throw err;
|
|
15287
|
+
}
|
|
15288
|
+
}
|
|
15289
|
+
await sleep(retryInterval(attempt));
|
|
15290
|
+
}
|
|
15291
|
+
};
|
|
15268
15292
|
/**
|
|
15269
15293
|
* Connects the given user to the client.
|
|
15270
15294
|
* Only one user can connect at a time, if you want to change users, call `disconnectUser` before connecting a new user.
|