vani-meeting-server 2.3.4 → 2.3.6

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.
@@ -48,6 +48,8 @@ export declare class SFUEachRoomHandler extends BaseSFUWebsocket implements SFUE
48
48
  private connectionProtocol;
49
49
  private eachRoomMutliserverHandler?;
50
50
  private redisSubscribtionDetails;
51
+ private isInitInProgress;
52
+ private messagesDuringInit;
51
53
  constructor(roomId: string, workers: Worker[], sendWorkerIndex: number, connectionProtocol?: ConnectionProtocol);
52
54
  onInit: () => Promise<void>;
53
55
  private sendVaniEvent;
@@ -51,6 +51,8 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
51
51
  connectionProtocol = ServerHandler_1.ServerHandler.getInstance().serverStartRequest.connectionProtocol;
52
52
  eachRoomMutliserverHandler;
53
53
  redisSubscribtionDetails = [];
54
+ isInitInProgress = true;
55
+ messagesDuringInit = [];
54
56
  constructor(roomId, workers, sendWorkerIndex, connectionProtocol) {
55
57
  super();
56
58
  this.roomId = roomId;
@@ -71,6 +73,11 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
71
73
  if (this.sendRouter) {
72
74
  this.eachRoomMutliserverHandler = new SFUEachRoomMutliServerHandler_1.SFUEachRoomMutliServerHandler(this.roomId, this.sendRouter, this);
73
75
  }
76
+ this.isInitInProgress = false;
77
+ for (const eachMessage of this.messagesDuringInit) {
78
+ this.onNewMessage(eachMessage.payload, eachMessage.participant);
79
+ }
80
+ this.messagesDuringInit = [];
74
81
  // setTimeout(() => {
75
82
  // this.informOtherSystems()
76
83
  // }, 10000)
@@ -114,6 +121,11 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
114
121
  this.onGetRTPCapabilities(participant);
115
122
  }
116
123
  else {
124
+ if (this.isInitInProgress === true) {
125
+ console.log("Init in Progess for RoomId:", this.roomId);
126
+ this.messagesDuringInit.push({ payload: payload, participant: participant });
127
+ return;
128
+ }
117
129
  const sfuEachRoomUser = this.getEachRoomUserFromParticipant(participant);
118
130
  if (sfuEachRoomUser) {
119
131
  this.getEachRoomUserFromParticipant(participant)?.onNewMessage(payload);
@@ -134,6 +146,7 @@ class SFUEachRoomHandler extends BaseSFUWebsocket_1.BaseSFUWebsocket {
134
146
  const indexForRecRouter = (this.roomPaticipants.size % this.recvRouter.length);
135
147
  const roomUser = new SFUEachRoomUserHandler_1.SFUEachRoomUserHandler(participant, this.sendRouter, this.recvRouter[indexForRecRouter], this);
136
148
  this.roomPaticipants.set(participant.userId, roomUser);
149
+ console.log("this.roomPaticipants", this.roomPaticipants);
137
150
  return roomUser;
138
151
  }
139
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-server",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "description": "Vani Meeting Server SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",