@webex/plugin-meetings 2.60.1-next.9 → 2.60.2

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.
Files changed (539) hide show
  1. package/README.md +8 -58
  2. package/dist/common/browser-detection.js +3 -2
  3. package/dist/common/browser-detection.js.map +1 -1
  4. package/dist/common/collection.js +4 -3
  5. package/dist/common/collection.js.map +1 -1
  6. package/dist/common/config.js +2 -1
  7. package/dist/common/config.js.map +1 -1
  8. package/dist/common/errors/captcha-error.js +2 -1
  9. package/dist/common/errors/captcha-error.js.map +1 -1
  10. package/dist/common/errors/intent-to-join.js +2 -1
  11. package/dist/common/errors/intent-to-join.js.map +1 -1
  12. package/dist/common/errors/join-meeting.js +2 -1
  13. package/dist/common/errors/join-meeting.js.map +1 -1
  14. package/dist/common/errors/media.js +2 -1
  15. package/dist/common/errors/media.js.map +1 -1
  16. package/dist/common/errors/parameter.js +4 -3
  17. package/dist/common/errors/parameter.js.map +1 -1
  18. package/dist/common/errors/password-error.js +2 -1
  19. package/dist/common/errors/password-error.js.map +1 -1
  20. package/dist/common/errors/permission.js +2 -1
  21. package/dist/common/errors/permission.js.map +1 -1
  22. package/dist/common/errors/{reclaim-host-role-errors.js → reclaim-host-role-error.js} +11 -7
  23. package/dist/common/errors/reclaim-host-role-error.js.map +1 -0
  24. package/dist/common/errors/reconnection-in-progress.js +2 -1
  25. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  26. package/dist/common/errors/reconnection.js +2 -1
  27. package/dist/common/errors/reconnection.js.map +1 -1
  28. package/dist/common/errors/stats.js +2 -1
  29. package/dist/common/errors/stats.js.map +1 -1
  30. package/dist/common/errors/webex-errors.d.ts +8 -20
  31. package/dist/common/errors/webex-errors.js +28 -48
  32. package/dist/common/errors/webex-errors.js.map +1 -1
  33. package/dist/common/errors/webex-meetings-error.js +2 -1
  34. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  35. package/dist/common/events/events-scope.js +2 -1
  36. package/dist/common/events/events-scope.js.map +1 -1
  37. package/dist/common/events/events.js +2 -1
  38. package/dist/common/events/events.js.map +1 -1
  39. package/dist/common/events/trigger-proxy.js +2 -1
  40. package/dist/common/events/trigger-proxy.js.map +1 -1
  41. package/dist/common/events/util.js +2 -1
  42. package/dist/common/events/util.js.map +1 -1
  43. package/dist/common/logs/logger-config.js +2 -1
  44. package/dist/common/logs/logger-config.js.map +1 -1
  45. package/dist/common/logs/logger-proxy.js +3 -2
  46. package/dist/common/logs/logger-proxy.js.map +1 -1
  47. package/dist/common/logs/request.d.ts +1 -3
  48. package/dist/common/logs/request.js +5 -8
  49. package/dist/common/logs/request.js.map +1 -1
  50. package/dist/common/queue.d.ts +7 -9
  51. package/dist/common/queue.js +9 -22
  52. package/dist/common/queue.js.map +1 -1
  53. package/dist/config.d.ts +7 -6
  54. package/dist/config.js +10 -8
  55. package/dist/config.js.map +1 -1
  56. package/dist/constants.d.ts +100 -234
  57. package/dist/constants.js +444 -433
  58. package/dist/constants.js.map +1 -1
  59. package/dist/controls-options-manager/constants.js +6 -3
  60. package/dist/controls-options-manager/constants.js.map +1 -1
  61. package/dist/controls-options-manager/enums.d.ts +1 -11
  62. package/dist/controls-options-manager/enums.js +6 -15
  63. package/dist/controls-options-manager/enums.js.map +1 -1
  64. package/dist/controls-options-manager/index.d.ts +1 -17
  65. package/dist/controls-options-manager/index.js +38 -127
  66. package/dist/controls-options-manager/index.js.map +1 -1
  67. package/dist/controls-options-manager/util.d.ts +7 -1
  68. package/dist/controls-options-manager/util.js +19 -309
  69. package/dist/controls-options-manager/util.js.map +1 -1
  70. package/dist/index.d.ts +3 -6
  71. package/dist/index.js +5 -121
  72. package/dist/index.js.map +1 -1
  73. package/dist/locus-info/controlsUtils.js +11 -100
  74. package/dist/locus-info/controlsUtils.js.map +1 -1
  75. package/dist/locus-info/embeddedAppsUtils.js +4 -3
  76. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  77. package/dist/locus-info/fullState.js +2 -1
  78. package/dist/locus-info/fullState.js.map +1 -1
  79. package/dist/locus-info/hostUtils.js +2 -1
  80. package/dist/locus-info/hostUtils.js.map +1 -1
  81. package/dist/locus-info/index.d.ts +4 -57
  82. package/dist/locus-info/index.js +84 -425
  83. package/dist/locus-info/index.js.map +1 -1
  84. package/dist/locus-info/infoUtils.js +5 -13
  85. package/dist/locus-info/infoUtils.js.map +1 -1
  86. package/dist/locus-info/mediaSharesUtils.js +3 -58
  87. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  88. package/dist/locus-info/parser.d.ts +6 -66
  89. package/dist/locus-info/parser.js +80 -253
  90. package/dist/locus-info/parser.js.map +1 -1
  91. package/dist/locus-info/selfUtils.js +13 -97
  92. package/dist/locus-info/selfUtils.js.map +1 -1
  93. package/dist/media/index.d.ts +0 -2
  94. package/dist/media/index.js +319 -107
  95. package/dist/media/index.js.map +1 -1
  96. package/dist/media/properties.d.ts +53 -38
  97. package/dist/media/properties.js +153 -96
  98. package/dist/media/properties.js.map +1 -1
  99. package/dist/media/util.js +22 -1
  100. package/dist/media/util.js.map +1 -1
  101. package/dist/mediaQualityMetrics/config.d.ts +230 -234
  102. package/dist/mediaQualityMetrics/config.js +498 -302
  103. package/dist/mediaQualityMetrics/config.js.map +1 -1
  104. package/dist/meeting/effectsState.d.ts +42 -0
  105. package/dist/meeting/effectsState.js +260 -0
  106. package/dist/meeting/effectsState.js.map +1 -0
  107. package/dist/meeting/in-meeting-actions.d.ts +0 -88
  108. package/dist/meeting/in-meeting-actions.js +3 -94
  109. package/dist/meeting/in-meeting-actions.js.map +1 -1
  110. package/dist/meeting/index.d.ts +520 -705
  111. package/dist/meeting/index.js +3083 -5041
  112. package/dist/meeting/index.js.map +1 -1
  113. package/dist/meeting/muteState.d.ts +25 -93
  114. package/dist/meeting/muteState.js +133 -224
  115. package/dist/meeting/muteState.js.map +1 -1
  116. package/dist/meeting/request.d.ts +47 -82
  117. package/dist/meeting/request.js +199 -304
  118. package/dist/meeting/request.js.map +1 -1
  119. package/dist/meeting/state.js +2 -1
  120. package/dist/meeting/state.js.map +1 -1
  121. package/dist/meeting/util.d.ts +1 -118
  122. package/dist/meeting/util.js +435 -676
  123. package/dist/meeting/util.js.map +1 -1
  124. package/dist/meeting-info/collection.js +4 -3
  125. package/dist/meeting-info/collection.js.map +1 -1
  126. package/dist/meeting-info/index.d.ts +1 -13
  127. package/dist/meeting-info/index.js +7 -74
  128. package/dist/meeting-info/index.js.map +1 -1
  129. package/dist/meeting-info/meeting-info-v2.d.ts +1 -31
  130. package/dist/meeting-info/meeting-info-v2.js +63 -200
  131. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  132. package/dist/meeting-info/request.js +2 -1
  133. package/dist/meeting-info/request.js.map +1 -1
  134. package/dist/meeting-info/util.js +3 -2
  135. package/dist/meeting-info/util.js.map +1 -1
  136. package/dist/meeting-info/utilv2.js +41 -39
  137. package/dist/meeting-info/utilv2.js.map +1 -1
  138. package/dist/meetings/collection.d.ts +0 -17
  139. package/dist/meetings/collection.js +4 -42
  140. package/dist/meetings/collection.js.map +1 -1
  141. package/dist/meetings/index.d.ts +20 -114
  142. package/dist/meetings/index.js +133 -540
  143. package/dist/meetings/index.js.map +1 -1
  144. package/dist/meetings/request.js +3 -4
  145. package/dist/meetings/request.js.map +1 -1
  146. package/dist/meetings/util.js +6 -107
  147. package/dist/meetings/util.js.map +1 -1
  148. package/dist/member/index.d.ts +1 -13
  149. package/dist/member/index.js +2 -45
  150. package/dist/member/index.js.map +1 -1
  151. package/dist/member/member.types.js +4 -3
  152. package/dist/member/member.types.js.map +1 -1
  153. package/dist/member/util.js +29 -120
  154. package/dist/member/util.js.map +1 -1
  155. package/dist/members/collection.d.ts +0 -5
  156. package/dist/members/collection.js +2 -11
  157. package/dist/members/collection.js.map +1 -1
  158. package/dist/members/index.d.ts +11 -56
  159. package/dist/members/index.js +47 -174
  160. package/dist/members/index.js.map +1 -1
  161. package/dist/members/request.d.ts +11 -67
  162. package/dist/members/request.js +54 -102
  163. package/dist/members/request.js.map +1 -1
  164. package/dist/members/types.js +4 -3
  165. package/dist/members/types.js.map +1 -1
  166. package/dist/members/util.d.ts +1 -214
  167. package/dist/members/util.js +284 -327
  168. package/dist/members/util.js.map +1 -1
  169. package/dist/metrics/config.d.ts +169 -0
  170. package/dist/metrics/config.js +289 -0
  171. package/dist/metrics/config.js.map +1 -0
  172. package/dist/metrics/constants.d.ts +6 -15
  173. package/dist/metrics/constants.js +9 -17
  174. package/dist/metrics/constants.js.map +1 -1
  175. package/dist/metrics/index.d.ts +111 -4
  176. package/dist/metrics/index.js +452 -4
  177. package/dist/metrics/index.js.map +1 -1
  178. package/dist/networkQualityMonitor/index.js +4 -5
  179. package/dist/networkQualityMonitor/index.js.map +1 -1
  180. package/dist/peer-connection-manager/index.d.ts +6 -0
  181. package/dist/peer-connection-manager/index.js +671 -0
  182. package/dist/peer-connection-manager/index.js.map +1 -0
  183. package/dist/peer-connection-manager/util.d.ts +6 -0
  184. package/dist/peer-connection-manager/util.js +110 -0
  185. package/dist/peer-connection-manager/util.js.map +1 -0
  186. package/dist/personal-meeting-room/index.js +3 -2
  187. package/dist/personal-meeting-room/index.js.map +1 -1
  188. package/dist/personal-meeting-room/request.js +3 -2
  189. package/dist/personal-meeting-room/request.js.map +1 -1
  190. package/dist/personal-meeting-room/util.js +2 -1
  191. package/dist/personal-meeting-room/util.js.map +1 -1
  192. package/dist/reachability/index.d.ts +95 -61
  193. package/dist/reachability/index.js +392 -304
  194. package/dist/reachability/index.js.map +1 -1
  195. package/dist/reachability/request.d.ts +3 -7
  196. package/dist/reachability/request.js +10 -18
  197. package/dist/reachability/request.js.map +1 -1
  198. package/dist/reactions/reactions.d.ts +2 -2
  199. package/dist/reactions/reactions.js +6 -4
  200. package/dist/reactions/reactions.js.map +1 -1
  201. package/dist/reactions/reactions.type.d.ts +3 -23
  202. package/dist/reactions/reactions.type.js +23 -21
  203. package/dist/reactions/reactions.type.js.map +1 -1
  204. package/dist/reconnection-manager/index.d.ts +8 -32
  205. package/dist/reconnection-manager/index.js +232 -285
  206. package/dist/reconnection-manager/index.js.map +1 -1
  207. package/dist/recording-controller/enums.js +5 -4
  208. package/dist/recording-controller/enums.js.map +1 -1
  209. package/dist/recording-controller/index.d.ts +1 -15
  210. package/dist/recording-controller/index.js +46 -57
  211. package/dist/recording-controller/index.js.map +1 -1
  212. package/dist/recording-controller/util.d.ts +4 -5
  213. package/dist/recording-controller/util.js +10 -10
  214. package/dist/recording-controller/util.js.map +1 -1
  215. package/dist/roap/collection.d.ts +10 -0
  216. package/dist/roap/collection.js +63 -0
  217. package/dist/roap/collection.js.map +1 -0
  218. package/dist/roap/handler.d.ts +47 -0
  219. package/dist/roap/handler.js +279 -0
  220. package/dist/roap/handler.js.map +1 -0
  221. package/dist/roap/index.d.ts +47 -9
  222. package/dist/roap/index.js +238 -100
  223. package/dist/roap/index.js.map +1 -1
  224. package/dist/roap/request.d.ts +12 -18
  225. package/dist/roap/request.js +180 -126
  226. package/dist/roap/request.js.map +1 -1
  227. package/dist/roap/state.d.ts +9 -0
  228. package/dist/roap/state.js +127 -0
  229. package/dist/roap/state.js.map +1 -0
  230. package/dist/roap/turnDiscovery.d.ts +16 -27
  231. package/dist/roap/turnDiscovery.js +105 -115
  232. package/dist/roap/turnDiscovery.js.map +1 -1
  233. package/dist/roap/util.d.ts +2 -0
  234. package/dist/roap/util.js +76 -0
  235. package/dist/roap/util.js.map +1 -0
  236. package/dist/statsAnalyzer/global.d.ts +83 -1
  237. package/dist/statsAnalyzer/global.js +85 -2
  238. package/dist/statsAnalyzer/global.js.map +1 -1
  239. package/dist/statsAnalyzer/index.d.ts +30 -50
  240. package/dist/statsAnalyzer/index.js +511 -436
  241. package/dist/statsAnalyzer/index.js.map +1 -1
  242. package/dist/statsAnalyzer/mqaUtil.d.ts +6 -8
  243. package/dist/statsAnalyzer/mqaUtil.js +90 -130
  244. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  245. package/dist/transcription/index.js +2 -1
  246. package/dist/transcription/index.js.map +1 -1
  247. package/package.json +26 -39
  248. package/src/common/errors/webex-errors.ts +12 -36
  249. package/src/common/logs/logger-proxy.ts +1 -1
  250. package/src/common/logs/request.ts +1 -5
  251. package/src/common/queue.ts +8 -22
  252. package/src/config.ts +7 -6
  253. package/src/constants.ts +100 -265
  254. package/src/controls-options-manager/enums.ts +0 -12
  255. package/src/controls-options-manager/index.ts +21 -116
  256. package/src/controls-options-manager/util.ts +14 -294
  257. package/src/index.js +15 -0
  258. package/src/locus-info/controlsUtils.ts +0 -110
  259. package/src/locus-info/index.ts +61 -450
  260. package/src/locus-info/infoUtils.ts +2 -14
  261. package/src/locus-info/mediaSharesUtils.ts +0 -64
  262. package/src/locus-info/parser.ts +47 -258
  263. package/src/locus-info/selfUtils.ts +2 -85
  264. package/src/media/index.ts +370 -153
  265. package/src/media/properties.ts +136 -106
  266. package/src/media/util.ts +21 -0
  267. package/src/mediaQualityMetrics/config.ts +377 -244
  268. package/src/meeting/effectsState.ts +209 -0
  269. package/src/meeting/in-meeting-actions.ts +0 -176
  270. package/src/meeting/index.ts +2581 -4306
  271. package/src/meeting/muteState.ts +138 -224
  272. package/src/meeting/request.ts +127 -214
  273. package/src/meeting/util.ts +423 -687
  274. package/src/meeting-info/index.ts +8 -81
  275. package/src/meeting-info/meeting-info-v2.ts +13 -163
  276. package/src/meeting-info/util.ts +1 -1
  277. package/src/meeting-info/utilv2.ts +28 -28
  278. package/src/meetings/collection.ts +0 -33
  279. package/src/meetings/index.ts +136 -531
  280. package/src/meetings/request.ts +0 -2
  281. package/src/meetings/util.ts +5 -116
  282. package/src/member/index.ts +1 -43
  283. package/src/member/util.ts +28 -125
  284. package/src/members/collection.ts +0 -8
  285. package/src/members/index.ts +52 -187
  286. package/src/members/request.ts +27 -87
  287. package/src/members/util.ts +291 -332
  288. package/src/metrics/config.ts +485 -0
  289. package/src/metrics/constants.ts +6 -15
  290. package/src/metrics/index.ts +471 -1
  291. package/src/networkQualityMonitor/index.ts +6 -6
  292. package/src/peer-connection-manager/index.ts +847 -0
  293. package/src/peer-connection-manager/util.ts +119 -0
  294. package/src/reachability/index.ts +347 -246
  295. package/src/reachability/request.ts +8 -17
  296. package/src/reactions/reactions.ts +4 -4
  297. package/src/reactions/reactions.type.ts +4 -30
  298. package/src/reconnection-manager/index.ts +156 -168
  299. package/src/recording-controller/index.ts +3 -20
  300. package/src/recording-controller/util.ts +9 -26
  301. package/src/roap/collection.ts +62 -0
  302. package/src/roap/handler.ts +294 -0
  303. package/src/roap/index.ts +241 -96
  304. package/src/roap/request.ts +148 -74
  305. package/src/roap/state.ts +156 -0
  306. package/src/roap/turnDiscovery.ts +56 -62
  307. package/src/roap/util.ts +100 -0
  308. package/src/statsAnalyzer/global.ts +84 -1
  309. package/src/statsAnalyzer/index.ts +645 -479
  310. package/src/statsAnalyzer/mqaUtil.ts +126 -128
  311. package/test/integration/spec/journey.js +264 -320
  312. package/test/integration/spec/space-meeting.js +4 -77
  313. package/test/unit/spec/common/queue.js +2 -31
  314. package/test/unit/spec/controls-options-manager/index.js +0 -163
  315. package/test/unit/spec/controls-options-manager/util.js +60 -576
  316. package/test/unit/spec/fixture/locus.js +0 -1
  317. package/test/unit/spec/locus-info/controlsUtils.js +30 -323
  318. package/test/unit/spec/locus-info/index.js +15 -1437
  319. package/test/unit/spec/locus-info/infoUtils.js +16 -54
  320. package/test/unit/spec/locus-info/lib/SeqCmp.json +0 -16
  321. package/test/unit/spec/locus-info/lib/selfConstant.js +0 -48
  322. package/test/unit/spec/locus-info/parser.js +35 -116
  323. package/test/unit/spec/locus-info/selfUtils.js +0 -275
  324. package/test/unit/spec/media/properties.ts +84 -75
  325. package/test/unit/spec/meeting/effectsState.js +281 -0
  326. package/test/unit/spec/meeting/in-meeting-actions.ts +0 -86
  327. package/test/unit/spec/meeting/index.js +2313 -8384
  328. package/test/unit/spec/meeting/muteState.js +213 -409
  329. package/test/unit/spec/meeting/request.js +43 -523
  330. package/test/unit/spec/meeting/utils.js +24 -834
  331. package/test/unit/spec/meeting-info/meetinginfov2.js +5 -527
  332. package/test/unit/spec/meeting-info/utilv2.js +0 -21
  333. package/test/unit/spec/meetings/collection.js +0 -26
  334. package/test/unit/spec/meetings/index.js +232 -1445
  335. package/test/unit/spec/meetings/utils.js +2 -202
  336. package/test/unit/spec/member/index.js +9 -32
  337. package/test/unit/spec/member/util.js +61 -499
  338. package/test/unit/spec/members/index.js +5 -394
  339. package/test/unit/spec/members/request.js +27 -206
  340. package/test/unit/spec/members/utils.js +38 -173
  341. package/test/unit/spec/metrics/index.js +50 -1
  342. package/test/unit/spec/networkQualityMonitor/index.js +4 -4
  343. package/test/unit/spec/peerconnection-manager/index.js +218 -0
  344. package/test/unit/spec/peerconnection-manager/utils.js +49 -0
  345. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +388 -0
  346. package/test/unit/spec/reachability/index.ts +24 -532
  347. package/test/unit/spec/reconnection-manager/index.js +24 -163
  348. package/test/unit/spec/recording-controller/index.js +218 -293
  349. package/test/unit/spec/recording-controller/util.js +96 -223
  350. package/test/unit/spec/roap/index.ts +77 -187
  351. package/test/unit/spec/roap/turnDiscovery.ts +48 -86
  352. package/test/unit/spec/roap/util.js +30 -0
  353. package/test/unit/spec/stats-analyzer/index.js +165 -644
  354. package/test/utils/testUtils.js +45 -0
  355. package/test/utils/webex-config.js +0 -4
  356. package/test/utils/webex-test-users.js +3 -7
  357. package/dist/annotation/annotation.types.d.ts +0 -42
  358. package/dist/annotation/annotation.types.js +0 -7
  359. package/dist/annotation/annotation.types.js.map +0 -1
  360. package/dist/annotation/constants.d.ts +0 -31
  361. package/dist/annotation/constants.js +0 -41
  362. package/dist/annotation/constants.js.map +0 -1
  363. package/dist/annotation/index.d.ts +0 -117
  364. package/dist/annotation/index.js +0 -357
  365. package/dist/annotation/index.js.map +0 -1
  366. package/dist/breakouts/breakout.d.ts +0 -8
  367. package/dist/breakouts/breakout.js +0 -215
  368. package/dist/breakouts/breakout.js.map +0 -1
  369. package/dist/breakouts/collection.d.ts +0 -5
  370. package/dist/breakouts/collection.js +0 -22
  371. package/dist/breakouts/collection.js.map +0 -1
  372. package/dist/breakouts/edit-lock-error.d.ts +0 -15
  373. package/dist/breakouts/edit-lock-error.js +0 -51
  374. package/dist/breakouts/edit-lock-error.js.map +0 -1
  375. package/dist/breakouts/events.d.ts +0 -8
  376. package/dist/breakouts/events.js +0 -44
  377. package/dist/breakouts/events.js.map +0 -1
  378. package/dist/breakouts/index.d.ts +0 -5
  379. package/dist/breakouts/index.js +0 -1047
  380. package/dist/breakouts/index.js.map +0 -1
  381. package/dist/breakouts/request.d.ts +0 -22
  382. package/dist/breakouts/request.js +0 -77
  383. package/dist/breakouts/request.js.map +0 -1
  384. package/dist/breakouts/utils.d.ts +0 -15
  385. package/dist/breakouts/utils.js +0 -64
  386. package/dist/breakouts/utils.js.map +0 -1
  387. package/dist/common/errors/no-meeting-info.d.ts +0 -14
  388. package/dist/common/errors/no-meeting-info.js +0 -50
  389. package/dist/common/errors/no-meeting-info.js.map +0 -1
  390. package/dist/common/errors/reclaim-host-role-errors.js.map +0 -1
  391. package/dist/controls-options-manager/types.d.ts +0 -43
  392. package/dist/controls-options-manager/types.js +0 -7
  393. package/dist/controls-options-manager/types.js.map +0 -1
  394. package/dist/interceptors/index.d.ts +0 -2
  395. package/dist/interceptors/index.js +0 -15
  396. package/dist/interceptors/index.js.map +0 -1
  397. package/dist/interceptors/locusRetry.d.ts +0 -27
  398. package/dist/interceptors/locusRetry.js +0 -94
  399. package/dist/interceptors/locusRetry.js.map +0 -1
  400. package/dist/interpretation/collection.d.ts +0 -5
  401. package/dist/interpretation/collection.js +0 -22
  402. package/dist/interpretation/collection.js.map +0 -1
  403. package/dist/interpretation/index.d.ts +0 -5
  404. package/dist/interpretation/index.js +0 -365
  405. package/dist/interpretation/index.js.map +0 -1
  406. package/dist/interpretation/siLanguage.d.ts +0 -5
  407. package/dist/interpretation/siLanguage.js +0 -24
  408. package/dist/interpretation/siLanguage.js.map +0 -1
  409. package/dist/meeting/locusMediaRequest.d.ts +0 -74
  410. package/dist/meeting/locusMediaRequest.js +0 -291
  411. package/dist/meeting/locusMediaRequest.js.map +0 -1
  412. package/dist/meeting/request.type.d.ts +0 -11
  413. package/dist/meeting/request.type.js +0 -7
  414. package/dist/meeting/request.type.js.map +0 -1
  415. package/dist/meeting/voicea-meeting.d.ts +0 -20
  416. package/dist/meeting/voicea-meeting.js +0 -201
  417. package/dist/meeting/voicea-meeting.js.map +0 -1
  418. package/dist/meetings/meetings.types.d.ts +0 -4
  419. package/dist/meetings/meetings.types.js +0 -7
  420. package/dist/meetings/meetings.types.js.map +0 -1
  421. package/dist/member/types.d.ts +0 -32
  422. package/dist/member/types.js +0 -23
  423. package/dist/member/types.js.map +0 -1
  424. package/dist/multistream/mediaRequestManager.d.ts +0 -118
  425. package/dist/multistream/mediaRequestManager.js +0 -344
  426. package/dist/multistream/mediaRequestManager.js.map +0 -1
  427. package/dist/multistream/receiveSlot.d.ts +0 -68
  428. package/dist/multistream/receiveSlot.js +0 -200
  429. package/dist/multistream/receiveSlot.js.map +0 -1
  430. package/dist/multistream/receiveSlotManager.d.ts +0 -56
  431. package/dist/multistream/receiveSlotManager.js +0 -174
  432. package/dist/multistream/receiveSlotManager.js.map +0 -1
  433. package/dist/multistream/remoteMedia.d.ts +0 -72
  434. package/dist/multistream/remoteMedia.js +0 -268
  435. package/dist/multistream/remoteMedia.js.map +0 -1
  436. package/dist/multistream/remoteMediaGroup.d.ts +0 -47
  437. package/dist/multistream/remoteMediaGroup.js +0 -267
  438. package/dist/multistream/remoteMediaGroup.js.map +0 -1
  439. package/dist/multistream/remoteMediaManager.d.ts +0 -285
  440. package/dist/multistream/remoteMediaManager.js +0 -1211
  441. package/dist/multistream/remoteMediaManager.js.map +0 -1
  442. package/dist/multistream/sendSlotManager.d.ts +0 -61
  443. package/dist/multistream/sendSlotManager.js +0 -236
  444. package/dist/multistream/sendSlotManager.js.map +0 -1
  445. package/dist/reachability/clusterReachability.d.ts +0 -109
  446. package/dist/reachability/clusterReachability.js +0 -357
  447. package/dist/reachability/clusterReachability.js.map +0 -1
  448. package/dist/reachability/util.d.ts +0 -8
  449. package/dist/reachability/util.js +0 -29
  450. package/dist/reachability/util.js.map +0 -1
  451. package/dist/reactions/constants.d.ts +0 -3
  452. package/dist/reactions/constants.js +0 -12
  453. package/dist/reactions/constants.js.map +0 -1
  454. package/dist/rtcMetrics/constants.d.ts +0 -4
  455. package/dist/rtcMetrics/constants.js +0 -11
  456. package/dist/rtcMetrics/constants.js.map +0 -1
  457. package/dist/rtcMetrics/index.d.ts +0 -54
  458. package/dist/rtcMetrics/index.js +0 -140
  459. package/dist/rtcMetrics/index.js.map +0 -1
  460. package/dist/webinar/collection.d.ts +0 -16
  461. package/dist/webinar/collection.js +0 -43
  462. package/dist/webinar/collection.js.map +0 -1
  463. package/dist/webinar/index.d.ts +0 -5
  464. package/dist/webinar/index.js +0 -68
  465. package/dist/webinar/index.js.map +0 -1
  466. package/src/annotation/annotation.types.ts +0 -50
  467. package/src/annotation/constants.ts +0 -36
  468. package/src/annotation/index.ts +0 -328
  469. package/src/breakouts/README.md +0 -220
  470. package/src/breakouts/breakout.ts +0 -188
  471. package/src/breakouts/collection.ts +0 -19
  472. package/src/breakouts/edit-lock-error.ts +0 -25
  473. package/src/breakouts/events.ts +0 -56
  474. package/src/breakouts/index.ts +0 -925
  475. package/src/breakouts/request.ts +0 -55
  476. package/src/breakouts/utils.ts +0 -57
  477. package/src/common/errors/no-meeting-info.ts +0 -24
  478. package/src/controls-options-manager/types.ts +0 -59
  479. package/src/index.ts +0 -44
  480. package/src/interceptors/index.ts +0 -3
  481. package/src/interceptors/locusRetry.ts +0 -67
  482. package/src/interpretation/README.md +0 -60
  483. package/src/interpretation/collection.ts +0 -19
  484. package/src/interpretation/index.ts +0 -332
  485. package/src/interpretation/siLanguage.ts +0 -18
  486. package/src/meeting/locusMediaRequest.ts +0 -313
  487. package/src/meeting/request.type.ts +0 -13
  488. package/src/meeting/voicea-meeting.ts +0 -161
  489. package/src/meetings/meetings.types.ts +0 -12
  490. package/src/member/types.ts +0 -38
  491. package/src/multistream/mediaRequestManager.ts +0 -440
  492. package/src/multistream/receiveSlot.ts +0 -184
  493. package/src/multistream/receiveSlotManager.ts +0 -166
  494. package/src/multistream/remoteMedia.ts +0 -254
  495. package/src/multistream/remoteMediaGroup.ts +0 -284
  496. package/src/multistream/remoteMediaManager.ts +0 -1145
  497. package/src/multistream/sendSlotManager.ts +0 -170
  498. package/src/reachability/clusterReachability.ts +0 -320
  499. package/src/reachability/util.ts +0 -24
  500. package/src/reactions/constants.ts +0 -4
  501. package/src/rtcMetrics/constants.ts +0 -3
  502. package/src/rtcMetrics/index.ts +0 -124
  503. package/src/webinar/collection.ts +0 -31
  504. package/src/webinar/index.ts +0 -62
  505. package/test/integration/spec/converged-space-meetings.js +0 -233
  506. package/test/unit/spec/annotation/index.ts +0 -418
  507. package/test/unit/spec/breakouts/breakout.ts +0 -237
  508. package/test/unit/spec/breakouts/collection.ts +0 -15
  509. package/test/unit/spec/breakouts/edit-lock-error.ts +0 -30
  510. package/test/unit/spec/breakouts/events.ts +0 -89
  511. package/test/unit/spec/breakouts/index.ts +0 -1790
  512. package/test/unit/spec/breakouts/request.ts +0 -104
  513. package/test/unit/spec/breakouts/utils.js +0 -72
  514. package/test/unit/spec/interceptors/locusRetry.ts +0 -131
  515. package/test/unit/spec/interpretation/collection.ts +0 -15
  516. package/test/unit/spec/interpretation/index.ts +0 -589
  517. package/test/unit/spec/interpretation/siLanguage.ts +0 -28
  518. package/test/unit/spec/locus-info/mediaSharesUtils.ts +0 -32
  519. package/test/unit/spec/media/index.ts +0 -290
  520. package/test/unit/spec/meeting/locusMediaRequest.ts +0 -442
  521. package/test/unit/spec/meeting-info/index.js +0 -300
  522. package/test/unit/spec/multistream/mediaRequestManager.ts +0 -1418
  523. package/test/unit/spec/multistream/receiveSlot.ts +0 -163
  524. package/test/unit/spec/multistream/receiveSlotManager.ts +0 -203
  525. package/test/unit/spec/multistream/remoteMedia.ts +0 -255
  526. package/test/unit/spec/multistream/remoteMediaGroup.ts +0 -662
  527. package/test/unit/spec/multistream/remoteMediaManager.ts +0 -1924
  528. package/test/unit/spec/multistream/sendSlotManager.ts +0 -242
  529. package/test/unit/spec/reachability/clusterReachability.ts +0 -279
  530. package/test/unit/spec/reachability/request.js +0 -68
  531. package/test/unit/spec/reachability/util.ts +0 -40
  532. package/test/unit/spec/roap/request.ts +0 -255
  533. package/test/unit/spec/rtcMetrics/index.ts +0 -93
  534. package/test/unit/spec/webinar/collection.ts +0 -13
  535. package/test/unit/spec/webinar/index.ts +0 -60
  536. package/test/utils/constants.js +0 -9
  537. package/test/utils/integrationTestUtils.js +0 -46
  538. /package/dist/common/errors/{reclaim-host-role-errors.d.ts → reclaim-host-role-error.d.ts} +0 -0
  539. /package/src/common/errors/{reclaim-host-role-errors.ts → reclaim-host-role-error.ts} +0 -0
@@ -3,14 +3,12 @@ import sinon from 'sinon';
3
3
  import {cloneDeep} from 'lodash';
4
4
  import {assert} from '@webex/test-helper-chai';
5
5
  import MockWebex from '@webex/test-helper-mock-webex';
6
- import testUtils from '../../../utils/testUtils';
7
6
  import Meetings from '@webex/plugin-meetings';
8
7
  import LocusInfo from '@webex/plugin-meetings/src/locus-info';
9
8
  import SelfUtils from '@webex/plugin-meetings/src/locus-info/selfUtils';
10
9
  import InfoUtils from '@webex/plugin-meetings/src/locus-info/infoUtils';
11
10
  import EmbeddedAppsUtils from '@webex/plugin-meetings/src/locus-info/embeddedAppsUtils';
12
11
  import LocusDeltaParser from '@webex/plugin-meetings/src/locus-info/parser';
13
- import Metrics from '@webex/plugin-meetings/src/metrics';
14
12
 
15
13
  import {
16
14
  LOCUSINFO,
@@ -18,10 +16,6 @@ import {
18
16
  LOCUSEVENT,
19
17
  EVENTS,
20
18
  DISPLAY_HINTS,
21
- _CALL_,
22
- LOCUS,
23
- MEETING_STATE,
24
- _MEETING_,
25
19
  } from '../../../../src/constants';
26
20
 
27
21
  import {self, selfWithInactivity} from './lib/selfConstant';
@@ -39,7 +33,6 @@ describe('plugin-meetings', () => {
39
33
  const locus = {};
40
34
  const meetingId = 'meetingId';
41
35
  let locusInfo;
42
- let sendBehavioralMetricStub;
43
36
 
44
37
  const webex = new MockWebex({
45
38
  children: {
@@ -66,12 +59,6 @@ describe('plugin-meetings', () => {
66
59
  },
67
60
  },
68
61
  };
69
-
70
- sendBehavioralMetricStub = sinon.stub(Metrics, 'sendBehavioralMetric');
71
- });
72
-
73
- afterEach(() => {
74
- sinon.restore();
75
62
  });
76
63
 
77
64
  describe('#updateControls', () => {
@@ -79,12 +66,8 @@ describe('plugin-meetings', () => {
79
66
 
80
67
  beforeEach('setup new controls', () => {
81
68
  newControls = {
82
- disallowUnmute: {enabled: true},
83
69
  lock: {},
84
70
  meetingFull: {},
85
- muteOnEntry: {enabled: true},
86
- raiseHand: {enabled: true},
87
- reactions: {enabled: true, showDisplayNameWithReactions: true},
88
71
  record: {
89
72
  recording: false,
90
73
  paused: false,
@@ -93,14 +76,12 @@ describe('plugin-meetings', () => {
93
76
  modifiedBy: 'George Kittle',
94
77
  },
95
78
  },
96
- shareControl: {control: 'example-value'},
79
+ shareControl: {},
97
80
  transcribe: {},
98
- viewTheParticipantList: {enabled: true},
99
81
  meetingContainer: {
100
82
  meetingContainerUrl: 'http://new-url.com',
101
83
  },
102
84
  entryExitTone: {enabled: true, mode: 'foo'},
103
- video: {enabled: true},
104
85
  };
105
86
  });
106
87
 
@@ -114,97 +95,6 @@ describe('plugin-meetings', () => {
114
95
  assert.equal(locusInfo.controls, newControls);
115
96
  });
116
97
 
117
- it('should trigger the CONTROLS_MUTE_ON_ENTRY_CHANGED event when necessary', () => {
118
- locusInfo.controls = {};
119
- locusInfo.emitScoped = sinon.stub();
120
- locusInfo.updateControls(newControls);
121
-
122
- assert.calledWith(
123
- locusInfo.emitScoped,
124
- {file: 'locus-info', function: 'updateControls'},
125
- LOCUSINFO.EVENTS.CONTROLS_MUTE_ON_ENTRY_CHANGED,
126
- {state: newControls.muteOnEntry}
127
- );
128
- });
129
-
130
- it('should trigger the CONTROLS_SHARE_CONTROL_CHANGED event when necessary', () => {
131
- locusInfo.controls = {};
132
- locusInfo.emitScoped = sinon.stub();
133
- locusInfo.updateControls(newControls);
134
-
135
- assert.calledWith(
136
- locusInfo.emitScoped,
137
- {file: 'locus-info', function: 'updateControls'},
138
- LOCUSINFO.EVENTS.CONTROLS_SHARE_CONTROL_CHANGED,
139
- {state: newControls.shareControl}
140
- );
141
- });
142
-
143
- it('should trigger the CONTROLS_DISALLOW_UNMUTE_CHANGED event when necessary', () => {
144
- locusInfo.controls = {};
145
- locusInfo.emitScoped = sinon.stub();
146
- locusInfo.updateControls(newControls);
147
-
148
- assert.calledWith(
149
- locusInfo.emitScoped,
150
- {file: 'locus-info', function: 'updateControls'},
151
- LOCUSINFO.EVENTS.CONTROLS_DISALLOW_UNMUTE_CHANGED,
152
- {state: newControls.disallowUnmute}
153
- );
154
- });
155
-
156
- it('should trigger the CONTROLS_REACTIONS_CHANGED event when necessary', () => {
157
- locusInfo.controls = {};
158
- locusInfo.emitScoped = sinon.stub();
159
- locusInfo.updateControls(newControls);
160
-
161
- assert.calledWith(
162
- locusInfo.emitScoped,
163
- {file: 'locus-info', function: 'updateControls'},
164
- LOCUSINFO.EVENTS.CONTROLS_REACTIONS_CHANGED,
165
- {state: newControls.reactions}
166
- );
167
- });
168
-
169
- it('should trigger the CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED event when necessary', () => {
170
- locusInfo.controls = {};
171
- locusInfo.emitScoped = sinon.stub();
172
- locusInfo.updateControls(newControls);
173
-
174
- assert.calledWith(
175
- locusInfo.emitScoped,
176
- {file: 'locus-info', function: 'updateControls'},
177
- LOCUSINFO.EVENTS.CONTROLS_VIEW_THE_PARTICIPANTS_LIST_CHANGED,
178
- {state: newControls.viewTheParticipantList}
179
- );
180
- });
181
-
182
- it('should trigger the CONTROLS_RAISE_HAND_CHANGED event when necessary', () => {
183
- locusInfo.controls = {};
184
- locusInfo.emitScoped = sinon.stub();
185
- locusInfo.updateControls(newControls);
186
-
187
- assert.calledWith(
188
- locusInfo.emitScoped,
189
- {file: 'locus-info', function: 'updateControls'},
190
- LOCUSINFO.EVENTS.CONTROLS_RAISE_HAND_CHANGED,
191
- {state: newControls.raiseHand}
192
- );
193
- });
194
-
195
- it('should trigger the CONTROLS_VIDEO_CHANGED event when necessary', () => {
196
- locusInfo.controls = {};
197
- locusInfo.emitScoped = sinon.stub();
198
- locusInfo.updateControls(newControls);
199
-
200
- assert.calledWith(
201
- locusInfo.emitScoped,
202
- {file: 'locus-info', function: 'updateControls'},
203
- LOCUSINFO.EVENTS.CONTROLS_VIDEO_CHANGED,
204
- {state: newControls.video}
205
- );
206
- });
207
-
208
98
  it('should not trigger the CONTROLS_RECORDING_UPDATED event', () => {
209
99
  locusInfo.controls = {};
210
100
  locusInfo.emitScoped = sinon.stub();
@@ -387,48 +277,6 @@ describe('plugin-meetings', () => {
387
277
  );
388
278
  });
389
279
 
390
- it('should update the breakout state', () => {
391
- locusInfo.emitScoped = sinon.stub();
392
- let tmpStub = sinon.stub(SelfUtils, 'getReplacedBreakoutMoveId').returns('breakoutMoveId');
393
- newControls.breakout = {breakout: {}};
394
- let selfInfo = {};
395
-
396
- locusInfo.updateControls(newControls, selfInfo);
397
-
398
- assert.calledWith(
399
- locusInfo.emitScoped,
400
- {
401
- file: 'locus-info',
402
- function: 'updateControls',
403
- },
404
- LOCUSINFO.EVENTS.CONTROLS_MEETING_BREAKOUT_UPDATED,
405
- {
406
- breakout: newControls.breakout,
407
- }
408
- );
409
- tmpStub.restore();
410
- });
411
-
412
- it('should update the interpretation state', () => {
413
- locusInfo.emitScoped = sinon.stub();
414
- newControls.interpretation = {siLanguages: [{languageCode: 20, languageName: 'en'}]};
415
- let selfInfo = {};
416
-
417
- locusInfo.updateControls(newControls, selfInfo);
418
-
419
- assert.calledWith(
420
- locusInfo.emitScoped,
421
- {
422
- file: 'locus-info',
423
- function: 'updateControls',
424
- },
425
- LOCUSINFO.EVENTS.CONTROLS_MEETING_INTERPRETATION_UPDATED,
426
- {
427
- interpretation: newControls.interpretation,
428
- }
429
- );
430
- });
431
-
432
280
  it('should update the transcript state', () => {
433
281
  locusInfo.emitScoped = sinon.stub();
434
282
  locusInfo.controls = {
@@ -550,39 +398,6 @@ describe('plugin-meetings', () => {
550
398
  assert.notEqual(x.args[1], LOCUSINFO.EVENTS.CONTROLS_ENTRY_EXIT_TONE_UPDATED);
551
399
  });
552
400
  });
553
-
554
- it('should update videoEnabled when changed', () => {
555
- locusInfo.controls = {};
556
-
557
- locusInfo.emitScoped = sinon.stub();
558
- locusInfo.updateControls(newControls);
559
-
560
- assert.calledWith(
561
- locusInfo.emitScoped,
562
- {
563
- file: 'locus-info',
564
- function: 'updateControls',
565
- },
566
- LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
567
- {unmuteAllowed: true}
568
- );
569
-
570
- assert.equal(mockMeeting.unmuteVideoAllowed, true);
571
- });
572
-
573
- it('should not update videoEnabled when unchanged', () => {
574
- locusInfo.controls = {videoEnabled: true};
575
-
576
- locusInfo.emitScoped = sinon.stub();
577
- locusInfo.updateControls(newControls);
578
-
579
- locusInfo.emitScoped.getCalls().forEach((x) => {
580
- // check that no calls in emitScoped are for SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED
581
- assert.notEqual(x.args[1], LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED);
582
- });
583
-
584
- assert.equal(mockMeeting.unmuteVideoAllowed, undefined);
585
- });
586
401
  });
587
402
 
588
403
  describe('#updateParticipants()', () => {
@@ -636,7 +451,6 @@ describe('plugin-meetings', () => {
636
451
  selfIdentity: '123',
637
452
  selfId: '2',
638
453
  hostId: '3',
639
- isReplace: undefined,
640
454
  }
641
455
  );
642
456
  // note: in a real use case, recordingId, selfId, and hostId would all be the same
@@ -644,43 +458,6 @@ describe('plugin-meetings', () => {
644
458
  // are being correctly grabbed from locusInfo.parsedLocus within updateParticipants
645
459
  });
646
460
 
647
- it('should call with breakout control info', () => {
648
- locusInfo.parsedLocus = {
649
- controls: {
650
- record: {
651
- modifiedBy: '1',
652
- },
653
- },
654
- self: {
655
- selfIdentity: '123',
656
- selfId: '2',
657
- },
658
- host: {
659
- hostId: '3',
660
- },
661
- };
662
-
663
- locusInfo.emitScoped = sinon.stub();
664
- locusInfo.updateParticipants({}, true);
665
-
666
- assert.calledWith(
667
- locusInfo.emitScoped,
668
- {
669
- file: 'locus-info',
670
- function: 'updateParticipants',
671
- },
672
- EVENTS.LOCUS_INFO_UPDATE_PARTICIPANTS,
673
- {
674
- participants: {},
675
- recordingId: '1',
676
- selfIdentity: '123',
677
- selfId: '2',
678
- hostId: '3',
679
- isReplace: true,
680
- }
681
- );
682
- });
683
-
684
461
  it('should update the deltaParticipants object', () => {
685
462
  const prev = locusInfo.deltaParticipants;
686
463
 
@@ -887,122 +664,6 @@ describe('plugin-meetings', () => {
887
664
  );
888
665
  });
889
666
 
890
- describe('SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED', () => {
891
- it('should emit event when video muted on entry', () => {
892
- // usually "previous self" is just undefined when we get first self from locus
893
- locusInfo.self = undefined;
894
- const selfWithMutedByOthers = cloneDeep(self);
895
-
896
- // remoteVideoMuted
897
- selfWithMutedByOthers.controls.video.muted = true;
898
-
899
- locusInfo.webex.internal.device.url = self.deviceUrl;
900
- locusInfo.emitScoped = sinon.stub();
901
- locusInfo.updateSelf(selfWithMutedByOthers, []);
902
-
903
- assert.calledWith(
904
- locusInfo.emitScoped,
905
- {
906
- file: 'locus-info',
907
- function: 'updateSelf',
908
- },
909
- LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
910
- {muted: true}
911
- );
912
-
913
- // but sometimes "previous self" is defined, but without controls.audio.muted, so we test this here:
914
- locusInfo.self = cloneDeep(self);
915
- locusInfo.self.controls.video = {};
916
-
917
- locusInfo.updateSelf(selfWithMutedByOthers, []);
918
- assert.calledWith(
919
- locusInfo.emitScoped,
920
- {
921
- file: 'locus-info',
922
- function: 'updateSelf',
923
- },
924
- LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
925
- {muted: true}
926
- );
927
- });
928
-
929
- it('should not emit event when not muted on entry', () => {
930
- locusInfo.self = undefined;
931
- const selfWithMutedByOthersFalse = cloneDeep(self);
932
-
933
- selfWithMutedByOthersFalse.controls.video.muted = false;
934
-
935
- locusInfo.webex.internal.device.url = self.deviceUrl;
936
- locusInfo.emitScoped = sinon.stub();
937
- locusInfo.updateSelf(selfWithMutedByOthersFalse, []);
938
-
939
- // we might get some calls to emitScoped, but we need to check that none of them are for SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED
940
- locusInfo.emitScoped.getCalls().forEach((x) => {
941
- assert.notEqual(x.args[1], LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED);
942
- });
943
- });
944
-
945
- it('should emit event when remoteVideoMuted changed', () => {
946
- locusInfo.self = self;
947
- const selfWithMutedByOthers = cloneDeep(self);
948
-
949
- selfWithMutedByOthers.controls.video.muted = true;
950
-
951
- locusInfo.webex.internal.device.url = self.deviceUrl;
952
- locusInfo.emitScoped = sinon.stub();
953
- locusInfo.updateSelf(selfWithMutedByOthers, []);
954
-
955
- assert.calledWith(
956
- locusInfo.emitScoped,
957
- {
958
- file: 'locus-info',
959
- function: 'updateSelf',
960
- },
961
- LOCUSINFO.EVENTS.SELF_REMOTE_VIDEO_MUTE_STATUS_UPDATED,
962
- {muted: true}
963
- );
964
- });
965
- });
966
-
967
- it('should trigger SELF_MEETING_BREAKOUTS_CHANGED when breakouts changed', () => {
968
- locusInfo.self = self;
969
- const selfWithBreakoutsChanged = cloneDeep(self);
970
-
971
- selfWithBreakoutsChanged.controls.breakout.sessions.active[0].name = 'new name';
972
-
973
- locusInfo.emitScoped = sinon.stub();
974
- locusInfo.updateSelf(selfWithBreakoutsChanged, []);
975
-
976
- assert.calledWith(
977
- locusInfo.emitScoped,
978
- {
979
- file: 'locus-info',
980
- function: 'updateSelf',
981
- },
982
- LOCUSINFO.EVENTS.SELF_MEETING_BREAKOUTS_CHANGED,
983
- {
984
- breakoutSessions: {
985
- active: [
986
- {
987
- name: 'new name',
988
- groupId: '0e73abb8-5584-49d8-be8d-806d2a8247ca',
989
- sessionId: '1cf41ab1-2e57-4d95-b7e9-5613acddfb0f',
990
- sessionType: 'BREAKOUT',
991
- },
992
- ],
993
- allowed: [
994
- {
995
- name: 'Breakout session 2',
996
- groupId: '0e73abb8-5584-49d8-be8d-806d2a8247ca',
997
- sessionId: '1cf41ab1-2e57-4d95-b7e9-5613acddfb0f',
998
- sessionType: 'BREAKOUT',
999
- },
1000
- ],
1001
- },
1002
- }
1003
- );
1004
- });
1005
-
1006
667
  it('should trigger SELF_REMOTE_MUTE_STATUS_UPDATED if muted and disallowUnmute changed', () => {
1007
668
  locusInfo.self = self;
1008
669
  const selfWithMutedByOthersAndDissalowUnmute = cloneDeep(self);
@@ -1074,8 +735,6 @@ describe('plugin-meetings', () => {
1074
735
  const selfWithRequestedToUnmute = cloneDeep(self);
1075
736
 
1076
737
  selfWithRequestedToUnmute.controls.audio.requestedToUnmute = true;
1077
- selfWithRequestedToUnmute.controls.audio.lastModifiedRequestedToUnmute =
1078
- '2023-06-16T19:25:04.369Z';
1079
738
 
1080
739
  locusInfo.webex.internal.device.url = self.deviceUrl;
1081
740
  locusInfo.emitScoped = sinon.stub();
@@ -1230,88 +889,6 @@ describe('plugin-meetings', () => {
1230
889
  {isSharingBlocked: true}
1231
890
  );
1232
891
  });
1233
-
1234
- it('should trigger SELF_ROLES_CHANGED if self roles changed', () => {
1235
- locusInfo.self = self;
1236
- locusInfo.emitScoped = sinon.stub();
1237
- const sampleNewSelf = cloneDeep(self);
1238
- sampleNewSelf.controls.role.roles = [{type: 'COHOST', hasRole: true}];
1239
-
1240
- locusInfo.updateSelf(sampleNewSelf, []);
1241
-
1242
- assert.calledWith(
1243
- locusInfo.emitScoped,
1244
- {
1245
- file: 'locus-info',
1246
- function: 'updateSelf',
1247
- },
1248
- LOCUSINFO.EVENTS.SELF_ROLES_CHANGED,
1249
- {oldRoles: ['PRESENTER'], newRoles: ['COHOST']}
1250
- );
1251
- });
1252
-
1253
- it('should not trigger SELF_ROLES_CHANGED if self roles not changed', () => {
1254
- locusInfo.self = self;
1255
- locusInfo.emitScoped = sinon.stub();
1256
- const sampleNewSelf = cloneDeep(self);
1257
- sampleNewSelf.controls.role.roles = [{type: 'PRESENTER', hasRole: true}];
1258
-
1259
- locusInfo.updateSelf(sampleNewSelf, []);
1260
-
1261
- assert.neverCalledWith(
1262
- locusInfo.emitScoped,
1263
- {
1264
- file: 'locus-info',
1265
- function: 'updateSelf',
1266
- },
1267
- LOCUSINFO.EVENTS.SELF_ROLES_CHANGED,
1268
- {oldRoles: ['PRESENTER'], newRoles: ['PRESENTER']}
1269
- );
1270
- });
1271
-
1272
- it('should trigger SELF_MEETING_INTERPRETATION_CHANGED if self interpretation info changed', () => {
1273
- locusInfo.self = self;
1274
- locusInfo.emitScoped = sinon.stub();
1275
- const sampleNewSelf = cloneDeep(self);
1276
- sampleNewSelf.controls.interpretation.targetLanguage = 'it';
1277
-
1278
- locusInfo.updateSelf(sampleNewSelf, []);
1279
-
1280
- assert.calledWith(
1281
- locusInfo.emitScoped,
1282
- {
1283
- file: 'locus-info',
1284
- function: 'updateSelf',
1285
- },
1286
- LOCUSINFO.EVENTS.SELF_MEETING_INTERPRETATION_CHANGED,
1287
- {
1288
- interpretation: sampleNewSelf.controls.interpretation,
1289
- selfParticipantId: self.id,
1290
- }
1291
- );
1292
- });
1293
-
1294
- it('should not trigger SELF_MEETING_INTERPRETATION_CHANGED if self interpretation info not changed', () => {
1295
- locusInfo.self = self;
1296
- locusInfo.emitScoped = sinon.stub();
1297
- const sampleNewSelf = cloneDeep(self);
1298
- sampleNewSelf.controls.interpretation.targetLanguage = 'cn'; // same with previous one
1299
-
1300
- locusInfo.updateSelf(sampleNewSelf, []);
1301
-
1302
- assert.neverCalledWith(
1303
- locusInfo.emitScoped,
1304
- {
1305
- file: 'locus-info',
1306
- function: 'updateSelf',
1307
- },
1308
- LOCUSINFO.EVENTS.SELF_MEETING_INTERPRETATION_CHANGED,
1309
- {
1310
- interpretation: sampleNewSelf.controls.interpretation,
1311
- selfParticipantId: self.id,
1312
- }
1313
- );
1314
- });
1315
892
  });
1316
893
 
1317
894
  describe('#updateMeetingInfo', () => {
@@ -1385,6 +962,7 @@ describe('plugin-meetings', () => {
1385
962
  function: 'updateMeetingInfo',
1386
963
  },
1387
964
  LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
965
+ {info: locusInfo.parsedLocus.info, self},
1388
966
  ];
1389
967
 
1390
968
  if (expected) {
@@ -1395,58 +973,15 @@ describe('plugin-meetings', () => {
1395
973
  locusInfo.emitScoped.resetHistory();
1396
974
  };
1397
975
 
1398
- const checkMeetingInfoUpdatedCalledForRoles = (expected) => {
1399
- const expectedArgs = [
1400
- locusInfo.emitScoped,
1401
- {
1402
- file: 'locus-info',
1403
- function: 'updateMeetingInfo',
1404
- },
1405
- LOCUSINFO.EVENTS.MEETING_INFO_UPDATED,
1406
- ];
1407
-
1408
- if (expected) {
1409
- assert.calledWith(...expectedArgs);
1410
- } else {
1411
- assert.neverCalledWith(...expectedArgs);
1412
- }
1413
- locusInfo.emitScoped.resetHistory();
1414
- };
1415
-
1416
- it('emits MEETING_INFO_UPDATED and updates the meeting if the info changes', () => {
1417
- const initialInfo = cloneDeep(meetingInfo);
1418
-
1419
- let expectedMeeting;
1420
-
1421
- /*
1422
- When the event is triggered, it is required that the meeting has already
1423
- been updated. This is why the meeting is being checked within the stubbed event emitter
1424
- */
1425
- sinon.stub(locusInfo, 'emitScoped').callsFake(() => {
1426
- assert.deepEqual(mockMeeting, expectedMeeting);
1427
- })
976
+ it('emits MEETING_INFO_UPDATED if the info changes', () => {
977
+ const initialInfo = cloneDeep(meetingInfo);
1428
978
 
979
+ locusInfo.emitScoped = sinon.stub();
1429
980
 
1430
981
  // set the info initially as locusInfo.info starts as undefined
1431
- expectedMeeting = {
1432
- coHost: {
1433
- LOWER_SOMEONE_ELSES_HAND: true,
1434
- },
1435
- isLocked: false,
1436
- isUnlocked: true,
1437
- moderator: {
1438
- LOWER_SOMEONE_ELSES_HAND: true,
1439
- },
1440
- policy: {
1441
- LOCK_STATUS_UNLOCKED: true,
1442
- ROSTER_IN_MEETING: true,
1443
- },
1444
- userDisplayHints: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED'],
1445
- };
1446
982
  locusInfo.updateMeetingInfo(initialInfo, self);
1447
983
 
1448
984
  // since it was initially undefined, this should trigger the event
1449
-
1450
985
  checkMeetingInfoUpdatedCalled(true);
1451
986
 
1452
987
  const newInfo = cloneDeep(meetingInfo);
@@ -1454,78 +989,15 @@ describe('plugin-meetings', () => {
1454
989
  newInfo.displayHints.coHost = [DISPLAY_HINTS.LOCK_CONTROL_LOCK];
1455
990
 
1456
991
  // Updating with different info should trigger the event
1457
- expectedMeeting = {
1458
- coHost: {
1459
- LOWER_SOMEONE_ELSES_HAND: true,
1460
- LOCK_CONTROL_LOCK: true,
1461
- },
1462
- isLocked: false,
1463
- isUnlocked: true,
1464
- moderator: {
1465
- LOWER_SOMEONE_ELSES_HAND: true,
1466
- },
1467
- policy: {
1468
- LOCK_STATUS_UNLOCKED: true,
1469
- ROSTER_IN_MEETING: true,
1470
- },
1471
- userDisplayHints: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED'],
1472
- };
1473
992
  locusInfo.updateMeetingInfo(newInfo, self);
1474
993
 
1475
994
  checkMeetingInfoUpdatedCalled(true);
1476
995
 
1477
996
  // update it with the same info
1478
- expectedMeeting = {
1479
- coHost: {
1480
- LOWER_SOMEONE_ELSES_HAND: true,
1481
- LOCK_CONTROL_LOCK: true,
1482
- },
1483
- isLocked: false,
1484
- isUnlocked: true,
1485
- moderator: {
1486
- LOWER_SOMEONE_ELSES_HAND: true,
1487
- },
1488
- policy: {
1489
- LOCK_STATUS_UNLOCKED: true,
1490
- ROSTER_IN_MEETING: true,
1491
- },
1492
- userDisplayHints: ['ROSTER_IN_MEETING', 'LOCK_STATUS_UNLOCKED'],
1493
- };
1494
997
  locusInfo.updateMeetingInfo(newInfo, self);
1495
998
 
1496
999
  // since the info is the same it should not call trigger the event
1497
1000
  checkMeetingInfoUpdatedCalled(false);
1498
-
1499
- // update it with the same info, but roles changed
1500
- const updateSelf = cloneDeep(self);
1501
- updateSelf?.controls?.role?.roles.push({
1502
- type: 'COHOST',
1503
- hasRole: true,
1504
- });
1505
- expectedMeeting = {
1506
- coHost: {
1507
- LOWER_SOMEONE_ELSES_HAND: true,
1508
- LOCK_CONTROL_LOCK: true,
1509
- },
1510
- isLocked: false,
1511
- isUnlocked: true,
1512
- moderator: {
1513
- LOWER_SOMEONE_ELSES_HAND: true,
1514
- },
1515
- policy: {
1516
- LOCK_STATUS_UNLOCKED: true,
1517
- ROSTER_IN_MEETING: true,
1518
- },
1519
- userDisplayHints: [
1520
- 'ROSTER_IN_MEETING',
1521
- 'LOCK_STATUS_UNLOCKED',
1522
- 'LOCK_CONTROL_LOCK',
1523
- 'LOWER_SOMEONE_ELSES_HAND',
1524
- ],
1525
- };
1526
- locusInfo.updateMeetingInfo(newInfo, updateSelf);
1527
- // since the info is the same but roles changed, it should call trigger the event
1528
- checkMeetingInfoUpdatedCalledForRoles(true);
1529
1001
  });
1530
1002
 
1531
1003
  it('gets roles from self if available', () => {
@@ -1631,8 +1103,6 @@ describe('plugin-meetings', () => {
1631
1103
  fakeLocus = {
1632
1104
  meeting: true,
1633
1105
  participants: true,
1634
- url: 'newLocusUrl',
1635
- syncUrl: 'newSyncUrl',
1636
1106
  };
1637
1107
  });
1638
1108
 
@@ -1677,55 +1147,6 @@ describe('plugin-meetings', () => {
1677
1147
  assert.isFunction(locusParser.onDeltaAction);
1678
1148
  });
1679
1149
 
1680
- it('#updateLocusInfo ignores breakout LEFT message', () => {
1681
- const newLocus = {
1682
- self: {
1683
- reason: 'MOVED',
1684
- state: 'LEFT',
1685
- },
1686
- };
1687
-
1688
- locusInfo.updateControls = sinon.stub();
1689
- locusInfo.updateConversationUrl = sinon.stub();
1690
- locusInfo.updateCreated = sinon.stub();
1691
- locusInfo.updateFullState = sinon.stub();
1692
- locusInfo.updateHostInfo = sinon.stub();
1693
- locusInfo.updateMeetingInfo = sinon.stub();
1694
- locusInfo.updateMediaShares = sinon.stub();
1695
- locusInfo.updateParticipantsUrl = sinon.stub();
1696
- locusInfo.updateReplace = sinon.stub();
1697
- locusInfo.updateSelf = sinon.stub();
1698
- locusInfo.updateLocusUrl = sinon.stub();
1699
- locusInfo.updateAclUrl = sinon.stub();
1700
- locusInfo.updateBasequence = sinon.stub();
1701
- locusInfo.updateSequence = sinon.stub();
1702
- locusInfo.updateMemberShip = sinon.stub();
1703
- locusInfo.updateIdentifiers = sinon.stub();
1704
- locusInfo.updateEmbeddedApps = sinon.stub();
1705
- locusInfo.compareAndUpdate = sinon.stub();
1706
-
1707
- locusInfo.updateLocusInfo(newLocus);
1708
-
1709
- assert.notCalled(locusInfo.updateControls);
1710
- assert.notCalled(locusInfo.updateConversationUrl);
1711
- assert.notCalled(locusInfo.updateCreated);
1712
- assert.notCalled(locusInfo.updateFullState);
1713
- assert.notCalled(locusInfo.updateHostInfo);
1714
- assert.notCalled(locusInfo.updateMeetingInfo);
1715
- assert.notCalled(locusInfo.updateMediaShares);
1716
- assert.notCalled(locusInfo.updateParticipantsUrl);
1717
- assert.notCalled(locusInfo.updateReplace);
1718
- assert.notCalled(locusInfo.updateSelf);
1719
- assert.notCalled(locusInfo.updateLocusUrl);
1720
- assert.notCalled(locusInfo.updateAclUrl);
1721
- assert.notCalled(locusInfo.updateBasequence);
1722
- assert.notCalled(locusInfo.updateSequence);
1723
- assert.notCalled(locusInfo.updateMemberShip);
1724
- assert.notCalled(locusInfo.updateIdentifiers);
1725
- assert.notCalled(locusInfo.updateEmbeddedApps);
1726
- assert.notCalled(locusInfo.compareAndUpdate);
1727
- });
1728
-
1729
1150
  it('onFullLocus() updates the working-copy of locus parser', () => {
1730
1151
  const eventType = 'fakeEvent';
1731
1152
 
@@ -1734,39 +1155,12 @@ describe('plugin-meetings', () => {
1734
1155
  sandbox.stub(locusInfo, 'updateParticipants');
1735
1156
  sandbox.stub(locusInfo, 'isMeetingActive');
1736
1157
  sandbox.stub(locusInfo, 'handleOneOnOneEvent');
1737
- sandbox.stub(locusParser, 'isNewFullLocus').returns(true);
1738
1158
 
1739
1159
  locusInfo.onFullLocus(fakeLocus, eventType);
1740
1160
 
1741
1161
  assert.equal(fakeLocus, locusParser.workingCopy);
1742
1162
  });
1743
1163
 
1744
- it('onFullLocus() does not do anything if the incoming full locus DTO is old', () => {
1745
- const eventType = 'fakeEvent';
1746
-
1747
- locusParser.workingCopy = {};
1748
-
1749
- const oldWorkingCopy = locusParser.workingCopy;
1750
-
1751
- const spies = [
1752
- sandbox.stub(locusInfo, 'updateParticipantDeltas'),
1753
- sandbox.stub(locusInfo, 'updateLocusInfo'),
1754
- sandbox.stub(locusInfo, 'updateParticipants'),
1755
- sandbox.stub(locusInfo, 'isMeetingActive'),
1756
- sandbox.stub(locusInfo, 'handleOneOnOneEvent'),
1757
- ];
1758
-
1759
- sandbox.stub(locusParser, 'isNewFullLocus').returns(false);
1760
-
1761
- locusInfo.onFullLocus(fakeLocus, eventType);
1762
-
1763
- spies.forEach((spy) => {
1764
- assert.notCalled(spy);
1765
- });
1766
-
1767
- assert.equal(oldWorkingCopy, locusParser.workingCopy);
1768
- });
1769
-
1770
1164
  it('onDeltaAction applies locus delta data to meeting', () => {
1771
1165
  const action = 'fake action';
1772
1166
  const parsedLoci = 'fake loci';
@@ -1793,82 +1187,33 @@ describe('plugin-meetings', () => {
1793
1187
  assert.calledWith(meeting.locusInfo.onDeltaLocus, fakeLocus);
1794
1188
  });
1795
1189
 
1796
- it('applyLocusDeltaData gets delta locus on DESYNC action if we have a syncUrl', () => {
1190
+ it('applyLocusDeltaData gets full locus on DESYNC action', () => {
1797
1191
  const {DESYNC} = LocusDeltaParser.loci;
1798
- const fakeDeltaLocus = {id: 'fake delta locus'};
1799
1192
  const meeting = {
1800
1193
  meetingRequest: {
1801
- getLocusDTO: sandbox.stub().resolves({body: fakeDeltaLocus}),
1194
+ getFullLocus: sandbox.stub().resolves(true),
1802
1195
  },
1803
1196
  locusInfo: {
1804
- handleLocusDelta: sandbox.stub(),
1805
- },
1806
- locusUrl: 'oldLocusUrl',
1807
- };
1808
-
1809
- locusInfo.locusParser.workingCopy = {
1810
- syncUrl: 'oldSyncUrl',
1811
- };
1812
-
1813
- // Since we have a promise inside a function we want to test that's not returned,
1814
- // we will wait and stub it's last function to resolve this waiting promise.
1815
- // Also ensures .handleLocusDelta() is called before .resume()
1816
- return new Promise((resolve) => {
1817
- locusInfo.locusParser.resume = sandbox.stub().callsFake(() => resolve());
1818
- locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1819
- }).then(() => {
1820
- assert.calledOnceWithExactly(meeting.meetingRequest.getLocusDTO, {url: 'oldSyncUrl'});
1821
-
1822
- assert.calledOnceWithExactly(meeting.locusInfo.handleLocusDelta, fakeDeltaLocus, meeting);
1823
- assert.calledOnce(locusInfo.locusParser.resume);
1824
- });
1825
- });
1826
-
1827
- it('applyLocusDeltaData gets delta locus on DESYNC action if we have a syncUrl (empty response body)', () => {
1828
- const {DESYNC} = LocusDeltaParser.loci;
1829
- const meeting = {
1830
- meetingRequest: {
1831
- getLocusDTO: sandbox.stub().resolves({body: {}}),
1832
- },
1833
- locusInfo: {
1834
- handleLocusDelta: sandbox.stub(),
1835
1197
  onFullLocus: sandbox.stub(),
1836
1198
  },
1837
- locusUrl: 'oldLocusUrl',
1838
1199
  };
1839
1200
 
1840
- locusInfo.locusParser.workingCopy = {
1841
- syncUrl: 'oldSyncUrl',
1842
- };
1201
+ locusInfo.locusParser.resume = sandbox.stub();
1202
+ locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1843
1203
 
1844
- // Since we have a promise inside a function we want to test that's not returned,
1845
- // we will wait and stub it's last function to resolve this waiting promise.
1846
- return new Promise((resolve) => {
1847
- locusInfo.locusParser.resume = sandbox.stub().callsFake(() => resolve());
1848
- locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1849
- }).then(() => {
1850
- assert.calledOnceWithExactly(meeting.meetingRequest.getLocusDTO, {url: 'oldSyncUrl'});
1851
-
1852
- assert.notCalled(meeting.locusInfo.handleLocusDelta);
1853
- assert.notCalled(meeting.locusInfo.onFullLocus);
1854
- assert.calledOnce(locusInfo.locusParser.resume);
1855
- });
1204
+ assert.calledOnce(meeting.meetingRequest.getFullLocus);
1856
1205
  });
1857
1206
 
1858
- it('applyLocusDeltaData gets full locus on DESYNC action if we do not have a syncUrl', () => {
1207
+ it('getFullLocus handles DESYNC action correctly', () => {
1859
1208
  const {DESYNC} = LocusDeltaParser.loci;
1860
- const fakeFullLocusDto = {id: 'fake full locus dto'};
1861
1209
  const meeting = {
1862
1210
  meetingRequest: {
1863
- getLocusDTO: sandbox.stub().resolves({body: fakeFullLocusDto}),
1211
+ getFullLocus: sandbox.stub().resolves({body: true}),
1864
1212
  },
1865
- locusInfo: {
1866
- onFullLocus: sandbox.stub(),
1867
- },
1868
- locusUrl: 'oldLocusUrl',
1213
+ locusInfo,
1869
1214
  };
1870
1215
 
1871
- locusInfo.locusParser.workingCopy = {}; // no syncUrl
1216
+ locusInfo.onFullLocus = sandbox.stub();
1872
1217
 
1873
1218
  // Since we have a promise inside a function we want to test that's not returned,
1874
1219
  // we will wait and stub it's last function to resolve this waiting promise.
@@ -1877,378 +1222,10 @@ describe('plugin-meetings', () => {
1877
1222
  locusInfo.locusParser.resume = sandbox.stub().callsFake(() => resolve());
1878
1223
  locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1879
1224
  }).then(() => {
1880
- assert.calledOnceWithExactly(meeting.meetingRequest.getLocusDTO, {url: 'oldLocusUrl'});
1881
-
1882
- assert.calledOnceWithExactly(meeting.locusInfo.onFullLocus, fakeFullLocusDto);
1225
+ assert.calledOnce(meeting.locusInfo.onFullLocus);
1883
1226
  assert.calledOnce(locusInfo.locusParser.resume);
1884
1227
  });
1885
1228
  });
1886
-
1887
- it('applyLocusDeltaData handles LOCUS_URL_CHANGED action correctly', () => {
1888
- const {LOCUS_URL_CHANGED} = LocusDeltaParser.loci;
1889
- const fakeDeltaLocus = {id: 'fake delta locus'};
1890
- const meeting = {
1891
- meetingRequest: {
1892
- getLocusDTO: sandbox.stub().resolves({body: fakeDeltaLocus}),
1893
- },
1894
- locusInfo: {
1895
- handleLocusDelta: sandbox.stub(),
1896
- },
1897
- locusUrl: 'current locus url',
1898
- };
1899
-
1900
- locusInfo.locusParser.workingCopy = {
1901
- syncUrl: 'current sync url',
1902
- };
1903
-
1904
- locusInfo.applyLocusDeltaData(LOCUS_URL_CHANGED, fakeLocus, meeting);
1905
- assert.calledOnceWithExactly(meeting.meetingRequest.getLocusDTO, {url: 'current sync url'});
1906
- });
1907
-
1908
- describe('edge cases for sync failing', () => {
1909
- const {DESYNC} = LocusDeltaParser.loci;
1910
- const fakeFullLocusDto = {id: 'fake full locus dto'};
1911
- let meeting;
1912
-
1913
- beforeEach(() => {
1914
- sinon.stub(locusInfo.locusParser, 'resume');
1915
- sinon.stub(webex.meetings, 'destroy');
1916
-
1917
- meeting = {
1918
- meetingRequest: {
1919
- getLocusDTO: sandbox.stub(),
1920
- },
1921
- locusInfo: {
1922
- handleLocusDelta: sandbox.stub(),
1923
- onFullLocus: sandbox.stub(),
1924
- },
1925
- locusUrl: 'fullSyncUrl',
1926
- };
1927
-
1928
- locusInfo.locusParser.workingCopy = {
1929
- syncUrl: 'deltaSyncUrl',
1930
- };
1931
- });
1932
-
1933
- it('applyLocusDeltaData gets full locus on DESYNC action if we do not have a syncUrl and destroys the meeting if that fails', () => {
1934
- meeting.meetingRequest.getLocusDTO.rejects(new Error('fake error'));
1935
-
1936
- locusInfo.locusParser.workingCopy = {}; // no syncUrl
1937
-
1938
- // Since we have a promise inside a function we want to test that's not returned,
1939
- // we will wait and stub it's last function to resolve this waiting promise.
1940
- return new Promise((resolve) => {
1941
- webex.meetings.destroy.callsFake(() => resolve());
1942
- locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1943
- }).then(() => {
1944
- assert.calledOnceWithExactly(meeting.meetingRequest.getLocusDTO, {url: 'fullSyncUrl'});
1945
-
1946
- assert.notCalled(meeting.locusInfo.handleLocusDelta);
1947
- assert.notCalled(meeting.locusInfo.onFullLocus);
1948
- assert.notCalled(locusInfo.locusParser.resume);
1949
-
1950
- assert.calledOnceWithExactly(webex.meetings.destroy, meeting, 'LOCUS_DTO_SYNC_FAILED');
1951
- });
1952
- });
1953
-
1954
- it('applyLocusDeltaData first tries a delta sync on DESYNC action and if that fails, does a full locus sync', () => {
1955
- meeting.meetingRequest.getLocusDTO.onCall(0).rejects(new Error('fake error'));
1956
- meeting.meetingRequest.getLocusDTO.onCall(1).resolves({body: fakeFullLocusDto});
1957
-
1958
- // Since we have a promise inside a function we want to test that's not returned,
1959
- // we will wait and stub it's last function to resolve this waiting promise.
1960
- return new Promise((resolve) => {
1961
- locusInfo.locusParser.resume.callsFake(() => resolve());
1962
- locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1963
- }).then(() => {
1964
- assert.calledTwice(meeting.meetingRequest.getLocusDTO);
1965
-
1966
- assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[0].args, [{url: 'deltaSyncUrl'}]);
1967
- assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[1].args, [{url: 'fullSyncUrl'}]);
1968
-
1969
- assert.calledWith(sendBehavioralMetricStub, 'js_sdk_locus_delta_sync_failed', {
1970
- correlationId: meeting.correlationId,
1971
- url: 'deltaSyncUrl',
1972
- reason: 'fake error',
1973
- errorName: 'Error',
1974
- stack: sinon.match.any,
1975
- code: sinon.match.any,
1976
- });
1977
-
1978
- assert.notCalled(meeting.locusInfo.handleLocusDelta);
1979
- assert.calledOnceWithExactly(meeting.locusInfo.onFullLocus, fakeFullLocusDto);
1980
- assert.calledOnce(locusInfo.locusParser.resume);
1981
- });
1982
- });
1983
-
1984
- it('applyLocusDeltaData destroys the meeting if both delta sync and full sync fail', () => {
1985
- meeting.meetingRequest.getLocusDTO.rejects(new Error('fake error'));
1986
-
1987
- // Since we have a promise inside a function we want to test that's not returned,
1988
- // we will wait and stub it's last function to resolve this waiting promise.
1989
- return new Promise((resolve) => {
1990
- webex.meetings.destroy.callsFake(() => resolve());
1991
- locusInfo.applyLocusDeltaData(DESYNC, fakeLocus, meeting);
1992
- }).then(() => {
1993
- assert.calledTwice(meeting.meetingRequest.getLocusDTO);
1994
-
1995
- assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[0].args, [{url: 'deltaSyncUrl'}]);
1996
- assert.deepEqual(meeting.meetingRequest.getLocusDTO.getCalls()[1].args, [{url: 'fullSyncUrl'}]);
1997
-
1998
- assert.calledWith(sendBehavioralMetricStub, 'js_sdk_locus_delta_sync_failed', {
1999
- correlationId: meeting.correlationId,
2000
- url: 'deltaSyncUrl',
2001
- reason: 'fake error',
2002
- errorName: 'Error',
2003
- stack: sinon.match.any,
2004
- code: sinon.match.any,
2005
- });
2006
-
2007
- assert.notCalled(meeting.locusInfo.handleLocusDelta);
2008
- assert.notCalled(meeting.locusInfo.onFullLocus);
2009
- assert.notCalled(locusInfo.locusParser.resume);
2010
-
2011
- assert.calledOnceWithExactly(webex.meetings.destroy, meeting, 'LOCUS_DTO_SYNC_FAILED');
2012
- });
2013
- });
2014
- });
2015
-
2016
- it('onDeltaLocus handle delta data', () => {
2017
- fakeLocus.participants = {};
2018
- const fakeBreakout = {
2019
- sessionId: 'sessionId',
2020
- groupId: 'groupId',
2021
- };
2022
-
2023
- fakeLocus.controls = {
2024
- breakout: fakeBreakout,
2025
- };
2026
- locusInfo.controls = {
2027
- breakout: {
2028
- sessionId: 'sessionId',
2029
- groupId: 'groupId',
2030
- },
2031
- };
2032
- locusInfo.updateParticipants = sinon.stub();
2033
- locusInfo.onDeltaLocus(fakeLocus);
2034
- assert.calledWith(locusInfo.updateParticipants, {}, false);
2035
-
2036
- fakeLocus.controls.breakout.sessionId = 'sessionId2';
2037
- locusInfo.onDeltaLocus(fakeLocus);
2038
- assert.calledWith(locusInfo.updateParticipants, {}, true);
2039
- });
2040
- });
2041
-
2042
- describe('#updateLocusCache', () => {
2043
- it('cache it if income locus is main session locus', () => {
2044
- const locus = {url: 'url'};
2045
- locusInfo.mainSessionLocusCache = null;
2046
- locusInfo.updateLocusCache(locus);
2047
-
2048
- assert.deepEqual(locusInfo.mainSessionLocusCache, locus);
2049
- });
2050
-
2051
- it('not cache it if income locus is breakout session locus', () => {
2052
- const locus = {url: 'url', controls: {breakout: {sessionType: 'BREAKOUT'}}};
2053
- locusInfo.mainSessionLocusCache = null;
2054
- locusInfo.updateLocusCache(locus);
2055
-
2056
- assert.isNull(locusInfo.mainSessionLocusCache);
2057
- });
2058
- });
2059
-
2060
- describe('#getTheLocusToUpdate', () => {
2061
- it('return the cache locus if return to main session and do not clear main session cache', () => {
2062
- locusInfo.mainSessionLocusCache = {url: 'url'};
2063
- locusInfo.controls = {
2064
- breakout: {
2065
- sessionType: 'BREAKOUT',
2066
- },
2067
- };
2068
- const newLocus = {
2069
- controls: {
2070
- breakout: {
2071
- sessionType: 'MAIN',
2072
- },
2073
- },
2074
- };
2075
-
2076
- assert.deepEqual(locusInfo.getTheLocusToUpdate(newLocus), {url: 'url'});
2077
-
2078
- locusInfo.clearMainSessionLocusCache = sinon.stub();
2079
- locusInfo.getTheLocusToUpdate(newLocus);
2080
- assert.notCalled(locusInfo.clearMainSessionLocusCache)
2081
- });
2082
-
2083
- it('return the new locus if return to main session but no cache and do not clear main session cache', () => {
2084
- locusInfo.mainSessionLocusCache = null;
2085
- locusInfo.controls = {
2086
- breakout: {
2087
- sessionType: 'BREAKOUT',
2088
- },
2089
- };
2090
- const newLocus = {
2091
- controls: {
2092
- breakout: {
2093
- sessionType: 'MAIN',
2094
- },
2095
- },
2096
- };
2097
-
2098
- assert.deepEqual(locusInfo.getTheLocusToUpdate(newLocus), newLocus);
2099
-
2100
- locusInfo.clearMainSessionLocusCache = sinon.stub();
2101
- locusInfo.getTheLocusToUpdate(newLocus);
2102
- assert.notCalled(locusInfo.clearMainSessionLocusCache)
2103
- });
2104
-
2105
- it('return the new locus if not return to main session and clear main session cache', () => {
2106
- locusInfo.mainSessionLocusCache = {
2107
- controls: {
2108
- breakout: {
2109
- sessionType: 'MAIN',
2110
- },
2111
- },
2112
- self: {removed: true}
2113
- };
2114
- locusInfo.fullState = {state: 'ACTIVE'}
2115
- locusInfo.controls = {
2116
- breakout: {
2117
- sessionType: 'MAIN',
2118
- },
2119
- };
2120
- const newLocus = {
2121
- controls: {
2122
- breakout: {
2123
- sessionType: 'BREAKOUT',
2124
- },
2125
- },
2126
- };
2127
-
2128
- locusInfo.clearMainSessionLocusCache = sinon.stub();
2129
- const result = locusInfo.getTheLocusToUpdate(newLocus);
2130
- assert.calledOnce(locusInfo.clearMainSessionLocusCache)
2131
-
2132
- assert.deepEqual(result, newLocus);
2133
- });
2134
-
2135
- it('do not clear main session cache when "mainSessionLocusCache?.self?.removed" is not true', () => {
2136
- locusInfo.mainSessionLocusCache = {
2137
- controls: {
2138
- breakout: {
2139
- sessionType: 'MAIN',
2140
- },
2141
- },
2142
- self: {removed: undefined}
2143
- };
2144
- locusInfo.fullState = {state: 'ACTIVE'}
2145
- locusInfo.controls = {
2146
- breakout: {
2147
- sessionType: 'MAIN',
2148
- },
2149
- };
2150
- const newLocus = {
2151
- controls: {
2152
- breakout: {
2153
- sessionType: 'BREAKOUT',
2154
- },
2155
- },
2156
- };
2157
-
2158
- locusInfo.clearMainSessionLocusCache = sinon.stub();
2159
- locusInfo.getTheLocusToUpdate(newLocus);
2160
- assert.notCalled(locusInfo.clearMainSessionLocusCache)
2161
- });
2162
- });
2163
-
2164
- describe('#mergeParticipants', () => {
2165
- let participants;
2166
- let sourceParticipants;
2167
- beforeEach(() => {
2168
- participants = [{id: '111', status: 'JOINED'}, {id: '222'}];
2169
- sourceParticipants = [{id: '111', status: 'LEFT'}, {id: '333'}];
2170
- });
2171
-
2172
- it('merge the participants, replace it by id if exist in old array', () => {
2173
- const result = locusInfo.mergeParticipants(participants, sourceParticipants);
2174
- assert.deepEqual(result, [{id: '111', status: 'LEFT'}, {id: '222'}, {id: '333'}]);
2175
- });
2176
-
2177
- it('return new participants if previous participants is empty', () => {
2178
- const result = locusInfo.mergeParticipants([], sourceParticipants);
2179
- assert.deepEqual(result, sourceParticipants);
2180
- });
2181
-
2182
- it('return new participants if previous participants is null/undefined', () => {
2183
- let result = locusInfo.mergeParticipants(null, sourceParticipants);
2184
- assert.deepEqual(result, sourceParticipants);
2185
-
2186
- result = locusInfo.mergeParticipants(undefined, sourceParticipants);
2187
- assert.deepEqual(result, sourceParticipants);
2188
- });
2189
-
2190
- it('return previous participants if new participants is empty', () => {
2191
- const result = locusInfo.mergeParticipants(participants, []);
2192
- assert.deepEqual(result, participants);
2193
- });
2194
-
2195
- it('return previous participants if new participants is null/undefined', () => {
2196
- let result = locusInfo.mergeParticipants(participants, null);
2197
- assert.deepEqual(result, participants);
2198
-
2199
- result = locusInfo.mergeParticipants(participants, undefined);
2200
- assert.deepEqual(result, participants);
2201
- });
2202
- });
2203
-
2204
- describe('#updateMainSessionLocusCache', () => {
2205
- let cachedLocus;
2206
- let newLocus;
2207
- beforeEach(() => {
2208
- cachedLocus = {
2209
- controls: {},
2210
- participants: [],
2211
- info: {webExMeetingId: 'testId1', topic: 'test'},
2212
- };
2213
- newLocus = {
2214
- self: {},
2215
- participants: [{id: '111'}],
2216
- info: {testId: 'testId2', webExMeetingName: 'hello'},
2217
- };
2218
- });
2219
- it('shallow merge new locus into cache', () => {
2220
- locusInfo.mainSessionLocusCache = cachedLocus;
2221
- locusInfo.updateMainSessionLocusCache(newLocus);
2222
-
2223
- assert.deepEqual(locusInfo.mainSessionLocusCache, {
2224
- controls: {},
2225
- participants: [{id: '111'}],
2226
- info: {testId: 'testId2', webExMeetingName: 'hello'},
2227
- self: {},
2228
- });
2229
- });
2230
-
2231
- it('cache new locus if no cache before', () => {
2232
- locusInfo.mainSessionLocusCache = null;
2233
- locusInfo.updateMainSessionLocusCache(newLocus);
2234
-
2235
- assert.deepEqual(locusInfo.mainSessionLocusCache, newLocus);
2236
- });
2237
-
2238
- it('do nothing if new locus is null', () => {
2239
- locusInfo.mainSessionLocusCache = cachedLocus;
2240
- locusInfo.updateMainSessionLocusCache(null);
2241
-
2242
- assert.deepEqual(locusInfo.mainSessionLocusCache, cachedLocus);
2243
- });
2244
- });
2245
-
2246
- describe('#clearMainSessionLocusCache', () => {
2247
- it('clear main session locus cache', () => {
2248
- locusInfo.mainSessionLocusCache = {controls: {}};
2249
- locusInfo.clearMainSessionLocusCache();
2250
- assert.isNull(locusInfo.mainSessionLocusCache);
2251
- });
2252
1229
  });
2253
1230
 
2254
1231
  describe('#handleOneonOneEvent', () => {
@@ -2291,404 +1268,5 @@ describe('plugin-meetings', () => {
2291
1268
  );
2292
1269
  });
2293
1270
  });
2294
-
2295
- describe('#isMeetingActive', () => {
2296
- it('sends client event correctly for state = inactive', () => {
2297
- locusInfo.parsedLocus = {
2298
- fullState: {
2299
- type: _CALL_,
2300
- },
2301
- };
2302
-
2303
- locusInfo.fullState = {
2304
- state: LOCUS.STATE.INACTIVE,
2305
- };
2306
-
2307
- locusInfo.isMeetingActive();
2308
-
2309
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
2310
- name: 'client.call.remote-ended',
2311
- options: {
2312
- meetingId: locusInfo.meetingId,
2313
- },
2314
- });
2315
- });
2316
-
2317
- it('sends client event correctly for state = PARTNER_LEFT', () => {
2318
- locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
2319
- locusInfo.parsedLocus = {
2320
- fullState: {
2321
- type: _CALL_,
2322
- },
2323
- self: {
2324
- state: MEETING_STATE.STATES.DECLINED,
2325
- },
2326
- };
2327
- locusInfo.isMeetingActive();
2328
-
2329
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
2330
- name: 'client.call.remote-ended',
2331
- options: {
2332
- meetingId: locusInfo.meetingId,
2333
- },
2334
- });
2335
- });
2336
-
2337
- it('sends client event correctly for state = SELF_LEFT', () => {
2338
- locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
2339
- locusInfo.parsedLocus = {
2340
- fullState: {
2341
- type: _CALL_,
2342
- },
2343
- self: {
2344
- state: MEETING_STATE.STATES.LEFT,
2345
- },
2346
- };
2347
-
2348
- locusInfo.isMeetingActive();
2349
-
2350
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
2351
- name: 'client.call.remote-ended',
2352
- options: {
2353
- meetingId: locusInfo.meetingId,
2354
- },
2355
- });
2356
- });
2357
-
2358
- it('sends client event correctly for state = MEETING_INACTIVE_TERMINATING', () => {
2359
- locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
2360
- locusInfo.parsedLocus = {
2361
- fullState: {
2362
- type: _MEETING_,
2363
- },
2364
- };
2365
-
2366
- locusInfo.fullState = {
2367
- state: LOCUS.STATE.INACTIVE,
2368
- };
2369
-
2370
- locusInfo.isMeetingActive();
2371
-
2372
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
2373
- name: 'client.call.remote-ended',
2374
- options: {
2375
- meetingId: locusInfo.meetingId,
2376
- },
2377
- });
2378
- });
2379
-
2380
- it('sends client event correctly for state = FULLSTATE_REMOVED', () => {
2381
- locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
2382
- locusInfo.parsedLocus = {
2383
- fullState: {
2384
- type: _MEETING_,
2385
- },
2386
- };
2387
-
2388
- locusInfo.fullState = {
2389
- removed: true,
2390
- };
2391
-
2392
- locusInfo.isMeetingActive();
2393
-
2394
- assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
2395
- name: 'client.call.remote-ended',
2396
- options: {
2397
- meetingId: locusInfo.meetingId,
2398
- },
2399
- });
2400
- });
2401
- });
2402
-
2403
- // semi-integration tests that use real LocusInfo with real Parser
2404
- // and test various scenarios related to handling out-of-order Locus delta events
2405
- describe('handling of out-of-order Locus delta events', () => {
2406
- let clock;
2407
-
2408
- const generateDeltaEvent = (base, sequence) => {
2409
- return {
2410
- baseSequence: {
2411
- rangeStart: 0,
2412
- rangeEnd: 0,
2413
- entries: [base],
2414
- },
2415
- sequence: {
2416
- rangeStart: 0,
2417
- rangeEnd: 0,
2418
- entries: [sequence],
2419
- },
2420
- syncUrl: `fake sync url for sequence ${sequence}`,
2421
- self: {
2422
- person: {
2423
- id: 'test person id',
2424
- },
2425
- },
2426
- };
2427
- };
2428
-
2429
- // a list of example delta events, sorted by time and each event is based on the previous one
2430
- const deltaEvents = [
2431
- generateDeltaEvent(10, 20), // 0
2432
- generateDeltaEvent(20, 30), // 1
2433
- generateDeltaEvent(30, 40), // 2
2434
- generateDeltaEvent(40, 50), // 3
2435
- generateDeltaEvent(50, 60), // 4
2436
- generateDeltaEvent(60, 70), // 5
2437
- generateDeltaEvent(70, 80), // 6
2438
- generateDeltaEvent(80, 90), // 7
2439
- generateDeltaEvent(90, 100), // 8
2440
- ];
2441
-
2442
- let updateLocusInfoStub; // we use this stub to verify that an event has been fully processed
2443
- let syncRequestStub;
2444
-
2445
- beforeEach(() => {
2446
- clock = sinon.useFakeTimers();
2447
-
2448
- sinon.stub(locusInfo, 'updateParticipantDeltas');
2449
- sinon.stub(locusInfo, 'updateParticipants');
2450
- sinon.stub(locusInfo, 'isMeetingActive'),
2451
- sinon.stub(locusInfo, 'handleOneOnOneEvent'),
2452
- (updateLocusInfoStub = sinon.stub(locusInfo, 'updateLocusInfo'));
2453
- syncRequestStub = sinon.stub().resolves({body: {}});
2454
-
2455
- mockMeeting.locusInfo = locusInfo;
2456
- mockMeeting.locusUrl = 'fake locus url';
2457
- mockMeeting.meetingRequest = {
2458
- getLocusDTO: syncRequestStub,
2459
- };
2460
-
2461
- locusInfo.onFullLocus({
2462
- sequence: {
2463
- rangeStart: 0,
2464
- rangeEnd: 0,
2465
- entries: [10],
2466
- },
2467
- self: {
2468
- person: {
2469
- id: 'test person id',
2470
- },
2471
- },
2472
- });
2473
-
2474
- updateLocusInfoStub.resetHistory();
2475
- });
2476
-
2477
- afterEach(() => {
2478
- clock.restore();
2479
- });
2480
-
2481
- it('queues out-of-order deltas until it receives a correct delta', () => {
2482
- // send some out-of-order deltas
2483
- locusInfo.handleLocusDelta(deltaEvents[1], mockMeeting);
2484
- locusInfo.handleLocusDelta(deltaEvents[4], mockMeeting);
2485
-
2486
- // they should be queued and not processed
2487
- assert.notCalled(updateLocusInfoStub);
2488
-
2489
- // now one of the missing ones, but not the one SDK is really waiting for
2490
- locusInfo.handleLocusDelta(deltaEvents[2], mockMeeting);
2491
-
2492
- // still nothing should be processed
2493
- assert.notCalled(updateLocusInfoStub);
2494
-
2495
- // now send the one SDK is waiting for
2496
- locusInfo.handleLocusDelta(deltaEvents[0], mockMeeting);
2497
-
2498
- // so deltaEvents with indexes 1,2,3 can be processed, but 5 still not, because 4 is missing
2499
- assert.callCount(updateLocusInfoStub, 3);
2500
- assert.calledWith(updateLocusInfoStub.getCall(0), deltaEvents[0]);
2501
- assert.calledWith(updateLocusInfoStub.getCall(1), deltaEvents[1]);
2502
- assert.calledWith(updateLocusInfoStub.getCall(2), deltaEvents[2]);
2503
-
2504
- updateLocusInfoStub.resetHistory();
2505
-
2506
- // now send deltaEvents[4]
2507
- locusInfo.handleLocusDelta(deltaEvents[3], mockMeeting);
2508
-
2509
- // and verify deltaEvents[4] and deltaEvents[5] have been processed
2510
- assert.callCount(updateLocusInfoStub, 2);
2511
- assert.calledWith(updateLocusInfoStub.getCall(0), deltaEvents[3]);
2512
- assert.calledWith(updateLocusInfoStub.getCall(1), deltaEvents[4]);
2513
- });
2514
-
2515
- it('handles out-of-order deltas correctly even if all arrive in reverse order', () => {
2516
- // send a bunch deltas in reverse order
2517
- for (let i = 4; i >= 0; i--) {
2518
- locusInfo.handleLocusDelta(deltaEvents[i], mockMeeting);
2519
- }
2520
-
2521
- // they should be queued and then processed in correct order
2522
- assert.callCount(updateLocusInfoStub, 5);
2523
- assert.calledWith(updateLocusInfoStub.getCall(0), deltaEvents[0]);
2524
- assert.calledWith(updateLocusInfoStub.getCall(1), deltaEvents[1]);
2525
- assert.calledWith(updateLocusInfoStub.getCall(2), deltaEvents[2]);
2526
- assert.calledWith(updateLocusInfoStub.getCall(3), deltaEvents[3]);
2527
- assert.calledWith(updateLocusInfoStub.getCall(4), deltaEvents[4]);
2528
- });
2529
-
2530
- it('sends a sync request using syncUrl if it receives at least 1 delta event and processes later deltas after sync correctly', async () => {
2531
- // the test first sends an initial "good" delta
2532
- const initialDeltaIdx = 0;
2533
- const initialDelta = deltaEvents[initialDeltaIdx];
2534
-
2535
- // then it sends a bunch of out-of-order deltas (at least 6 to trigger a sync), last one being lastOooDelta
2536
- const firstOooDeltaIdx = 2;
2537
- const lastOooDeltaIdx = 7;
2538
- const lastOooDelta = deltaEvents[lastOooDeltaIdx];
2539
-
2540
- // and finally, after the sync it sends another "good" delta
2541
- const goodDeltaAfterSync = deltaEvents[8];
2542
-
2543
- const deltaLocusFromSyncResponse = {
2544
- baseSequence: {
2545
- rangeStart: 0,
2546
- rangeEnd: 0,
2547
- entries: [initialDelta.sequence.entries[0]],
2548
- },
2549
- sequence: {
2550
- rangeStart: 0,
2551
- rangeEnd: 0,
2552
- entries: [lastOooDelta.sequence.entries[0]],
2553
- },
2554
- syncUrl: `fake sync url for sequence ${lastOooDelta.sequence.entries[0]}`,
2555
- self: {
2556
- person: {
2557
- id: 'test person id',
2558
- },
2559
- },
2560
- };
2561
-
2562
- syncRequestStub.resolves({
2563
- body: deltaLocusFromSyncResponse,
2564
- });
2565
-
2566
- // send one correct delta so that SDK has the syncUrl
2567
- locusInfo.handleLocusDelta(initialDelta, mockMeeting);
2568
-
2569
- updateLocusInfoStub.resetHistory();
2570
-
2571
- // send 6 out-of-order deltas to trigger a sync (we're skipping deltaEvents[1])
2572
- for (let i = firstOooDeltaIdx; i <= lastOooDeltaIdx; i++) {
2573
- locusInfo.handleLocusDelta(deltaEvents[i], mockMeeting);
2574
- }
2575
-
2576
- await testUtils.flushPromises();
2577
-
2578
- // check that sync was done using the correct syncUrl
2579
- assert.calledOnceWithExactly(syncRequestStub, {url: initialDelta.syncUrl});
2580
- assert.calledOnceWithExactly(updateLocusInfoStub, deltaLocusFromSyncResponse);
2581
-
2582
- updateLocusInfoStub.resetHistory();
2583
-
2584
- // now send another delta - a good one, it should be processed as normal
2585
- locusInfo.handleLocusDelta(goodDeltaAfterSync, mockMeeting);
2586
-
2587
- assert.calledOnceWithExactly(updateLocusInfoStub, goodDeltaAfterSync);
2588
- });
2589
-
2590
- it('does a sync if blocked on out-of-order deltas for too long', async () => {
2591
- // stub random so that the timer fires after 12500 ms
2592
- sinon.stub(Math, 'random').returns(0.5);
2593
-
2594
- const oooDelta = deltaEvents[3];
2595
-
2596
- // setup the stubs so that the sync request receives a full DTO with the sequence equal to the out-of-order delta we simulate
2597
- const fullLocus = {
2598
- sequence: oooDelta.sequence,
2599
- };
2600
- syncRequestStub.resolves({
2601
- body: fullLocus,
2602
- });
2603
-
2604
- // send an out-of-order delta
2605
- locusInfo.handleLocusDelta(oooDelta, mockMeeting);
2606
-
2607
- assert.calledOnceWithExactly(sendBehavioralMetricStub, 'js_sdk_locus_delta_ooo', { stack: sinon.match.any})
2608
-
2609
- await clock.tickAsync(12499);
2610
- await testUtils.flushPromises();
2611
- assert.notCalled(syncRequestStub);
2612
- assert.notCalled(updateLocusInfoStub);
2613
-
2614
- await clock.tickAsync(1);
2615
- await testUtils.flushPromises();
2616
-
2617
- assert.calledOnceWithExactly(syncRequestStub, {url: mockMeeting.locusUrl});
2618
- assert.calledOnceWithExactly(updateLocusInfoStub, fullLocus);
2619
- });
2620
-
2621
- it('does a sync if out-of-order deltas queue becomes too big', async () => {
2622
- // setup the stubs so that the sync request receives a full DTO with the sequence equal to the out-of-order delta we simulate
2623
- const fullLocus = {
2624
- sequence: deltaEvents[6].sequence,
2625
- };
2626
- syncRequestStub.resolves({
2627
- body: fullLocus,
2628
- });
2629
-
2630
- // send 5 deltas, starting from deltaEvents[1] so that SDK is blocked waiting for deltaEvents[0]
2631
- for (let i = 0; i < 5; i++) {
2632
- locusInfo.handleLocusDelta(deltaEvents[i + 1], mockMeeting);
2633
- }
2634
-
2635
- // nothing should happen, SDK should still be waiting for deltaEvents[0]
2636
- assert.notCalled(syncRequestStub);
2637
- assert.notCalled(updateLocusInfoStub);
2638
-
2639
- // now send one more out-of-order delta to trigger a sync request
2640
- locusInfo.handleLocusDelta(deltaEvents[6], mockMeeting);
2641
-
2642
- await testUtils.flushPromises();
2643
-
2644
- // check sync was done
2645
- assert.calledOnceWithExactly(syncRequestStub, {url: mockMeeting.locusUrl});
2646
- assert.calledOnceWithExactly(updateLocusInfoStub, fullLocus);
2647
- });
2648
-
2649
- it('processes delta events that are not included in sync response', async () => {
2650
- // this test sends a bunch of out-of-order deltas, this triggers a sync
2651
- // but the full locus response doesn't include the last 2 deltas received, so
2652
- // we check that these 2 deltas are also processed after sync response
2653
- const fullLocusFromSyncResponse = {
2654
- baseSequence: {
2655
- rangeStart: 0,
2656
- rangeEnd: 0,
2657
- entries: [deltaEvents[0].sequence.entries[0]],
2658
- },
2659
- sequence: {
2660
- rangeStart: 0,
2661
- rangeEnd: 0,
2662
- entries: [deltaEvents[5].sequence.entries[0]],
2663
- },
2664
- syncUrl: `fake sync url for sequence ${deltaEvents[5].sequence.entries[0]}`,
2665
- self: {
2666
- person: {
2667
- id: 'test person id',
2668
- },
2669
- },
2670
- };
2671
-
2672
- syncRequestStub.resolves({
2673
- body: fullLocusFromSyncResponse,
2674
- });
2675
-
2676
- // send at least 6 out-of-order deltas to trigger a sync (we're skipping deltaEvents[0])
2677
- for (let i = 1; i <= 7; i++) {
2678
- locusInfo.handleLocusDelta(deltaEvents[i], mockMeeting);
2679
- }
2680
-
2681
- await testUtils.flushPromises();
2682
-
2683
- // check that sync was done
2684
- assert.calledOnceWithExactly(syncRequestStub, {url: mockMeeting.locusUrl});
2685
-
2686
- // and that remaining deltas from the queue that were not included in full Locus were also processed
2687
- assert.callCount(updateLocusInfoStub, 3);
2688
- assert.calledWith(updateLocusInfoStub.getCall(0), fullLocusFromSyncResponse);
2689
- assert.calledWith(updateLocusInfoStub.getCall(1), deltaEvents[6]);
2690
- assert.calledWith(updateLocusInfoStub.getCall(2), deltaEvents[7]);
2691
- });
2692
- });
2693
1271
  });
2694
1272
  });