@stream-io/video-client 1.28.0 → 1.28.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 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.28.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.28.0...@stream-io/video-client-1.28.1) (2025-08-22)
6
+
7
+ ### Bug Fixes
8
+
9
+ - handle pre ended calls on ringing push arrival ([#1897](https://github.com/GetStream/stream-video-js/issues/1897)) ([935e375](https://github.com/GetStream/stream-video-js/commit/935e3756035639c651b3ac4469321a64b8576a0e))
10
+
5
11
  ## [1.28.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.27.5...@stream-io/video-client-1.28.0) (2025-08-21)
6
12
 
7
13
  ### Features
@@ -5653,7 +5653,7 @@ const getSdkVersion = (sdk) => {
5653
5653
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
5654
5654
  };
5655
5655
 
5656
- const version = "1.28.0";
5656
+ const version = "1.28.1";
5657
5657
  const [major, minor, patch] = version.split('.');
5658
5658
  let sdkInfo = {
5659
5659
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8743,10 +8743,6 @@ const registerEventHandlers = (call, dispatcher) => {
8743
8743
  call.on('inboundStateNotification', watchInboundStateNotification(state)),
8744
8744
  handleRemoteSoftMute(call),
8745
8745
  ];
8746
- if (call.ringing) {
8747
- // these events are only relevant when the call is ringing
8748
- eventHandlers.push(registerRingingCallEventHandlers(call));
8749
- }
8750
8746
  return () => {
8751
8747
  eventHandlers.forEach((unsubscribe) => unsubscribe());
8752
8748
  };
@@ -11538,6 +11534,21 @@ class Call {
11538
11534
  });
11539
11535
  }
11540
11536
  }));
11537
+ if (this.ringing) {
11538
+ // if the call is ringing, we need to register the ringing call effects
11539
+ this.handleRingingCall();
11540
+ }
11541
+ else {
11542
+ // if the call is not ringing, we need to register the ringing call subscriptions
11543
+ // to handle the case when the call gets ringing flag after creation event
11544
+ this.leaveCallHooks.add(
11545
+ // "ringing" mode effects and event handlers
11546
+ createSubscription(this.ringingSubject, (isRinging) => {
11547
+ if (!isRinging)
11548
+ return;
11549
+ this.handleRingingCall();
11550
+ }));
11551
+ }
11541
11552
  this.leaveCallHooks.add(
11542
11553
  // cancel auto-drop when call is accepted or rejected
11543
11554
  createSubscription(this.state.session$, (session) => {
@@ -11559,53 +11570,49 @@ class Call {
11559
11570
  });
11560
11571
  }
11561
11572
  }));
11562
- this.leaveCallHooks.add(
11563
- // "ringing" mode effects and event handlers
11564
- createSubscription(this.ringingSubject, (isRinging) => {
11565
- if (!isRinging)
11566
- return;
11567
- const callSession = this.state.session;
11568
- const receiver_id = this.clientStore.connectedUser?.id;
11569
- const ended_at = callSession?.ended_at;
11570
- const created_by_id = this.state.createdBy?.id;
11571
- const rejected_by = callSession?.rejected_by;
11572
- const accepted_by = callSession?.accepted_by;
11573
- let leaveCallIdle = false;
11574
- if (ended_at) {
11575
- // call was ended before it was accepted or rejected so we should leave it to idle
11573
+ };
11574
+ this.handleRingingCall = () => {
11575
+ const callSession = this.state.session;
11576
+ const receiver_id = this.clientStore.connectedUser?.id;
11577
+ const ended_at = callSession?.ended_at;
11578
+ const created_by_id = this.state.createdBy?.id;
11579
+ const rejected_by = callSession?.rejected_by;
11580
+ const accepted_by = callSession?.accepted_by;
11581
+ let leaveCallIdle = false;
11582
+ if (ended_at) {
11583
+ // call was ended before it was accepted or rejected so we should leave it to idle
11584
+ leaveCallIdle = true;
11585
+ }
11586
+ else if (created_by_id && rejected_by) {
11587
+ if (rejected_by[created_by_id]) {
11588
+ // call was cancelled by the caller
11576
11589
  leaveCallIdle = true;
11577
11590
  }
11578
- else if (created_by_id && rejected_by) {
11579
- if (rejected_by[created_by_id]) {
11580
- // call was cancelled by the caller
11581
- leaveCallIdle = true;
11582
- }
11583
- }
11584
- else if (receiver_id && rejected_by) {
11585
- if (rejected_by[receiver_id]) {
11586
- // call was rejected by the receiver in some other device
11587
- leaveCallIdle = true;
11588
- }
11591
+ }
11592
+ else if (receiver_id && rejected_by) {
11593
+ if (rejected_by[receiver_id]) {
11594
+ // call was rejected by the receiver in some other device
11595
+ leaveCallIdle = true;
11589
11596
  }
11590
- else if (receiver_id && accepted_by) {
11591
- if (accepted_by[receiver_id]) {
11592
- // call was accepted by the receiver in some other device
11593
- leaveCallIdle = true;
11594
- }
11597
+ }
11598
+ else if (receiver_id && accepted_by) {
11599
+ if (accepted_by[receiver_id]) {
11600
+ // call was accepted by the receiver in some other device
11601
+ leaveCallIdle = true;
11595
11602
  }
11596
- if (leaveCallIdle) {
11597
- if (this.state.callingState !== CallingState.IDLE) {
11598
- this.state.setCallingState(CallingState.IDLE);
11599
- }
11603
+ }
11604
+ if (leaveCallIdle) {
11605
+ if (this.state.callingState !== CallingState.IDLE) {
11606
+ this.state.setCallingState(CallingState.IDLE);
11600
11607
  }
11601
- else {
11602
- if (this.state.callingState === CallingState.IDLE) {
11603
- this.state.setCallingState(CallingState.RINGING);
11604
- }
11605
- this.scheduleAutoDrop();
11606
- this.leaveCallHooks.add(registerRingingCallEventHandlers(this));
11608
+ }
11609
+ else {
11610
+ if (this.state.callingState === CallingState.IDLE) {
11611
+ this.state.setCallingState(CallingState.RINGING);
11607
11612
  }
11608
- }));
11613
+ this.scheduleAutoDrop();
11614
+ this.leaveCallHooks.add(registerRingingCallEventHandlers(this));
11615
+ }
11609
11616
  };
11610
11617
  this.handleOwnCapabilitiesUpdated = async (ownCapabilities) => {
11611
11618
  // update the permission context.
@@ -14562,7 +14569,7 @@ class StreamClient {
14562
14569
  this.getUserAgent = () => {
14563
14570
  if (!this.cachedUserAgent) {
14564
14571
  const { clientAppIdentifier = {} } = this.options;
14565
- const { sdkName = 'js', sdkVersion = "1.28.0", ...extras } = clientAppIdentifier;
14572
+ const { sdkName = 'js', sdkVersion = "1.28.1", ...extras } = clientAppIdentifier;
14566
14573
  this.cachedUserAgent = [
14567
14574
  `stream-video-${sdkName}-v${sdkVersion}`,
14568
14575
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),