@stream-io/video-client 0.0.25 → 0.0.27

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.
@@ -1583,17 +1583,23 @@ export interface CallUserMuted {
1583
1583
  */
1584
1584
  created_at: string;
1585
1585
  /**
1586
- * The type of event: "call.user_muted" in this case
1586
+ *
1587
1587
  * @type {string}
1588
1588
  * @memberof CallUserMuted
1589
1589
  */
1590
- type: string;
1590
+ from_user_id: string;
1591
1591
  /**
1592
1592
  *
1593
1593
  * @type {Array<string>}
1594
1594
  * @memberof CallUserMuted
1595
1595
  */
1596
- user_ids: Array<string>;
1596
+ muted_user_ids: Array<string>;
1597
+ /**
1598
+ * The type of event: "call.user_muted" in this case
1599
+ * @type {string}
1600
+ * @memberof CallUserMuted
1601
+ */
1602
+ type: string;
1597
1603
  }
1598
1604
  /**
1599
1605
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/Call.ts CHANGED
@@ -298,6 +298,7 @@ export class Call {
298
298
  currentUserId &&
299
299
  metadata.blocked_user_ids.includes(currentUserId)
300
300
  ) {
301
+ this.logger('info', 'Leaving call bacause of being blocked');
301
302
  await this.leave();
302
303
  }
303
304
  }),
@@ -580,6 +581,10 @@ export class Call {
580
581
  this.state.callingState,
581
582
  )
582
583
  ) {
584
+ this.logger(
585
+ 'warn',
586
+ 'Join method called twice, you should only call this once',
587
+ );
583
588
  throw new Error(`Illegal State: Already joined.`);
584
589
  }
585
590
 
@@ -591,6 +596,7 @@ export class Call {
591
596
 
592
597
  const previousCallingState = this.state.callingState;
593
598
  this.state.setCallingState(CallingState.JOINING);
599
+ this.logger('debug', 'Starting join flow');
594
600
 
595
601
  if (data?.ring && !this.ringing) {
596
602
  this.ringingSubject.next(true);
@@ -878,6 +884,7 @@ export class Call {
878
884
  // otherwise we risk breaking the ICETrickle flow.
879
885
  await this.assertCallJoined();
880
886
  if (!this.publisher) {
887
+ this.logger('error', 'Trying to publish video before join is completed');
881
888
  throw new Error(`Call not joined yet.`);
882
889
  }
883
890
 
@@ -910,6 +917,7 @@ export class Call {
910
917
  // otherwise we risk breaking the ICETrickle flow.
911
918
  await this.assertCallJoined();
912
919
  if (!this.publisher) {
920
+ this.logger('error', 'Trying to publish audio before join is completed');
913
921
  throw new Error(`Call not joined yet.`);
914
922
  }
915
923
 
@@ -940,6 +948,10 @@ export class Call {
940
948
  // otherwise we risk breaking the ICETrickle flow.
941
949
  await this.assertCallJoined();
942
950
  if (!this.publisher) {
951
+ this.logger(
952
+ 'error',
953
+ 'Trying to publish screen share before join is completed',
954
+ );
943
955
  throw new Error(`Call not joined yet.`);
944
956
  }
945
957
 
@@ -170,6 +170,12 @@ export class StreamVideoClient {
170
170
  .filter((call) => call.watching)
171
171
  .map((call) => call.cid);
172
172
 
173
+ this.logger(
174
+ 'info',
175
+ `Rewatching calls after connection changed ${callsToReWatch.join(
176
+ ', ',
177
+ )}`,
178
+ );
173
179
  if (callsToReWatch.length > 0) {
174
180
  this.queryCalls({
175
181
  watch: true,
@@ -197,6 +203,7 @@ export class StreamVideoClient {
197
203
  return;
198
204
  }
199
205
 
206
+ this.logger('info', `New call created and registered: ${call.cid}`);
200
207
  this.writeableStateStore.registerCall(
201
208
  new Call({
202
209
  streamClient: this.streamClient,
@@ -434,7 +434,6 @@ export class StreamClient {
434
434
  if (!(key in this.listeners)) {
435
435
  this.listeners[key] = [];
436
436
  }
437
- this.logger('info', `Attaching listener for ${key} event`);
438
437
  this.listeners[key].push(callback);
439
438
 
440
439
  return () => {
@@ -1570,17 +1570,23 @@ export interface CallUserMuted {
1570
1570
  */
1571
1571
  created_at: string;
1572
1572
  /**
1573
- * The type of event: "call.user_muted" in this case
1573
+ *
1574
1574
  * @type {string}
1575
1575
  * @memberof CallUserMuted
1576
1576
  */
1577
- type: string;
1577
+ from_user_id: string;
1578
1578
  /**
1579
1579
  *
1580
1580
  * @type {Array<string>}
1581
1581
  * @memberof CallUserMuted
1582
1582
  */
1583
- user_ids: Array<string>;
1583
+ muted_user_ids: Array<string>;
1584
+ /**
1585
+ * The type of event: "call.user_muted" in this case
1586
+ * @type {string}
1587
+ * @memberof CallUserMuted
1588
+ */
1589
+ type: string;
1584
1590
  }
1585
1591
  /**
1586
1592
  *
@@ -3,6 +3,7 @@ import type { Patch } from './rxUtils';
3
3
  import * as RxUtils from './rxUtils';
4
4
  import { Call } from '../Call';
5
5
  import type { OwnUserResponse } from '../coordinator/connection/types';
6
+ import { getLogger } from '../logger';
6
7
 
7
8
  export class StreamVideoWriteableStateStore {
8
9
  /**
@@ -22,6 +23,10 @@ export class StreamVideoWriteableStateStore {
22
23
  // leave all calls when the user disconnects.
23
24
  if (!user) {
24
25
  for (const call of this.calls) {
26
+ getLogger(['client-state'])(
27
+ 'info',
28
+ `User disconnected, leaving call: ${call.cid}`,
29
+ );
25
30
  await call.leave();
26
31
  }
27
32
  }