@stream-io/video-client 0.3.27 → 0.3.29

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/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.3.27";
1
+ export declare const version = "0.3.29";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "0.3.27",
3
+ "version": "0.3.29",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -330,8 +330,9 @@ export class CallState {
330
330
  constructor() {
331
331
  this.logger = getLogger(['CallState']);
332
332
  this.participants$ = this.participantsSubject.asObservable().pipe(
333
- // TODO: replace with Array.toSorted once available
334
- map((ps) => [...ps].sort(this.sortParticipantsBy)),
333
+ // maintain stable-sort by mutating the participants stored
334
+ // in the original subject
335
+ map((ps) => ps.sort(this.sortParticipantsBy)),
335
336
  shareReplay({ bufferSize: 1, refCount: true }),
336
337
  );
337
338
 
@@ -69,7 +69,7 @@ describe('CallState', () => {
69
69
 
70
70
  const ps2 = state.participants;
71
71
  // should resolve in initial - non-mutated state as set at the beginning
72
- expect(ps2.map((p) => p.name)).toEqual(['A', 'B', 'C', 'D', 'E', 'F']);
72
+ expect(ps2.map((p) => p.name)).toEqual(['F', 'B', 'E', 'A', 'C', 'D']);
73
73
  });
74
74
 
75
75
  it('should support custom sorting', () => {