vani-meeting-server 2.3.3 → 2.3.5

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);
@@ -53,6 +53,7 @@ class SFUHandler {
53
53
  }
54
54
  async checkIfCanCloseRoom(roomId) {
55
55
  const room = this.getRoomSFUHandler(roomId);
56
+ console.log("checkIfCanCloseRoom", room);
56
57
  if (room && room.roomPaticipants.size === 0) {
57
58
  await room.cleanUp();
58
59
  this.sfuRooms.delete(roomId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vani-meeting-server",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "Vani Meeting Server SDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",