@webex/plugin-meetings 3.12.0-next.23 → 3.12.0-next.25

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.
@@ -274,6 +274,21 @@ MeetingsUtil.getThisDevice = function (newLocus, deviceUrl) {
274
274
  return null;
275
275
  };
276
276
 
277
+ /**
278
+ * Checks if the self state in a locus indicates a breakout move or breakout end.
279
+ * Returns true when:
280
+ * - self state is LEFT with reason MOVED (regular breakout move), OR
281
+ * - fullState is INACTIVE with endMeetingReason BREAKOUT_ENDED (breakout session ended)
282
+ * @param {Object} locus locus data
283
+ * @returns {boolean}
284
+ */
285
+ MeetingsUtil.isSelfMovedOrBreakoutEnded = function (locus) {
286
+ var _locus$self, _locus$self2, _locus$fullState, _locus$fullState2;
287
+ var isSelfLeftMoved = (locus === null || locus === void 0 ? void 0 : (_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.state) === _constants._LEFT_ && (locus === null || locus === void 0 ? void 0 : (_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.reason) === _constants._MOVED_;
288
+ var isBreakoutEnded = (locus === null || locus === void 0 ? void 0 : (_locus$fullState = locus.fullState) === null || _locus$fullState === void 0 ? void 0 : _locus$fullState.state) === _constants.LOCUS.STATE.INACTIVE && (locus === null || locus === void 0 ? void 0 : (_locus$fullState2 = locus.fullState) === null || _locus$fullState2 === void 0 ? void 0 : _locus$fullState2.endMeetingReason) === _constants._BREAKOUT_ENDED_;
289
+ return isSelfLeftMoved || isBreakoutEnded;
290
+ };
291
+
277
292
  /**
278
293
  * get self device joined status from locus data
279
294
  * @param {Object} meeting current meeting data
@@ -309,10 +324,10 @@ MeetingsUtil.isBreakoutLocusDTO = function (newLocus) {
309
324
  * @private
310
325
  */
311
326
  MeetingsUtil.isValidBreakoutLocus = function (locus) {
312
- var _locus$fullState, _locus$self;
313
- var inActiveStatus = (locus === null || locus === void 0 ? void 0 : (_locus$fullState = locus.fullState) === null || _locus$fullState === void 0 ? void 0 : _locus$fullState.state) === _constants.LOCUS.STATE.INACTIVE;
327
+ var _locus$fullState3, _locus$self3;
328
+ var inActiveStatus = (locus === null || locus === void 0 ? void 0 : (_locus$fullState3 = locus.fullState) === null || _locus$fullState3 === void 0 ? void 0 : _locus$fullState3.state) === _constants.LOCUS.STATE.INACTIVE;
314
329
  var isLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(locus);
315
- var selfJoined = ((_locus$self = locus.self) === null || _locus$self === void 0 ? void 0 : _locus$self.state) === _constants._JOINED_;
330
+ var selfJoined = ((_locus$self3 = locus.self) === null || _locus$self3 === void 0 ? void 0 : _locus$self3.state) === _constants._JOINED_;
316
331
  return isLocusAsBreakout && !inActiveStatus && selfJoined;
317
332
  };
318
333
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_triggerProxy","_constants2","_metrics","_meetings","MeetingsUtil","getMeetingAddedType","type","DESTINATION_TYPE","LOCUS_ID","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","MEETING_KEY","CORRELATION_ID","correlationId","_data$message","message","seq","messageType","tieBreaker","errorType","errorCause","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ROAP_MERCURY_EVENT_RECEIVED","correlation_id","message_type","error_type","error_cause","ROAP","ROAP_TYPES","TURN_DISCOVERY_RESPONSE","roap","turnDiscovery","handleTurnDiscoveryResponse","_data$message$sdps","roapMessage","sdp","sdps","length","undefined","roapMessageReceived","getMediaServer","mediaServer","split","find","line","startsWith","shift","replace","toLowerCase","_unused","getMediaServerIp","mediaServerIp","_sdp$split$find$match","match","trim","_unused2","getCorrelationIdForDevice","deviceUrl","locusSelf","devices","foundDevice","device","url","parseDefaultSiteFromMeetingPreferences","userPreferences","_userPreferences$site","result","sites","defaultSite","site","default","siteUrl","hasH264Codec","_asyncToGenerator2","_regenerator","mark","_callee","hasCodec","pc","offer","_t","wrap","_context","prev","next","window","RTCPeerConnection","createOffer","offerToReceiveVideo","sent","close","LoggerProxy","logger","warn","abrupt","stop","checkH264Support","_checkH264Support","_callee2","options","_this","_ref2","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","shouldStopChecking","_context2","_now","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call","_x","apply","arguments","getThisDevice","newLocus","_newLocus$self","_newLocus$self$device","self","joinedOnThisDevice","thisDevice","state","_JOINED_","_LEFT_","reason","_MOVED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","locus","_locus$fullState","_locus$self","inActiveStatus","fullState","LOCUS","STATE","INACTIVE","isLocusAsBreakout","selfJoined","isMainAssociatedWithBreakout","mainLocus","breakoutLocus","_mainLocus$controls","_mainLocus$controls$b","_mainLocus$controls2","_mainLocus$controls2$","_breakoutLocus$contro","_breakoutLocus$contro2","_breakoutLocus$self","_MeetingsUtil$getThis","_MeetingsUtil$getThis2","replaceInfo","replaces","locusUrl","_default","exports"],"sources":["util.ts"],"sourcesContent":["/* globals window */\n\nimport {\n _CREATED_,\n _INCOMING_,\n _JOINED_,\n _LEFT_,\n DESTINATION_TYPE,\n _MOVED_,\n BREAKOUTS,\n EVENT_TRIGGERS,\n LOCUS,\n LOCUSEVENT,\n ROAP,\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport Metrics from '../metrics';\nimport {MEETING_KEY} from './meetings.types';\n\n/**\n * Meetings Media Codec Missing Event\n * Emitted when H.264 codec is not\n * found in the browser.\n * @event media:codec:missing\n * @instance\n * @memberof MeetingsUtil\n */\n\n/**\n * Meetings Media Codec Loaded Event\n * Emitted when H.264 codec has been\n * loaded in the browser.\n * @event media:codec:loaded\n * @instance\n * @memberof MeetingsUtil\n */\n\nconst MeetingsUtil: any = {};\n\nMeetingsUtil.getMeetingAddedType = (type: DESTINATION_TYPE) =>\n type === DESTINATION_TYPE.LOCUS_ID ? _INCOMING_ : _CREATED_;\n\nMeetingsUtil.handleRoapMercury = (envelope, meetingCollection) => {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType === LOCUSEVENT.MESSAGE_ROAP) {\n const meeting = meetingCollection.getByKey(MEETING_KEY.CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n const {seq, messageType, tieBreaker, errorType, errorCause} = data.message;\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED, {\n correlation_id: data.correlationId,\n seq,\n message_type: messageType,\n error_type: errorType,\n error_cause: errorCause,\n });\n\n if (messageType === ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {\n // turn discovery is not part of normal roap protocol and so we are not handling it\n // through the usual roap state machine\n meeting.roap.turnDiscovery.handleTurnDiscoveryResponse(data.message, 'from mercury');\n } else {\n const roapMessage = {\n seq,\n messageType,\n sdp: data.message.sdps?.length > 0 ? data.message.sdps[0] : undefined,\n tieBreaker,\n errorType,\n errorCause,\n };\n\n meeting.roapMessageReceived(roapMessage);\n }\n }\n }\n};\n\nMeetingsUtil.getMediaServer = (sdp) => {\n let mediaServer;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServer = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .split(' ')\n .shift()\n .replace('o=', '')\n .toLowerCase();\n } catch {\n mediaServer = undefined;\n }\n\n return mediaServer;\n};\n\nMeetingsUtil.getMediaServerIp = (sdp) => {\n let mediaServerIp;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServerIp = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .match(/o=\\S+ \\d+ \\d+ IN IP4 ([\\d.]+)/)?.[1]\n .toLowerCase()\n .trim();\n } catch {\n mediaServerIp = undefined;\n }\n\n return mediaServerIp;\n};\n\n/**\n * Finds correlationId of a device from locus self devices array\n * that matches the given deviceUrl\n * @param {string} deviceUrl\n * @param {object} locusSelf\n * @returns {string|false} correlationId or false if not found\n */\nMeetingsUtil.getCorrelationIdForDevice = (deviceUrl: string, locusSelf: any) => {\n if (locusSelf?.devices) {\n const foundDevice = locusSelf?.devices.find((device) => device.url === deviceUrl);\n\n if (foundDevice && foundDevice.correlationId) {\n return foundDevice.correlationId;\n }\n }\n\n return false;\n};\n\nMeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {\n let result = '';\n\n if (userPreferences?.sites?.length) {\n const defaultSite = userPreferences.sites.find((site) => site.default);\n\n if (defaultSite) {\n result = defaultSite.siteUrl;\n } else {\n result = userPreferences.sites[0].siteUrl;\n }\n }\n\n return result;\n};\n\n/**\n * Will check to see if the H.264 media codec is supported.\n * @async\n * @private\n * @returns {Promise<boolean>}\n */\nMeetingsUtil.hasH264Codec = async () => {\n let hasCodec = false;\n\n try {\n const pc = new window.RTCPeerConnection();\n const offer = await pc.createOffer({offerToReceiveVideo: true});\n\n if (offer.sdp.match(/^a=rtpmap:\\d+\\s+H264\\/\\d+/m)) {\n hasCodec = true;\n }\n pc.close();\n } catch (error) {\n LoggerProxy.logger.warn(\n 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'\n );\n }\n\n return hasCodec;\n};\n\n/**\n * Notifies the user whether or not the H.264\n * codec is present. Will continuously check\n * until max duration.\n * @async\n * @private\n * @param {object} options\n * @param {Number} options.firstChecked Timestamp in milliseconds\n * @param {boolean} options.disableNotifications Default is false. Boolean to enable/disable notification and events\n * @returns {undefined}\n */\nMeetingsUtil.checkH264Support = async function checkH264Support(options: {\n firstChecked: number;\n disableNotifications: boolean;\n}) {\n const {hasH264Codec} = MeetingsUtil;\n const {firstChecked, disableNotifications} = options || {};\n const delay = 5e3; // ms\n const maxDuration = 3e5; // ms\n const shouldTrigger = firstChecked === undefined;\n const shouldStopChecking = firstChecked && Date.now() - firstChecked >= maxDuration;\n\n // Disable notifications and start H.264 download only\n if (disableNotifications) {\n hasH264Codec();\n\n return;\n }\n\n // Codec loaded trigger event notification\n if (await hasH264Codec()) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_LOADED\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec loaded successfully.');\n\n return;\n }\n\n // Stop checking if past the timelimit\n if (shouldStopChecking) {\n LoggerProxy.logger.error(\n 'Meetings:util#checkH264Support --> Timed out waiting for H264 codec to load.'\n );\n\n return;\n }\n\n // Trigger only once\n if (shouldTrigger) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_MISSING\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec is missing.');\n }\n\n // Keep checking in intervals to see if codec loaded\n window.setTimeout(() => {\n const timestamp = firstChecked || Date.now();\n\n MeetingsUtil.checkH264Support.call(this, {firstChecked: timestamp});\n }, delay);\n};\n\n/**\n * get device from locus data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.getThisDevice = (newLocus: any, deviceUrl: string) => {\n if (newLocus?.self?.devices?.length > 0) {\n return newLocus.self.devices.find((device) => device.url === deviceUrl);\n }\n\n return null;\n};\n\n/**\n * get self device joined status from locus data\n * @param {Object} meeting current meeting data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any, deviceUrl: string) => {\n const thisDevice = MeetingsUtil.getThisDevice(newLocus, deviceUrl);\n if (thisDevice) {\n if (!thisDevice.correlationId || meeting?.correlationId === thisDevice.correlationId) {\n return (\n thisDevice.state === _JOINED_ ||\n (thisDevice.state === _LEFT_ && thisDevice.reason === _MOVED_)\n );\n }\n }\n\n return false;\n};\n\n/**\n * check the new locus is breakout session's one or not\n * @param {Object} newLocus new locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isBreakoutLocusDTO = (newLocus: any) => {\n return (\n newLocus?.controls?.breakout?.sessionType === BREAKOUTS.SESSION_TYPES.BREAKOUT ||\n !!newLocus?.info?.isBreakout\n );\n};\n\n/**\n * check the locus is valid breakout locus or not\n * @param {Object} locus\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isValidBreakoutLocus = (locus: any) => {\n const inActiveStatus = locus?.fullState?.state === LOCUS.STATE.INACTIVE;\n const isLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(locus);\n const selfJoined = locus.self?.state === _JOINED_;\n\n return isLocusAsBreakout && !inActiveStatus && selfJoined;\n};\n/**\n * check if the breakout locus is associated with the main locus by comparing the breakout control url or the replaces info in self device\n * @param {Object} mainLocus main locus data\n * @param {Object} breakoutLocus breakout locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isMainAssociatedWithBreakout = (mainLocus: any, breakoutLocus: any) => {\n if (\n mainLocus.controls?.breakout?.url &&\n mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url\n ) {\n return true;\n }\n const deviceUrl = breakoutLocus?.self?.deviceUrl;\n const replaceInfo = MeetingsUtil.getThisDevice(breakoutLocus, deviceUrl)?.replaces?.[0];\n if (replaceInfo?.locusUrl && replaceInfo.locusUrl === mainLocus.url) {\n return true;\n }\n\n return false;\n};\nexport default MeetingsUtil;\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAaA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AAC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,aAAa,wBAAAO,mBAAA,GAAbP,aAAa,CAAEjC,IAAI,cAAAwC,mBAAA,uBAAnBA,mBAAA,CAAqBhH,SAAS;EAChD,IAAMmH,WAAW,IAAAF,qBAAA,GAAGjL,YAAY,CAACoI,aAAa,CAACqC,aAAa,EAAEzG,SAAS,CAAC,cAAAiH,qBAAA,wBAAAC,sBAAA,GAApDD,qBAAA,CAAsDG,QAAQ,cAAAF,sBAAA,uBAA9DA,sBAAA,CAAiE,CAAC,CAAC;EACvF,IAAIC,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEE,QAAQ,IAAIF,WAAW,CAACE,QAAQ,KAAKb,SAAS,CAACnG,GAAG,EAAE;IACnE,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,IAAAiH,QAAA,GAAAC,OAAA,CAAA1G,OAAA,GACa7E,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_triggerProxy","_constants2","_metrics","_meetings","MeetingsUtil","getMeetingAddedType","type","DESTINATION_TYPE","LOCUS_ID","_INCOMING_","_CREATED_","handleRoapMercury","envelope","meetingCollection","data","eventType","LOCUSEVENT","MESSAGE_ROAP","meeting","getByKey","MEETING_KEY","CORRELATION_ID","correlationId","_data$message","message","seq","messageType","tieBreaker","errorType","errorCause","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ROAP_MERCURY_EVENT_RECEIVED","correlation_id","message_type","error_type","error_cause","ROAP","ROAP_TYPES","TURN_DISCOVERY_RESPONSE","roap","turnDiscovery","handleTurnDiscoveryResponse","_data$message$sdps","roapMessage","sdp","sdps","length","undefined","roapMessageReceived","getMediaServer","mediaServer","split","find","line","startsWith","shift","replace","toLowerCase","_unused","getMediaServerIp","mediaServerIp","_sdp$split$find$match","match","trim","_unused2","getCorrelationIdForDevice","deviceUrl","locusSelf","devices","foundDevice","device","url","parseDefaultSiteFromMeetingPreferences","userPreferences","_userPreferences$site","result","sites","defaultSite","site","default","siteUrl","hasH264Codec","_asyncToGenerator2","_regenerator","mark","_callee","hasCodec","pc","offer","_t","wrap","_context","prev","next","window","RTCPeerConnection","createOffer","offerToReceiveVideo","sent","close","LoggerProxy","logger","warn","abrupt","stop","checkH264Support","_checkH264Support","_callee2","options","_this","_ref2","firstChecked","disableNotifications","delay","maxDuration","shouldTrigger","shouldStopChecking","_context2","_now","Trigger","trigger","file","function","EVENT_TRIGGERS","MEDIA_CODEC_LOADED","log","error","MEDIA_CODEC_MISSING","setTimeout","timestamp","call","_x","apply","arguments","getThisDevice","newLocus","_newLocus$self","_newLocus$self$device","self","isSelfMovedOrBreakoutEnded","locus","_locus$self","_locus$self2","_locus$fullState","_locus$fullState2","isSelfLeftMoved","state","_LEFT_","reason","_MOVED_","isBreakoutEnded","fullState","LOCUS","STATE","INACTIVE","endMeetingReason","_BREAKOUT_ENDED_","joinedOnThisDevice","thisDevice","_JOINED_","isBreakoutLocusDTO","_newLocus$controls","_newLocus$controls$br","_newLocus$info","controls","breakout","sessionType","BREAKOUTS","SESSION_TYPES","BREAKOUT","info","isBreakout","isValidBreakoutLocus","_locus$fullState3","_locus$self3","inActiveStatus","isLocusAsBreakout","selfJoined","isMainAssociatedWithBreakout","mainLocus","breakoutLocus","_mainLocus$controls","_mainLocus$controls$b","_mainLocus$controls2","_mainLocus$controls2$","_breakoutLocus$contro","_breakoutLocus$contro2","_breakoutLocus$self","_MeetingsUtil$getThis","_MeetingsUtil$getThis2","replaceInfo","replaces","locusUrl","_default","exports"],"sources":["util.ts"],"sourcesContent":["/* globals window */\n\nimport {\n _CREATED_,\n _INCOMING_,\n _JOINED_,\n _LEFT_,\n DESTINATION_TYPE,\n _MOVED_,\n _BREAKOUT_ENDED_,\n BREAKOUTS,\n EVENT_TRIGGERS,\n LOCUS,\n LOCUSEVENT,\n ROAP,\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport Metrics from '../metrics';\nimport {MEETING_KEY} from './meetings.types';\n\n/**\n * Meetings Media Codec Missing Event\n * Emitted when H.264 codec is not\n * found in the browser.\n * @event media:codec:missing\n * @instance\n * @memberof MeetingsUtil\n */\n\n/**\n * Meetings Media Codec Loaded Event\n * Emitted when H.264 codec has been\n * loaded in the browser.\n * @event media:codec:loaded\n * @instance\n * @memberof MeetingsUtil\n */\n\nconst MeetingsUtil: any = {};\n\nMeetingsUtil.getMeetingAddedType = (type: DESTINATION_TYPE) =>\n type === DESTINATION_TYPE.LOCUS_ID ? _INCOMING_ : _CREATED_;\n\nMeetingsUtil.handleRoapMercury = (envelope, meetingCollection) => {\n const {data} = envelope;\n const {eventType} = data;\n\n if (eventType === LOCUSEVENT.MESSAGE_ROAP) {\n const meeting = meetingCollection.getByKey(MEETING_KEY.CORRELATION_ID, data.correlationId);\n\n if (meeting) {\n const {seq, messageType, tieBreaker, errorType, errorCause} = data.message;\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.ROAP_MERCURY_EVENT_RECEIVED, {\n correlation_id: data.correlationId,\n seq,\n message_type: messageType,\n error_type: errorType,\n error_cause: errorCause,\n });\n\n if (messageType === ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {\n // turn discovery is not part of normal roap protocol and so we are not handling it\n // through the usual roap state machine\n meeting.roap.turnDiscovery.handleTurnDiscoveryResponse(data.message, 'from mercury');\n } else {\n const roapMessage = {\n seq,\n messageType,\n sdp: data.message.sdps?.length > 0 ? data.message.sdps[0] : undefined,\n tieBreaker,\n errorType,\n errorCause,\n };\n\n meeting.roapMessageReceived(roapMessage);\n }\n }\n }\n};\n\nMeetingsUtil.getMediaServer = (sdp) => {\n let mediaServer;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServer = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .split(' ')\n .shift()\n .replace('o=', '')\n .toLowerCase();\n } catch {\n mediaServer = undefined;\n }\n\n return mediaServer;\n};\n\nMeetingsUtil.getMediaServerIp = (sdp) => {\n let mediaServerIp;\n\n // Attempt to collect the media server from the roap message.\n try {\n mediaServerIp = sdp\n .split('\\r\\n')\n .find((line) => line.startsWith('o='))\n .match(/o=\\S+ \\d+ \\d+ IN IP4 ([\\d.]+)/)?.[1]\n .toLowerCase()\n .trim();\n } catch {\n mediaServerIp = undefined;\n }\n\n return mediaServerIp;\n};\n\n/**\n * Finds correlationId of a device from locus self devices array\n * that matches the given deviceUrl\n * @param {string} deviceUrl\n * @param {object} locusSelf\n * @returns {string|false} correlationId or false if not found\n */\nMeetingsUtil.getCorrelationIdForDevice = (deviceUrl: string, locusSelf: any) => {\n if (locusSelf?.devices) {\n const foundDevice = locusSelf?.devices.find((device) => device.url === deviceUrl);\n\n if (foundDevice && foundDevice.correlationId) {\n return foundDevice.correlationId;\n }\n }\n\n return false;\n};\n\nMeetingsUtil.parseDefaultSiteFromMeetingPreferences = (userPreferences) => {\n let result = '';\n\n if (userPreferences?.sites?.length) {\n const defaultSite = userPreferences.sites.find((site) => site.default);\n\n if (defaultSite) {\n result = defaultSite.siteUrl;\n } else {\n result = userPreferences.sites[0].siteUrl;\n }\n }\n\n return result;\n};\n\n/**\n * Will check to see if the H.264 media codec is supported.\n * @async\n * @private\n * @returns {Promise<boolean>}\n */\nMeetingsUtil.hasH264Codec = async () => {\n let hasCodec = false;\n\n try {\n const pc = new window.RTCPeerConnection();\n const offer = await pc.createOffer({offerToReceiveVideo: true});\n\n if (offer.sdp.match(/^a=rtpmap:\\d+\\s+H264\\/\\d+/m)) {\n hasCodec = true;\n }\n pc.close();\n } catch (error) {\n LoggerProxy.logger.warn(\n 'Meetings:util#hasH264Codec --> Error creating peerConnection for H.264 test.'\n );\n }\n\n return hasCodec;\n};\n\n/**\n * Notifies the user whether or not the H.264\n * codec is present. Will continuously check\n * until max duration.\n * @async\n * @private\n * @param {object} options\n * @param {Number} options.firstChecked Timestamp in milliseconds\n * @param {boolean} options.disableNotifications Default is false. Boolean to enable/disable notification and events\n * @returns {undefined}\n */\nMeetingsUtil.checkH264Support = async function checkH264Support(options: {\n firstChecked: number;\n disableNotifications: boolean;\n}) {\n const {hasH264Codec} = MeetingsUtil;\n const {firstChecked, disableNotifications} = options || {};\n const delay = 5e3; // ms\n const maxDuration = 3e5; // ms\n const shouldTrigger = firstChecked === undefined;\n const shouldStopChecking = firstChecked && Date.now() - firstChecked >= maxDuration;\n\n // Disable notifications and start H.264 download only\n if (disableNotifications) {\n hasH264Codec();\n\n return;\n }\n\n // Codec loaded trigger event notification\n if (await hasH264Codec()) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_LOADED\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec loaded successfully.');\n\n return;\n }\n\n // Stop checking if past the timelimit\n if (shouldStopChecking) {\n LoggerProxy.logger.error(\n 'Meetings:util#checkH264Support --> Timed out waiting for H264 codec to load.'\n );\n\n return;\n }\n\n // Trigger only once\n if (shouldTrigger) {\n Trigger.trigger(\n this,\n {\n file: 'meetings/util',\n function: 'checkH264Support',\n },\n EVENT_TRIGGERS.MEDIA_CODEC_MISSING\n );\n LoggerProxy.logger.log('Meetings:util#checkH264Support --> H264 codec is missing.');\n }\n\n // Keep checking in intervals to see if codec loaded\n window.setTimeout(() => {\n const timestamp = firstChecked || Date.now();\n\n MeetingsUtil.checkH264Support.call(this, {firstChecked: timestamp});\n }, delay);\n};\n\n/**\n * get device from locus data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.getThisDevice = (newLocus: any, deviceUrl: string) => {\n if (newLocus?.self?.devices?.length > 0) {\n return newLocus.self.devices.find((device) => device.url === deviceUrl);\n }\n\n return null;\n};\n\n/**\n * Checks if the self state in a locus indicates a breakout move or breakout end.\n * Returns true when:\n * - self state is LEFT with reason MOVED (regular breakout move), OR\n * - fullState is INACTIVE with endMeetingReason BREAKOUT_ENDED (breakout session ended)\n * @param {Object} locus locus data\n * @returns {boolean}\n */\nMeetingsUtil.isSelfMovedOrBreakoutEnded = (locus: any): boolean => {\n const isSelfLeftMoved = locus?.self?.state === _LEFT_ && locus?.self?.reason === _MOVED_;\n const isBreakoutEnded =\n locus?.fullState?.state === LOCUS.STATE.INACTIVE &&\n locus?.fullState?.endMeetingReason === _BREAKOUT_ENDED_;\n\n return isSelfLeftMoved || isBreakoutEnded;\n};\n\n/**\n * get self device joined status from locus data\n * @param {Object} meeting current meeting data\n * @param {Object} newLocus new locus data\n * @param {String} deviceUrl current device url\n * @returns {Object}\n */\nMeetingsUtil.joinedOnThisDevice = (meeting: any, newLocus: any, deviceUrl: string) => {\n const thisDevice = MeetingsUtil.getThisDevice(newLocus, deviceUrl);\n if (thisDevice) {\n if (!thisDevice.correlationId || meeting?.correlationId === thisDevice.correlationId) {\n return (\n thisDevice.state === _JOINED_ ||\n (thisDevice.state === _LEFT_ && thisDevice.reason === _MOVED_)\n );\n }\n }\n\n return false;\n};\n\n/**\n * check the new locus is breakout session's one or not\n * @param {Object} newLocus new locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isBreakoutLocusDTO = (newLocus: any) => {\n return (\n newLocus?.controls?.breakout?.sessionType === BREAKOUTS.SESSION_TYPES.BREAKOUT ||\n !!newLocus?.info?.isBreakout\n );\n};\n\n/**\n * check the locus is valid breakout locus or not\n * @param {Object} locus\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isValidBreakoutLocus = (locus: any) => {\n const inActiveStatus = locus?.fullState?.state === LOCUS.STATE.INACTIVE;\n const isLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(locus);\n const selfJoined = locus.self?.state === _JOINED_;\n\n return isLocusAsBreakout && !inActiveStatus && selfJoined;\n};\n/**\n * check if the breakout locus is associated with the main locus by comparing the breakout control url or the replaces info in self device\n * @param {Object} mainLocus main locus data\n * @param {Object} breakoutLocus breakout locus data\n * @returns {boolean}\n * @private\n */\nMeetingsUtil.isMainAssociatedWithBreakout = (mainLocus: any, breakoutLocus: any) => {\n if (\n mainLocus.controls?.breakout?.url &&\n mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url\n ) {\n return true;\n }\n const deviceUrl = breakoutLocus?.self?.deviceUrl;\n const replaceInfo = MeetingsUtil.getThisDevice(breakoutLocus, deviceUrl)?.replaces?.[0];\n if (replaceInfo?.locusUrl && replaceInfo.locusUrl === mainLocus.url) {\n return true;\n }\n\n return false;\n};\nexport default MeetingsUtil;\n"],"mappings":";;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAcA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,QAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AApBA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMO,YAAiB,GAAG,CAAC,CAAC;AAE5BA,YAAY,CAACC,mBAAmB,GAAG,UAACC,IAAsB;EAAA,OACxDA,IAAI,KAAKC,2BAAgB,CAACC,QAAQ,GAAGC,qBAAU,GAAGC,oBAAS;AAAA;AAE7DN,YAAY,CAACO,iBAAiB,GAAG,UAACC,QAAQ,EAAEC,iBAAiB,EAAK;EAChE,IAAOC,IAAI,GAAIF,QAAQ,CAAhBE,IAAI;EACX,IAAOC,SAAS,GAAID,IAAI,CAAjBC,SAAS;EAEhB,IAAIA,SAAS,KAAKC,qBAAU,CAACC,YAAY,EAAE;IACzC,IAAMC,OAAO,GAAGL,iBAAiB,CAACM,QAAQ,CAACC,qBAAW,CAACC,cAAc,EAAEP,IAAI,CAACQ,aAAa,CAAC;IAE1F,IAAIJ,OAAO,EAAE;MACX,IAAAK,a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AAAC,sBAAA,GAAtBD,qBAAA,CAAwBpB,QAAQ,cAAAqB,sBAAA,uBAAhCA,sBAAA,CAAkCnH,GAAG,GAC3E;IACA,OAAO,IAAI;EACb;EACA,IAAML,SAAS,GAAGkH,aAAa,aAAbA,aAAa,wBAAAO,mBAAA,GAAbP,aAAa,CAAE1C,IAAI,cAAAiD,mBAAA,uBAAnBA,mBAAA,CAAqBzH,SAAS;EAChD,IAAM4H,WAAW,IAAAF,qBAAA,GAAG1L,YAAY,CAACoI,aAAa,CAAC8C,aAAa,EAAElH,SAAS,CAAC,cAAA0H,qBAAA,wBAAAC,sBAAA,GAApDD,qBAAA,CAAsDG,QAAQ,cAAAF,sBAAA,uBAA9DA,sBAAA,CAAiE,CAAC,CAAC;EACvF,IAAIC,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEE,QAAQ,IAAIF,WAAW,CAACE,QAAQ,KAAKb,SAAS,CAAC5G,GAAG,EAAE;IACnE,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd,CAAC;AAAC,IAAA0H,QAAA,GAAAC,OAAA,CAAAnH,OAAA,GACa7E,YAAY","ignoreList":[]}
@@ -73,6 +73,7 @@ export declare const _JOINED_ = "JOINED";
73
73
  export declare const _LOCUS_ID_ = "LOCUS_ID";
74
74
  export declare const _LEFT_ = "LEFT";
75
75
  export declare const _MOVED_ = "MOVED";
76
+ export declare const _BREAKOUT_ENDED_ = "BREAKOUT_ENDED";
76
77
  export declare const _ON_HOLD_LOBBY_ = "ON_HOLD_LOBBY";
77
78
  export declare const _MEETING_LINK_ = "MEETING_LINK";
78
79
  export declare const _MEETING_UUID_ = "MEETING_UUID";
@@ -388,7 +388,7 @@ declare class HashTreeParser {
388
388
  * Sends a sync request to Locus for the specified data set.
389
389
  *
390
390
  * @param {InternalDataSet} dataSet The data set to sync.
391
- * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
391
+ * @param {Object} options Either `{ isInitialization: true }` for init syncs (uses leafCount=1 with empty leaf data) or `{ mismatchedLeavesData }` for normal syncs.
392
392
  * @returns {Promise<HashTreeMessage|null>}
393
393
  */
394
394
  private sendSyncRequestToLocus;
@@ -723,7 +723,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
723
723
  }, _callee1);
724
724
  }))();
725
725
  },
726
- version: "3.12.0-next.23"
726
+ version: "3.12.0-next.25"
727
727
  });
728
728
  var _default = exports.default = Webinar;
729
729
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -94,5 +94,5 @@
94
94
  "//": [
95
95
  "TODO: upgrade jwt-decode when moving to node 18"
96
96
  ],
97
- "version": "3.12.0-next.23"
97
+ "version": "3.12.0-next.25"
98
98
  }
package/src/constants.ts CHANGED
@@ -103,6 +103,7 @@ export const _JOINED_ = 'JOINED';
103
103
  export const _LOCUS_ID_ = 'LOCUS_ID';
104
104
  export const _LEFT_ = 'LEFT';
105
105
  export const _MOVED_ = 'MOVED';
106
+ export const _BREAKOUT_ENDED_ = 'BREAKOUT_ENDED';
106
107
  export const _ON_HOLD_LOBBY_ = 'ON_HOLD_LOBBY';
107
108
  export const _MEETING_LINK_ = 'MEETING_LINK';
108
109
  export const _MEETING_UUID_ = 'MEETING_UUID';
@@ -1196,60 +1196,61 @@ class HashTreeParser {
1196
1196
  `HashTreeParser#performSync --> ${this.debugId} ${reason}, syncing data set "${dataSet.name}"`
1197
1197
  );
1198
1198
 
1199
- let leavesData: Record<number, LeafDataItem[]>;
1199
+ let leavesData: Record<number, LeafDataItem[]> = {};
1200
1200
 
1201
- if (isInitialization) {
1202
- // initialization sync: send all leaves as empty to get all data from Locus
1203
- leavesData = {};
1204
- for (let i = 0; i < dataSet.leafCount; i += 1) {
1205
- leavesData[i] = [];
1206
- }
1207
- } else if (dataSet.leafCount !== 1) {
1208
- leavesData = {};
1209
- let receivedHashes;
1201
+ if (!isInitialization) {
1202
+ if (dataSet.leafCount !== 1) {
1203
+ let receivedHashes;
1210
1204
 
1211
- try {
1212
- // request hashes from sender
1213
- const hashesResult = await this.getHashesFromLocus(dataSet.name, rootHash);
1205
+ try {
1206
+ // request hashes from sender
1207
+ const hashesResult = await this.getHashesFromLocus(dataSet.name, rootHash);
1214
1208
 
1215
- if (!hashesResult) {
1216
- // hashes match, no sync needed
1217
- return;
1218
- }
1209
+ if (!hashesResult) {
1210
+ // hashes match, no sync needed
1211
+ return;
1212
+ }
1219
1213
 
1220
- receivedHashes = hashesResult.hashes;
1214
+ receivedHashes = hashesResult.hashes;
1221
1215
 
1222
- hashTree.resize(hashesResult.dataSet.leafCount);
1223
- } catch (error: any) {
1224
- if (error?.statusCode === 409) {
1225
- // this is a leaf count mismatch, we should do nothing, just wait for another heartbeat message from Locus
1226
- LoggerProxy.logger.info(
1227
- `HashTreeParser#getHashesFromLocus --> ${this.debugId} Got 409 when fetching hashes for data set "${dataSet.name}": ${error.message}`
1228
- );
1216
+ hashTree.resize(hashesResult.dataSet.leafCount);
1217
+ } catch (error: any) {
1218
+ if (error?.statusCode === 409) {
1219
+ // this is a leaf count mismatch, we should do nothing, just wait for another heartbeat message from Locus
1220
+ LoggerProxy.logger.info(
1221
+ `HashTreeParser#getHashesFromLocus --> ${this.debugId} Got 409 when fetching hashes for data set "${dataSet.name}": ${error.message}`
1222
+ );
1229
1223
 
1230
- return;
1224
+ return;
1225
+ }
1226
+ throw error;
1231
1227
  }
1232
- throw error;
1233
- }
1234
1228
 
1235
- // identify mismatched leaves
1236
- const mismatchedLeaveIndexes = hashTree.diffHashes(receivedHashes);
1229
+ // identify mismatched leaves
1230
+ const mismatchedLeaveIndexes = hashTree.diffHashes(receivedHashes);
1237
1231
 
1238
- mismatchedLeaveIndexes.forEach((index) => {
1239
- leavesData[index] = hashTree.getLeafData(index);
1240
- });
1241
- } else {
1242
- leavesData = {0: hashTree.getLeafData(0)};
1232
+ mismatchedLeaveIndexes.forEach((index) => {
1233
+ leavesData[index] = hashTree.getLeafData(index);
1234
+ });
1235
+ } else {
1236
+ leavesData = {0: hashTree.getLeafData(0)};
1237
+ }
1243
1238
  }
1244
1239
  // request sync for mismatched leaves
1245
- if (Object.keys(leavesData).length > 0) {
1246
- const syncResponse = await this.sendSyncRequestToLocus(dataSet, leavesData);
1240
+ let syncResponse: HashTreeMessage | null = null;
1247
1241
 
1248
- // sync API may return nothing (in that case data will arrive via messages)
1249
- // or it may return a response in the same format as messages
1250
- if (syncResponse) {
1251
- this.handleMessage(syncResponse, 'via sync API');
1252
- }
1242
+ if (isInitialization) {
1243
+ syncResponse = await this.sendSyncRequestToLocus(dataSet, {isInitialization: true});
1244
+ } else if (Object.keys(leavesData).length > 0) {
1245
+ syncResponse = await this.sendSyncRequestToLocus(dataSet, {
1246
+ mismatchedLeavesData: leavesData,
1247
+ });
1248
+ }
1249
+
1250
+ // sync API may return nothing (in that case data will arrive via messages)
1251
+ // or it may return a response in the same format as messages
1252
+ if (syncResponse) {
1253
+ this.handleMessage(syncResponse, 'via sync API');
1253
1254
  }
1254
1255
  } catch (error) {
1255
1256
  if (error instanceof MeetingEndedError) {
@@ -1676,34 +1677,43 @@ class HashTreeParser {
1676
1677
  * Sends a sync request to Locus for the specified data set.
1677
1678
  *
1678
1679
  * @param {InternalDataSet} dataSet The data set to sync.
1679
- * @param {Record<number, LeafDataItem[]>} mismatchedLeavesData The mismatched leaves data to include in the sync request.
1680
+ * @param {Object} options Either `{ isInitialization: true }` for init syncs (uses leafCount=1 with empty leaf data) or `{ mismatchedLeavesData }` for normal syncs.
1680
1681
  * @returns {Promise<HashTreeMessage|null>}
1681
1682
  */
1682
1683
  private sendSyncRequestToLocus(
1683
1684
  dataSet: InternalDataSet,
1684
- mismatchedLeavesData: Record<number, LeafDataItem[]>
1685
+ options: {isInitialization: true} | {mismatchedLeavesData: Record<number, LeafDataItem[]>}
1685
1686
  ): Promise<HashTreeMessage | null> {
1686
1687
  LoggerProxy.logger.info(
1687
1688
  `HashTreeParser#sendSyncRequestToLocus --> ${this.debugId} Sending sync request for data set "${dataSet.name}"`
1688
1689
  );
1689
1690
 
1691
+ const isInitialization = 'isInitialization' in options;
1692
+
1690
1693
  const url = `${dataSet.url}/sync`;
1691
1694
  const body: {
1692
1695
  leafCount: number;
1693
1696
  leafDataEntries: {leafIndex: number; elementIds: LeafDataItem[]}[];
1694
1697
  } = {
1695
- leafCount: dataSet.leafCount,
1698
+ leafCount: isInitialization ? 1 : dataSet.leafCount,
1696
1699
  leafDataEntries: [],
1697
1700
  };
1698
1701
 
1699
- Object.keys(mismatchedLeavesData).forEach((index) => {
1700
- const leafIndex = parseInt(index, 10);
1702
+ if (isInitialization) {
1703
+ // initialization sync: Locus requires leafCount=1 with a single empty leaf
1704
+ body.leafDataEntries.push({leafIndex: 0, elementIds: []});
1705
+ } else {
1706
+ const {mismatchedLeavesData} = options;
1707
+
1708
+ Object.keys(mismatchedLeavesData).forEach((index) => {
1709
+ const leafIndex = parseInt(index, 10);
1701
1710
 
1702
- body.leafDataEntries.push({
1703
- leafIndex,
1704
- elementIds: mismatchedLeavesData[leafIndex],
1711
+ body.leafDataEntries.push({
1712
+ leafIndex,
1713
+ elementIds: mismatchedLeavesData[leafIndex],
1714
+ });
1705
1715
  });
1706
- });
1716
+ }
1707
1717
 
1708
1718
  const ourCurrentRootHash = dataSet.hashTree ? dataSet.hashTree.getRootHash() : EMPTY_HASH;
1709
1719
 
@@ -1635,7 +1635,7 @@ export default class LocusInfo extends EventsScope {
1635
1635
  * @memberof LocusInfo
1636
1636
  */
1637
1637
  updateLocusInfo(locus) {
1638
- if (locus.self?.reason === 'MOVED' && locus.self?.state === 'LEFT') {
1638
+ if (MeetingsUtil.isSelfMovedOrBreakoutEnded(locus)) {
1639
1639
  // When moved to a breakout session locus sends a message for the previous locus
1640
1640
  // indicating that we have been moved. It isn't helpful to continue parsing this
1641
1641
  // as it gets interpreted as if we have left the call
@@ -315,7 +315,7 @@ export default class Meetings extends WebexPlugin {
315
315
  const breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
316
316
 
317
317
  const isSelfJoined = newLocus?.self?.state === _JOINED_;
318
- const isSelfMoved = newLocus?.self?.state === _LEFT_ && newLocus?.self?.reason === _MOVED_;
318
+ const isSelfMoved = MeetingsUtil.isSelfMovedOrBreakoutEnded(newLocus);
319
319
  // @ts-ignore
320
320
  const deviceFromNewLocus = MeetingsUtil.getThisDevice(newLocus, this.webex.internal.device.url);
321
321
  const isResourceMovedOnThisDevice =
@@ -392,7 +392,7 @@ export default class Meetings extends WebexPlugin {
392
392
  private isNeedHandleLocusDTO(meeting: any, newLocus: any) {
393
393
  if (newLocus) {
394
394
  const isNewLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(newLocus);
395
- const isSelfMoved = newLocus?.self?.state === _LEFT_ && newLocus?.self?.reason === _MOVED_;
395
+ const isSelfMoved = MeetingsUtil.isSelfMovedOrBreakoutEnded(newLocus);
396
396
  const isSelfMovedToLobby =
397
397
  newLocus?.self?.devices[0]?.intent?.reason === _ON_HOLD_LOBBY_ &&
398
398
  newLocus?.self?.devices[0]?.intent?.type === _WAIT_;
@@ -7,6 +7,7 @@ import {
7
7
  _LEFT_,
8
8
  DESTINATION_TYPE,
9
9
  _MOVED_,
10
+ _BREAKOUT_ENDED_,
10
11
  BREAKOUTS,
11
12
  EVENT_TRIGGERS,
12
13
  LOCUS,
@@ -266,6 +267,23 @@ MeetingsUtil.getThisDevice = (newLocus: any, deviceUrl: string) => {
266
267
  return null;
267
268
  };
268
269
 
270
+ /**
271
+ * Checks if the self state in a locus indicates a breakout move or breakout end.
272
+ * Returns true when:
273
+ * - self state is LEFT with reason MOVED (regular breakout move), OR
274
+ * - fullState is INACTIVE with endMeetingReason BREAKOUT_ENDED (breakout session ended)
275
+ * @param {Object} locus locus data
276
+ * @returns {boolean}
277
+ */
278
+ MeetingsUtil.isSelfMovedOrBreakoutEnded = (locus: any): boolean => {
279
+ const isSelfLeftMoved = locus?.self?.state === _LEFT_ && locus?.self?.reason === _MOVED_;
280
+ const isBreakoutEnded =
281
+ locus?.fullState?.state === LOCUS.STATE.INACTIVE &&
282
+ locus?.fullState?.endMeetingReason === _BREAKOUT_ENDED_;
283
+
284
+ return isSelfLeftMoved || isBreakoutEnded;
285
+ };
286
+
269
287
  /**
270
288
  * get self device joined status from locus data
271
289
  * @param {Object} meeting current meeting data
@@ -637,6 +637,32 @@ describe('HashTreeParser', () => {
637
637
  expect(syncCalls[2].args[0].uri).to.equal(`${atdActiveDataSet.url}/sync`);
638
638
  });
639
639
 
640
+ it('sends leafCount=1 with a single empty leaf for initialization sync, regardless of actual dataset leafCount', async () => {
641
+ const parser = createHashTreeParser({dataSets: [], locus: null}, null);
642
+
643
+ // Use a dataset with leafCount=16 to verify the initialization sync always uses leafCount=1
644
+ const mainDataSet = createDataSet('main', 16, 1100);
645
+
646
+ mockGetAllDataSetsMetadata(webexRequest, visibleDataSetsUrl, [mainDataSet]);
647
+ mockSyncRequest(webexRequest, mainDataSet.url);
648
+
649
+ await parser.initializeFromMessage({
650
+ dataSets: [],
651
+ visibleDataSetsUrl,
652
+ locusUrl,
653
+ });
654
+
655
+ assert.calledWith(webexRequest, {
656
+ method: 'POST',
657
+ uri: `${mainDataSet.url}/sync`,
658
+ qs: {rootHash: sinon.match.string},
659
+ body: {
660
+ leafCount: 1,
661
+ leafDataEntries: [{leafIndex: 0, elementIds: []}],
662
+ },
663
+ });
664
+ });
665
+
640
666
  it('handles sync response that has locusStateElements undefined', async () => {
641
667
  const minimalInitialLocus = {
642
668
  dataSets: [],
@@ -13,6 +13,7 @@ import MediaSharesUtils from '@webex/plugin-meetings/src/locus-info//mediaShares
13
13
  import LocusDeltaParser from '@webex/plugin-meetings/src/locus-info/parser';
14
14
  import Metrics from '@webex/plugin-meetings/src/metrics';
15
15
  import * as HashTreeParserModule from '@webex/plugin-meetings/src/hashTree/hashTreeParser';
16
+ import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
16
17
 
17
18
  import {
18
19
  LOCUSINFO,
@@ -3693,49 +3694,23 @@ describe('plugin-meetings', () => {
3693
3694
  assert.deepEqual(callOrder, ['updateLocusUrl', 'updateMeetingInfo']);
3694
3695
  });
3695
3696
 
3696
- it('#updateLocusInfo ignores breakout LEFT message', () => {
3697
- const newLocus = {
3698
- self: {
3699
- reason: 'MOVED',
3700
- state: 'LEFT',
3701
- },
3702
- };
3697
+ it('#updateLocusInfo ignores locus when isSelfMovedOrBreakoutEnded returns true', () => {
3698
+ const newLocus = {self: {state: 'JOINED'}};
3699
+
3700
+ sinon.stub(MeetingsUtil, 'isSelfMovedOrBreakoutEnded').returns(true);
3703
3701
 
3704
3702
  locusInfo.updateControls = sinon.stub();
3705
- locusInfo.updateConversationUrl = sinon.stub();
3706
- locusInfo.updateCreated = sinon.stub();
3707
3703
  locusInfo.updateFullState = sinon.stub();
3708
- locusInfo.updateHostInfo = sinon.stub();
3709
- locusInfo.updateMeetingInfo = sinon.stub();
3710
- locusInfo.updateMediaShares = sinon.stub();
3711
- locusInfo.updateReplaces = sinon.stub();
3712
3704
  locusInfo.updateSelf = sinon.stub();
3713
- locusInfo.updateLocusUrl = sinon.stub();
3714
- locusInfo.updateAclUrl = sinon.stub();
3715
- locusInfo.updateBasequence = sinon.stub();
3716
- locusInfo.updateSequence = sinon.stub();
3717
- locusInfo.updateEmbeddedApps = sinon.stub();
3718
- locusInfo.updateLinks = sinon.stub();
3719
- locusInfo.compareAndUpdate = sinon.stub();
3720
3705
 
3721
3706
  locusInfo.updateLocusInfo(newLocus);
3722
3707
 
3708
+ assert.calledOnceWithExactly(MeetingsUtil.isSelfMovedOrBreakoutEnded, newLocus);
3723
3709
  assert.notCalled(locusInfo.updateControls);
3724
- assert.notCalled(locusInfo.updateConversationUrl);
3725
- assert.notCalled(locusInfo.updateCreated);
3726
3710
  assert.notCalled(locusInfo.updateFullState);
3727
- assert.notCalled(locusInfo.updateHostInfo);
3728
- assert.notCalled(locusInfo.updateMeetingInfo);
3729
- assert.notCalled(locusInfo.updateMediaShares);
3730
- assert.notCalled(locusInfo.updateReplaces);
3731
3711
  assert.notCalled(locusInfo.updateSelf);
3732
- assert.notCalled(locusInfo.updateLocusUrl);
3733
- assert.notCalled(locusInfo.updateAclUrl);
3734
- assert.notCalled(locusInfo.updateBasequence);
3735
- assert.notCalled(locusInfo.updateSequence);
3736
- assert.notCalled(locusInfo.updateEmbeddedApps);
3737
- assert.notCalled(locusInfo.updateLinks);
3738
- assert.notCalled(locusInfo.compareAndUpdate);
3712
+
3713
+ MeetingsUtil.isSelfMovedOrBreakoutEnded.restore();
3739
3714
  });
3740
3715
 
3741
3716
  it('#updateLocusInfo puts the Locus DTO top level properties at the right place in LocusInfo class', () => {
@@ -3581,6 +3581,21 @@ describe('plugin-meetings', () => {
3581
3581
  'Meetings:index#isNeedHandleMainLocus --> self device left&moved in main locus with self joined status, not need to handle'
3582
3582
  );
3583
3583
  });
3584
+
3585
+ it('check breakout ended with self removed, return false', () => {
3586
+ webex.meetings.meetingCollection.getActiveBreakoutLocus = sinon.stub().returns(null);
3587
+ newLocus.self.state = 'LEFT';
3588
+ newLocus.self.reason = 'OTHER';
3589
+ newLocus.self.removed = true;
3590
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3591
+ LoggerProxy.logger.log = sinon.stub();
3592
+ const result = webex.meetings.isNeedHandleMainLocus(meeting, newLocus);
3593
+ assert.equal(result, false);
3594
+ assert.calledWith(
3595
+ LoggerProxy.logger.log,
3596
+ 'Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle'
3597
+ );
3598
+ });
3584
3599
  });
3585
3600
 
3586
3601
  describe('#isNeedHandleLocusDTO', () => {
@@ -3641,6 +3656,18 @@ describe('plugin-meetings', () => {
3641
3656
  const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3642
3657
  assert.equal(result, false);
3643
3658
  });
3659
+ it('breakout session with breakout ended, return false', () => {
3660
+ newLocus.controls.breakout = {
3661
+ sessionType: 'BREAKOUT',
3662
+ };
3663
+ newLocus.self.state = 'LEFT';
3664
+ newLocus.self.reason = 'OTHER';
3665
+ newLocus.self.devices = [];
3666
+ newLocus.fullState = {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'};
3667
+ LoggerProxy.logger.log = sinon.stub();
3668
+ const result = webex.meetings.isNeedHandleLocusDTO(meeting, newLocus);
3669
+ assert.equal(result, false);
3670
+ });
3644
3671
  it('moved to lobby, return true', () => {
3645
3672
  newLocus.controls.breakout = {
3646
3673
  sessionType: 'MAIN',
@@ -238,6 +238,22 @@ describe('plugin-meetings', () => {
238
238
  });
239
239
  });
240
240
 
241
+ describe('#isSelfMovedOrBreakoutEnded', () => {
242
+ [
243
+ {description: 'locus is undefined', locus: undefined, expected: false},
244
+ {description: 'self state is JOINED', locus: {self: {state: 'JOINED', reason: 'OTHER'}}, expected: false},
245
+ {description: 'self state is LEFT with reason MOVED', locus: {self: {state: 'LEFT', reason: 'MOVED'}}, expected: true},
246
+ {description: 'fullState is INACTIVE with BREAKOUT_ENDED', locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE', endMeetingReason: 'BREAKOUT_ENDED'}}, expected: true},
247
+ {description: 'fullState is INACTIVE with different endMeetingReason', locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE', endMeetingReason: 'SOME_OTHER_REASON'}}, expected: false},
248
+ {description: 'fullState is missing', locus: {self: {state: 'LEFT', reason: 'OTHER'}}, expected: false},
249
+ {description: 'endMeetingReason is missing', locus: {self: {state: 'LEFT', reason: 'OTHER'}, fullState: {state: 'INACTIVE'}}, expected: false},
250
+ ].forEach(({description, locus, expected}) => {
251
+ it(`returns ${expected} when ${description}`, () => {
252
+ assert.equal(MeetingsUtil.isSelfMovedOrBreakoutEnded(locus), expected);
253
+ });
254
+ });
255
+ });
256
+
241
257
  describe('#joinedOnThisDevice', () => {
242
258
  it('return false if no devices in self', () => {
243
259
  const newLocus = {};