@stream-io/video-client 0.7.5 → 0.7.7

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,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.7.7](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.6...@stream-io/video-client-0.7.7) (2024-04-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * **feedback:** Collect user feedback ([#1324](https://github.com/GetStream/stream-video-js/issues/1324)) ([b415de0](https://github.com/GetStream/stream-video-js/commit/b415de0828e402f8d3b854553351843aad2e8473))
11
+
12
+ ### [0.7.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.5...@stream-io/video-client-0.7.6) (2024-04-23)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **client:** ignore SFU WS status code when the user initiates leaving a call ([#1323](https://github.com/GetStream/stream-video-js/issues/1323)) ([774882b](https://github.com/GetStream/stream-video-js/commit/774882b9e2bb3f3dc72401278c174e1a0f597ce1))
18
+
5
19
  ### [0.7.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.7.4...@stream-io/video-client-0.7.5) (2024-04-23)
6
20
 
7
21
 
@@ -11487,6 +11487,7 @@ class Call {
11487
11487
  this.trackSubscriptionsSubject = new BehaviorSubject({ type: DebounceType.MEDIUM, data: [] });
11488
11488
  this.reconnectAttempts = 0;
11489
11489
  this.maxReconnectAttempts = 10;
11490
+ this.isLeaving = false;
11490
11491
  /**
11491
11492
  * A list hooks/functions to invoke when the call is left.
11492
11493
  * A typical use case is to clean up some global event handlers.
@@ -11545,6 +11546,7 @@ class Call {
11545
11546
  if (callingState === CallingState.JOINING) {
11546
11547
  await this.assertCallJoined();
11547
11548
  }
11549
+ this.isLeaving = true;
11548
11550
  if (this.ringing) {
11549
11551
  // I'm the one who started the call, so I should cancel it.
11550
11552
  const hasOtherParticipants = this.state.remoteParticipants.length > 0;
@@ -11834,6 +11836,10 @@ class Call {
11834
11836
  // unregister the "goAway" handler, as we won't need it anymore for this connection.
11835
11837
  // the upcoming re-join will register a new handler anyway
11836
11838
  unregisterGoAway();
11839
+ // when the user has initiated "call.leave()" operation, we shouldn't
11840
+ // care for the WS close code and we shouldn't ever attempt to reconnect
11841
+ if (this.isLeaving)
11842
+ return;
11837
11843
  // do nothing if the connection was closed on purpose
11838
11844
  if (e.code === StreamSfuClient.NORMAL_CLOSURE)
11839
11845
  return;
@@ -12631,12 +12637,14 @@ class Call {
12631
12637
  if (rating < 1 || rating > 5) {
12632
12638
  throw new Error('Rating must be between 1 and 5');
12633
12639
  }
12634
- const userSessionId = this.sfuClient?.sessionId;
12635
12640
  const callSessionId = this.state.session?.id;
12636
- if (!callSessionId || !userSessionId) {
12641
+ if (!callSessionId) {
12637
12642
  throw new Error('Feedback can be submitted only in the context of a call session');
12638
12643
  }
12639
12644
  const { sdkName, sdkVersion, ...platform } = getSdkSignature(getClientDetails());
12645
+ // user sessionId is not available once the call has been left
12646
+ // until we relax the backend validation, we'll send N/A
12647
+ const userSessionId = this.sfuClient?.sessionId ?? 'N/A';
12640
12648
  const endpoint = `${this.streamClientBasePath}/feedback/${callSessionId}`;
12641
12649
  return this.streamClient.post(endpoint, {
12642
12650
  rating,
@@ -14474,7 +14482,7 @@ class StreamClient {
14474
14482
  });
14475
14483
  };
14476
14484
  this.getUserAgent = () => {
14477
- const version = "0.7.5" ;
14485
+ const version = "0.7.7" ;
14478
14486
  return (this.userAgent ||
14479
14487
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14480
14488
  };