@stream-io/video-client 0.0.12 → 0.0.13

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,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.0.13](https://github.com/GetStream/stream-video-js/compare/client0.0.12...client0.0.13) (2023-06-15)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * do not send ring to backend if call was not created by the user ([#645](https://github.com/GetStream/stream-video-js/issues/645)) ([1fa8ffb](https://github.com/GetStream/stream-video-js/commit/1fa8ffbb7373e9eff497bfe1ce48a970aedc0d9d))
11
+
5
12
  ### [0.0.12](https://github.com/GetStream/stream-video-js/compare/client0.0.11...client0.0.12) (2023-06-13)
6
13
 
7
14
 
@@ -11002,7 +11002,7 @@ class StreamClient {
11002
11002
  }
11003
11003
  getUserAgent() {
11004
11004
  return (this.userAgent ||
11005
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.11"}`);
11005
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.12"}`);
11006
11006
  }
11007
11007
  setUserAgent(userAgent) {
11008
11008
  this.userAgent = userAgent;
@@ -11328,21 +11328,20 @@ class StreamVideoClient {
11328
11328
  }
11329
11329
  // The call might already be tracked by the client,
11330
11330
  // if `call.created` was received before `call.ring`.
11331
- // In that case, we just reuse the already tracked call.
11332
- let theCall = this.writeableStateStore.findCall(call.type, call.id);
11333
- if (!theCall) {
11334
- // otherwise, we create a new call
11335
- theCall = new Call({
11336
- streamClient: this.streamClient,
11337
- type: call.type,
11338
- id: call.id,
11339
- members,
11340
- clientStore: this.writeableStateStore,
11341
- ringing: true,
11342
- });
11343
- }
11331
+ // In that case, we cleanup the already tracked call.
11332
+ const prevCall = this.writeableStateStore.findCall(call.type, call.id);
11333
+ yield (prevCall === null || prevCall === void 0 ? void 0 : prevCall.leave());
11334
+ // we create a new call
11335
+ const theCall = new Call({
11336
+ streamClient: this.streamClient,
11337
+ type: call.type,
11338
+ id: call.id,
11339
+ members,
11340
+ clientStore: this.writeableStateStore,
11341
+ ringing: true,
11342
+ });
11344
11343
  // we fetch the latest metadata for the call from the server
11345
- yield theCall.get({ ring: true });
11344
+ yield theCall.get();
11346
11345
  this.writeableStateStore.registerCall(theCall);
11347
11346
  })));
11348
11347
  return connectUserResponse;