@webex/plugin-meetings 3.13.0-next.12 → 3.13.0-next.14

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 (100) hide show
  1. package/.repo-context.json +577 -0
  2. package/.sdd/manifest.json +1320 -428
  3. package/AGENTS.md +528 -72
  4. package/dist/aiEnableRequest/index.js +1 -1
  5. package/dist/breakouts/breakout.js +1 -1
  6. package/dist/breakouts/index.js +1 -1
  7. package/dist/config.js +1 -1
  8. package/dist/interpretation/index.js +1 -1
  9. package/dist/interpretation/siLanguage.js +1 -1
  10. package/dist/webinar/index.js +1 -1
  11. package/docs/adr/0001-migrate-existing-docs-into-sdd.md +141 -0
  12. package/docs/adr/index.md +26 -0
  13. package/docs/architecture.md +816 -0
  14. package/docs/getting-started.md +177 -0
  15. package/docs/index.md +53 -0
  16. package/docs/specs/README.md +126 -0
  17. package/package.json +21 -21
  18. package/schemas/repo-context.schema.json +796 -0
  19. package/src/aiEnableRequest/docs/README.md +376 -0
  20. package/src/annotation/docs/README.md +402 -0
  21. package/src/breakouts/docs/README.md +643 -0
  22. package/src/controls-options-manager/docs/README.md +365 -0
  23. package/src/hashTree/docs/README.md +566 -0
  24. package/src/interceptors/docs/README.md +434 -0
  25. package/src/interpretation/docs/README.md +420 -0
  26. package/src/locus-info/docs/README.md +609 -0
  27. package/src/media/docs/README.md +488 -0
  28. package/src/meeting/docs/README.md +834 -0
  29. package/src/meeting-info/docs/README.md +352 -0
  30. package/src/meetings/docs/README.md +549 -0
  31. package/src/member/docs/README.md +347 -0
  32. package/src/members/docs/README.md +514 -0
  33. package/src/metrics/docs/README.md +287 -0
  34. package/src/multistream/docs/README.md +523 -0
  35. package/src/personal-meeting-room/docs/README.md +322 -0
  36. package/src/reachability/docs/README.md +548 -0
  37. package/src/reactions/docs/README.md +296 -0
  38. package/src/reconnection-manager/docs/README.md +485 -0
  39. package/src/recording-controller/docs/README.md +335 -0
  40. package/src/roap/docs/README.md +444 -0
  41. package/src/webinar/docs/README.md +425 -0
  42. package/.sdd/templates/.source.json +0 -30
  43. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +0 -111
  44. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +0 -321
  45. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +0 -59
  46. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +0 -49
  47. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +0 -42
  48. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +0 -120
  49. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +0 -206
  50. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +0 -90
  51. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +0 -68
  52. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +0 -111
  53. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +0 -57
  54. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +0 -69
  55. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +0 -96
  56. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +0 -84
  57. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +0 -82
  58. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +0 -94
  59. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +0 -64
  60. package/.sdd/templates/component-repo/template-map.json +0 -112
  61. package/ai-docs/ARCHITECTURE.md +0 -208
  62. package/ai-docs/CONTRACTS.md +0 -267
  63. package/ai-docs/DATA_MODEL.md +0 -64
  64. package/ai-docs/GETTING_STARTED.md +0 -73
  65. package/ai-docs/GLOSSARY.md +0 -56
  66. package/ai-docs/REVIEW_CHECKLIST.md +0 -45
  67. package/ai-docs/RULES.md +0 -79
  68. package/ai-docs/SECURITY.md +0 -74
  69. package/ai-docs/SERVICE_STATE.md +0 -59
  70. package/ai-docs/SPEC_INDEX.md +0 -85
  71. package/ai-docs/TEST_INDEX.md +0 -45
  72. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +0 -61
  73. package/ai-docs/patterns/defensive-error-propagation.md +0 -55
  74. package/ai-docs/patterns/event-scope-emission.md +0 -46
  75. package/ai-docs/patterns/source-to-test-path-mirroring.md +0 -45
  76. package/ai-docs/patterns/stateless-plugin-request-classes.md +0 -53
  77. package/ai-docs/patterns/typed-constants-and-enum-values.md +0 -47
  78. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +0 -223
  79. package/src/annotation/ai-docs/annotation-spec.md +0 -236
  80. package/src/breakouts/ai-docs/breakouts-spec.md +0 -324
  81. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +0 -243
  82. package/src/hashTree/ai-docs/hash-tree-spec.md +0 -267
  83. package/src/interceptors/ai-docs/interceptors-spec.md +0 -247
  84. package/src/interpretation/ai-docs/interpretation-spec.md +0 -256
  85. package/src/locus-info/ai-docs/locus-info-spec.md +0 -293
  86. package/src/media/ai-docs/media-spec.md +0 -267
  87. package/src/meeting/ai-docs/meeting-spec.md +0 -404
  88. package/src/meeting-info/ai-docs/meeting-info-spec.md +0 -261
  89. package/src/meetings/ai-docs/meetings-spec.md +0 -298
  90. package/src/member/ai-docs/member-spec.md +0 -196
  91. package/src/members/ai-docs/members-spec.md +0 -256
  92. package/src/metrics/ai-docs/metrics-spec.md +0 -185
  93. package/src/multistream/ai-docs/multistream-spec.md +0 -295
  94. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +0 -234
  95. package/src/reachability/ai-docs/reachability-spec.md +0 -261
  96. package/src/reactions/ai-docs/reactions-spec.md +0 -198
  97. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +0 -272
  98. package/src/recording-controller/ai-docs/recording-controller-spec.md +0 -223
  99. package/src/roap/ai-docs/roap-spec.md +0 -241
  100. package/src/webinar/ai-docs/webinar-spec.md +0 -243
@@ -0,0 +1,549 @@
1
+ ---
2
+ type: Module Spec
3
+ title: 'Meetings plugin specification'
4
+ description: Responsibilities, boundaries, design, state, invariants, and verification for the Meetings plugin module (webex.meetings).
5
+ tags: [module, specification]
6
+ ---
7
+ <!-- sdd-generated-metadata
8
+ doc_kind: module-spec
9
+ generated_from: module-spec@0.3.0
10
+ generated_by: claude-code
11
+ approved_by: rarajes2@cisco.com
12
+ updated_at: 2026-11-17T03:14:21Z
13
+ validation_status: pass-with-warnings
14
+ -->
15
+
16
+ # Meetings plugin
17
+
18
+ This source-local document at `src/meetings/docs/README.md` is the canonical source-local spec for
19
+ `src/meetings/`: the registered plugin `webex.meetings`. It owns plugin registration and
20
+ unregistration, Mercury and Locus event routing, meeting creation and lookup, active-meeting
21
+ synchronization, and the top-level meeting collection. Ground every claim in package evidence and
22
+ link to the [package architecture](../../../docs/architecture.md) instead of repeating broader facts.
23
+ No service specification exists because this package is a library.
24
+
25
+ Related context: start from the root [package agent instructions](../../../AGENTS.md) · router
26
+ [documentation index](../../../docs/index.md) · system [package architecture](../../../docs/architecture.md).
27
+ Related module specs: [meeting-info](../../meeting-info/docs/README.md) ·
28
+ [personal meeting room](../../personal-meeting-room/docs/README.md).
29
+
30
+ ## Metadata
31
+
32
+ | Field | Value |
33
+ |---|---|
34
+ | Owner | @webex/web-client, @webex/web-sdk |
35
+ | Source path | `src/meetings` |
36
+ | Resource kind | module |
37
+ | Status | Draft |
38
+ | Last verified | 2026-11-16 at `0b8c34db7f` |
39
+ | Module id | `plugin-meetings/meetings` |
40
+ | Parent spec | — |
41
+ | Doc kind | Module spec |
42
+ | Coverage score | Pending coverage assessment |
43
+ | Validation status | not-run |
44
+
45
+ ## Applicability
46
+
47
+ | Condition ID | Status | Evidence or reason | Owned section |
48
+ |---|---|---|---|
49
+ | `module.has_tiers` | N/A | No tier policy exists in `package.json` or `src/meetings/index.ts` | Tier |
50
+ | `module.has_ui` | N/A | `src/meetings/index.ts` returns models, promises, and events; it renders nothing | UI use-case flow |
51
+ | `module.crosses_service_boundaries` | Applicable | `src/meetings/index.ts` and `src/meetings/request.ts` call device registration, Mercury, Locus, the services catalog, people and user lookups, and the Webex site preference API | Cross-boundary use-case flow |
52
+ | `module.holds_client_state` | Applicable | `src/meetings/index.ts` keeps the registration flags, in-flight promises, collection, deleted-meeting cache, preferred site, and geo hint; `src/meetings/collection.ts` keeps the meetings | Client state model |
53
+ | `module.enforces_domain_rules` | Applicable | Locus routing, meeting reuse, and sync removal rules in `src/meetings/index.ts` and `src/meetings/util.ts` | Business rules and invariants |
54
+ | `module.is_concurrent_async` | Applicable | register() runs its steps through Promise.all; register and unregister serialize on in-flight promises; Mercury callbacks run between calls (`src/meetings/index.ts`) | Concurrency and reactive flow |
55
+ | `module.owns_persistence` | N/A | Nothing is written to storage; the collection and deleted-meeting map in `src/meetings/index.ts` are in memory only | Data, schema, and migration discipline |
56
+ | `module.stateful_transitions` | Applicable | registered, registrationPromise, and unregistrationPromise move the plugin between unregistered, registering, registered, and unregistering (`src/meetings/index.ts`) | State machine |
57
+ | `module.exposes_wire_protocol` | N/A | Requests are built through webex-core in `src/meetings/request.ts`; the Locus payload shape is owned by `src/locus-info/index.ts` | Protocol and wire format |
58
+ | `module.ui_multi_screen` | N/A | No UI in `src/meetings/index.ts` | UI flow |
59
+ | `module.large_data_model` | N/A | The owned types in `src/meetings/meetings.types.ts` are few; the Meeting model is owned by `src/meeting/index.ts` | Data model |
60
+ | `module.returns_caller_errors` | Applicable | register(), unregister(), create(), syncMeetings(), and fetchSitePreferencesMeViaSite() reject or throw in `src/meetings/index.ts` and `src/meetings/request.ts` | Caller-visible failure modes |
61
+ | `module.module_specific_conventions` | N/A | Package-wide conventions apply; see `AGENTS.md` | Module-specific rules |
62
+ | `module.published_package` | N/A | The module is not a package; package exports are owned by `src/index.ts` and `package.json` | Export stability |
63
+ | `module.embedded_in_host` | Applicable | `src/index.ts` registers the class as webex.meetings inside the Webex SDK host | Host integration and theming |
64
+ | `module.has_design_tradeoff` | Applicable | One coordinator in `src/meetings/index.ts` routes every Locus event and owns the collection | Key design trade-off |
65
+ | `module.has_submodules` | N/A | src/meetings has no child module directory | Sub-modules |
66
+
67
+ ## Evidence register
68
+
69
+ Requirements cite current implementation and mirrored unit-test paths. Current code wins over retained prose when they conflict; commit and PR history are excluded by repository-owner decision. Missing test evidence is stated as a gap rather than inferred.
70
+
71
+ | Evidence | What it establishes |
72
+ |---|---|
73
+ | `src/meetings/index.ts` | `Meetings` extends `WebexPlugin`: registration, unregistration, Mercury listeners, Locus routing, create and lookup, sync, destroy, static-link and preference delegation, effects, log upload, and the WASM runtime probe |
74
+ | `src/meetings/collection.ts` | `MeetingCollection` over `src/common/collection.ts`, keyed by meeting id with key, breakout, and WebRTC lookups |
75
+ | `src/meetings/request.ts` | `MeetingRequest` extends `StatelessWebexPlugin`: Locus `loci` fetch with remote-cluster redirection, geo hint, meeting preferences, and the site preference request |
76
+ | `src/meetings/meetings.types.ts` | `MEETING_KEY`, `MeetingRegistrationStatus`, effect option types, and the site preference option, default, and response types |
77
+ | `src/meetings/util.ts` | Locus classification helpers, ROAP Mercury routing, correlation-id lookup, site name derivation, and the H.264 check |
78
+ | `src/index.ts` | `registerPlugin('meetings', Meetings, {config, interceptors})`; default export `Meetings`; exports `SitePreferenceSelectOption` and the site preference types |
79
+ | `src/config.ts` | Defaults read here: `autoUploadLogs` true, `enableE2ee` false, `assetsBaseUrl` from `getUmdAssetsBaseUrl`, `multipartSitePrefixList`, `experimental.enableUnifiedMeetings` true, `experimental.storeLocusHashTreeEventsForDebugging` false |
80
+ | `src/constants.ts` | Event literals in `EVENT_TRIGGERS`, `INITIAL_REGISTRATION_STATUS`, and `MAX_RANDOM_DELAY_FOR_MEETING_INFO` (3 minutes) |
81
+ | `src/metrics/constants.ts` | Registration, log upload, and `WASM_RUNTIME_PERFORMANCE` metric names |
82
+ | `src/e2ee/E2eeManager.ts`, `src/common/wasm-loader.ts` | E2EE preload gating on `enableE2ee` and WASM support, and the asset URL from `assetsBaseUrl` |
83
+ | `src/locus-info/index.ts`, `src/reconnection-manager/index.ts` | In-package callers of `syncMeetings()`: `LOCUS_NOT_FOUND` with `skipHashTreeSync: true`, and reconnection with `keepOnlyLocusMeetings: false` |
84
+ | `test/unit/spec/meetings/index.js` | Registration, unregistration and their serialization, effects, getters, site preferences, sync, static links, create, WASM telemetry, listeners, Locus routing, createMeeting, destroy, preferred site, and log upload cases |
85
+ | `test/unit/spec/meetings/collection.js`, `test/unit/spec/meetings/request.js`, `test/unit/spec/meetings/utils.js` | Collection lookups, the site preference request, and the util helpers |
86
+ | Observation, no stated WHY | `unregister()` treats a 404 from `device.unregister()` as success and continues (`src/meetings/index.ts`); no comment or test name states why, so it is recorded here rather than as a requirement |
87
+ | Observation, no stated WHY | `uploadLogs()` catches an upload failure, emits `meeting:logUpload:failure`, sends the failure metric, and resolves `undefined` instead of rejecting (`src/meetings/index.ts`); no comment states why, so it is recorded here rather than as a requirement |
88
+
89
+ ## Purpose and boundary
90
+
91
+ - Responsibility: Owns the registered plugin lifecycle, meeting discovery, registration, realtime routing, and the top-level meeting collection.
92
+ - In scope: `register()` and `unregister()` and their serialization; the Mercury Locus, ROAP, `ONLINE`, and `OFFLINE` listeners; routing Locus events (classic and hash tree) to an existing meeting or a new one; `create()` and the meeting lookups; `syncMeetings()` and breakout ordering; `destroy` and the deleted-meeting cache; delegation of static links to meeting info and of the personal room to `src/personal-meeting-room/index.ts`; site preferences, geo hint, reachability start, log upload, media effect construction, and the WASM runtime probe.
93
+ - Out of scope: one meeting's lifecycle, media, and controls (`src/meeting/index.ts`); Locus state parsing and hash trees (`src/locus-info/index.ts`, `src/hashTree/hashTreeParser.ts`); destination resolution and meeting-info errors (`src/meeting-info/meeting-info-v2.ts`); reachability probing (`src/reachability/index.ts`); the PMR claim (`src/personal-meeting-room/index.ts`); E2EE key handling beyond the preload.
94
+ - Consumers: applications through `webex.meetings`; in the package, `src/reconnection-manager/index.ts` and `src/locus-info/index.ts` call `syncMeetings()`, and `src/meeting-info/meeting-info-v2.ts` reads `webex.meetings.preferredWebexSite`.
95
+
96
+ ## Structure and key files
97
+
98
+ `src/meetings/` contains 5 direct source/reference file(s) and has 4 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
99
+
100
+ TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests. Build target: `yarn workspace @webex/plugin-meetings build:src`.
101
+
102
+ | File | Holds |
103
+ |---|---|
104
+ | `src/meetings/collection.ts` | `MeetingCollection`, the module-owned collection keyed by meeting id, with `getByKey`, `getActiveBreakoutLocus`, and `getActiveWebrtcMeeting` |
105
+ | `src/meetings/index.ts` | `Meetings`, the module facade/controller and primary export: registration, listeners, routing, create, sync, and delegations |
106
+ | `src/meetings/meetings.types.ts` | module type declarations: `MEETING_KEY`, `MeetingRegistrationStatus`, effect options, and site preference types |
107
+ | `src/meetings/request.ts` | `MeetingRequest`, the HTTP request boundary for Locus `loci`, geo hint, meeting preferences, and site preferences |
108
+ | `src/meetings/util.ts` | `MeetingsUtil` normalization/helper functions: Locus classification, ROAP routing, site name, and the H.264 check |
109
+ | `test/unit/spec/meetings/collection.js` and 3 sibling test file(s) (`index.js`, `request.js`, `utils.js`) | mirrored characterization/unit coverage |
110
+ | `src/meetings/docs/README.md` | This module specification |
111
+
112
+ ## Public surface
113
+
114
+ | Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
115
+ |---|---|---|---|---|---|---|
116
+ | `meetings-collection-api` | SDK collection | `MeetingCollection.set()`, `getByKey()`, `getActiveBreakoutLocus()`, and `getActiveWebrtcMeeting()` | Store Meeting models and resolve current normal/breakout active meetings. | Preserve collection key aliases and active-meeting selection. | `src/meetings/collection.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
117
+ | `meetings-collection-api` | SDK / registration | `executeRegistrationStep()`, `register()`, and `unregister()` | Coordinate device registration and Meetings-owned Mercury/Locus/ROAP listener lifecycle. | Preserve tracked step results, the exact listeners each lifecycle method adds/removes, and the in-flight promise reuse between concurrent register and unregister calls. | `src/meetings/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
118
+ | `meetings-collection-api` | SDK / diagnostics/media effects | `uploadLogs()`, `getReachability()`, `startReachability()`, `getGeoHint()`, `createNoiseReductionEffect()`, and `createVirtualBackgroundEffect()` | Expose logs, reachability/geo diagnostics, and configured media-effect creation. | `startReachability()` returns the gather promise directly. Only the separate registration callback absorbs its rejection. Preserve that boundary, other request outcomes, and effect construction inputs. | `src/meetings/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
119
+ | `meetings-collection-api`, `site-preferences-http` | SDK / preferences | `fetchUserPreferredWebexSite()`, `getPersonalMeetingRoom()`, `fetchSitePreferencesMeViaSite()`, and `getBasicMeetingInformation()` | Fetch account/site preferences, PMR, and lightweight meeting information. | Preserve parallel independent request behavior; do not claim a strict ordering across site/geo/reachability/H264 setup. | `src/meetings/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
120
+ | `meetings-collection-api` | SDK / static links | `fetchStaticMeetingLink()`, `enableStaticMeetingLink()`, and `disableStaticMeetingLink()` | Delegate static meeting-link lookup and mutation to meeting-info V2. | Preserve typed meeting-info errors and direct service outcomes. | `src/meetings/index.ts`, `src/meeting-info/meeting-info-v2.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
121
+ | `meetings-collection-api` | SDK / meeting lookup | `create()`, `getMeetingByType()`, `getAllMeetings()`, and `getActiveWebrtcMeeting()` | Create/find/list Meeting models from destination information and collection keys. | Preserve model reuse/collection identity and lookup-type behavior. | `src/meetings/index.ts`, `src/meetings/collection.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
122
+ | `meetings-collection-api` | SDK / synchronization | `syncMeetings()`, `sortLocusArrayToUpdate()`, `checkHandleBreakoutLocus()`, and `getCorrespondingMeetingByLocus()` | Reconcile active Loci into the collection, including breakout/main relationships. | All four methods are defined on `Meetings` in `index.ts`; Online Mercury handling, the reconnection manager, and Locus-info `LOCUS_NOT_FOUND` handling invoke this sync, while `register()` itself does not. | `src/meetings/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
123
+ | `site-preferences-http` | request/types | `MeetingRequest.getActiveMeetings()`, `fetchGeoHint()`, `getMeetingPreferences()`, `fetchSitePreferencesMeViaSite()`, and `determineRedirections()` plus `LocusEvent`, `BasicMeetingInformation`, `INoiseReductionEffect`, `IVirtualBackgroundEffect`, `MEETING_KEY`, `MeetingRegistrationStatus`, `SitePreferenceSelectOption`, `FetchSitePreferencesMeViaSiteOptions`, `DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS`, and `SitePreferencesResponse` | Provide direct service requests and the exact collection/configuration vocabulary consumed by Meetings. | Preserve request result shapes, enum/raw option values, and default site-selection options; only `SitePreferenceSelectOption`, `FetchSitePreferencesMeViaSiteOptions`, and `SitePreferencesResponse` are package exports in `src/index.ts`. | `src/meetings/request.ts`, `src/meetings/meetings.types.ts`, `src/meetings/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
124
+ | `meetings-collection-api` | SDK / diagnostics | `getLogger()` | Return the logger used by Meetings and child meeting operations. | Preserve logger identity and existing call sites. | `src/meetings/index.ts` | [architecture](../../../docs/architecture.md#public-and-consumer-surfaces) |
125
+
126
+ Provided contract IDs (manifest): `plugin-meetings-sdk`, `meetings-plugin`, `meetings-collection-api`, and `site-preferences-http`. The package-level contracts `plugin-meetings-sdk` (the published entry, whose default export is
127
+ `Meetings`) and `meetings-plugin` (`registerPlugin('meetings', Meetings, …)` in `src/index.ts`) are
128
+ indexed with the IDs above in the
129
+ [package architecture](../../../docs/architecture.md#public-and-consumer-surfaces). Coverage state
130
+ and the contracts baseline are registered in `.sdd/manifest.json`.
131
+
132
+ ### Emitted events
133
+
134
+ Current source emits or forwards these observable literals for this operation boundary. Preserve literal values, scope, payload shape, and emission timing; a constant name alone is not a substitute for the consumer-visible value.
135
+
136
+ | Event literal | Constant / expression | Emission evidence |
137
+ |---|---|---|
138
+ | `meeting:added` | `EVENT_TRIGGERS.MEETING_ADDED` | `src/meetings/index.ts` |
139
+ | `meeting:logUpload:failure` | `EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE` | `src/meetings/index.ts` |
140
+ | `meeting:logUpload:success` | `EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS` | `src/meetings/index.ts` |
141
+ | `meeting:removed` | `EVENT_TRIGGERS.MEETING_REMOVED` | `src/meetings/index.ts` |
142
+ | `meetings:ready` | `EVENT_TRIGGERS.MEETINGS_READY` | `src/meetings/index.ts` |
143
+ | `meetings:registered` | `EVENT_TRIGGERS.MEETINGS_REGISTERED` | `src/meetings/index.ts` |
144
+ | `meetings:unregistered` | `EVENT_TRIGGERS.MEETINGS_UNREGISTERED` | `src/meetings/index.ts` |
145
+ | `network:disconnected` | `EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED` | `src/meetings/index.ts` |
146
+
147
+ Payloads: `meeting:added` carries `{meeting, type}`, where `type` is `join` or `incoming` from a
148
+ Locus event and the `MeetingsUtil.getMeetingAddedType()` value from `create()`; `meeting:removed`
149
+ carries `{meetingId, reason}`; the log-upload events carry `{meetingId, details}` or
150
+ `{meetingId, reason}`; `meetings:ready`, `meetings:registered`, `meetings:unregistered`, and
151
+ `network:disconnected` carry no payload. `meetings:ready` fires once, on the Webex `ready` event.
152
+
153
+ Compatibility notes:
154
+
155
+ - Prefer additive options and payload fields. Preserve method/event names, rejection semantics, and cleanup timing; route public changes through `src/index.ts` or the documented owning object.
156
+
157
+ ## Dependencies
158
+
159
+ Webex core host, device and Mercury plugins, meeting-info services, Meeting construction, reachability, and metrics.
160
+
161
+ Required contract IDs (manifest): `webex-core-plugin-host`, `internal-plugin-device-registration`, `internal-plugin-mercury-events`, `meeting-info-api`, `meeting-api`, `reachability-service`, `meetings-metrics`, `personal-meeting-room-api`, `locus-info-projection`, and `hash-tree-sync`.
162
+
163
+ | Dependency | Why it is required | Failure behavior |
164
+ |---|---|---|
165
+ | `@webex/webex-core` (`webex-core-plugin-host`) | `WebexPlugin`, `StatelessWebexPlugin`, `webex.request` with `api: 'locus'`, and `webex.internal.services` (`fetchClientRegionInfo`, `getMeetingPreferences`, `_getCatalog().addAllowedDomains`) | Request rejections reject the calling method; `getActiveMeetings` rethrows wrapped in `Error` |
166
+ | `@webex/internal-plugin-device` (`internal-plugin-device-registration`) | `device.register(options)`, `device.unregister()`, `device.url`, `userId`, `orgId` | Register rejection rejects `register()`; unregister rejection rejects `unregister()` except a 404 |
167
+ | `@webex/internal-plugin-mercury` (`internal-plugin-mercury-events`) | `connect()`, `disconnect({code: 3050, reason})`, and the Locus, ROAP, `online`, and `offline` events | Connect rejection rejects `register()`; disconnect rejection rejects `unregister()` |
168
+ | Meeting info (`meeting-info-api`) | `MeetingInfoV2`, or legacy `MeetingInfo` when `experimental.enableUnifiedMeetings` is false, for `fetchInfoOptions`, the Meeting's meeting-info provider, and static links | See [meeting-info](../../meeting-info/docs/README.md); `create()` swallows option failures except `SpaceIDDeprecatedError` |
169
+ | Meeting (`meeting-api`) | `new Meeting(...)`, `fetchMeetingInfo`, `injectMeetingInfo`, `locusInfo.initialSetup`, `parse`, `sync`, `cleanUp`, `MeetingUtil.cleanUp` | Errors from `initialSetup` destroy the new meeting with `LOCUS_DTO_SYNC_FAILED` |
170
+ | Reachability (`reachability-service`) | `gatherReachability(trigger)` | `startReachability()` rejects; the registration step absorbs it |
171
+ | Metrics (`meetings-metrics`) and `webex.internal.newMetrics` | Behavioral metrics and the `client.call.remote-started` client event | Metric failures are not awaited, except in the WASM probe, which catches them |
172
+ | Personal meeting room (`personal-meeting-room-api`) | `new PersonalMeetingRoom({meetingInfo}, {parent: webex})` at `ready` | See [personal meeting room](../../personal-meeting-room/docs/README.md) |
173
+ | Locus info (`locus-info-projection`) | `createLocusFromHashTreeMessage` and `findMeetingForHashTreeMessage` for hash tree Locus events; each meeting's `locusInfo` (`initialSetup`, `parse`, `sync`, `updateMainSessionLocusCache`, `cleanUp`) | `initialSetup` errors destroy the new meeting; sync rejections reject `syncMeetings()` |
174
+ | Hash tree (`hash-tree-sync`) | `HashTreeMessage` and `HashTreeObject` types and `isSelf` to find the self element in a hash tree Locus event | — |
175
+ | `webex.people._getMe()`, `webex.internal.user.get()` | Guest detection and the preferred-site fallback | Caught and logged; the site stays unset |
176
+ | `webex.credentials` | `supertoken.access_token` for effects; `isUnverifiedGuest` for sync | — |
177
+ | `@webex/media-helpers`, `@webex/internal-media-core`, `@webex/web-capabilities` | Effect classes, `setLogger`, and `WasmRuntimeProbe` | Probe failures are caught and logged |
178
+ | `src/e2ee/E2eeManager.ts`, `src/common/wasm-loader.ts` | E2EE WASM preload after registration | Preload rejection is logged as a warning |
179
+
180
+ ## Requirements
181
+
182
+ | ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
183
+ |---|---|---|---|---|---|---|
184
+ | `MEETINGS-R-001` | create/get meeting and collection lookup. `create()` normalizes the destination through `fetchInfoOptions`, returns an existing meeting found by conversation URL (only when it is not a calendar meeting) or by SIP URI after `updateCallStateForMetrics`, and otherwise calls `createMeeting`, which adds the new Meeting to the collection. | Owns the registered plugin lifecycle, meeting discovery, registration, realtime routing, and the top-level meeting collection; skipping a found calendar meeting allows the creation of instant-meetings when calendar meetings are present (code comment). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | PRESENT |
185
+ | `MEETINGS-R-002` | register/unregister device and Mercury lifecycle. | Registration owns device/listener readiness; active-meeting synchronization is a separate online-event flow. | `src/meetings/index.ts`, `src/meetings/request.ts` | `test/unit/spec/meetings/index.js` | unregister does not remove the OFFLINE listener; retain as a targeted teardown gap | PRESENT |
186
+ | `MEETINGS-R-003` | `executeRegistrationStep()` marks a step `true` whenever its supplied promise resolves and rethrows a rejection without resetting other flags. `fetchUserPreferredWebexSite()` catches its own failures and resolves, while the `startReachability` registration callback catches that gather rejection and resolves; those two steps are therefore marked successful even when their underlying work failed. `unregister()` removes Locus, ROAP, and `ONLINE` Mercury listeners plus device state, but leaves the `OFFLINE` listener installed. | Registration status records wrapper settlement, not necessarily underlying site/reachability success; other rejected steps preserve partial progress until the next `register()` reset, and the residual `OFFLINE` listener must stay visible as a teardown gap. | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | characterize absorbed site/reachability failures, partial status after a non-absorbed rejection, and the surviving `OFFLINE` callback | PRESENT |
187
+ | `MEETINGS-R-004` | `register()` starts site, geo, reachability, device-registration, and H.264 work together through `Promise.all`; Mercury connect is chained after device registration. Each wrapper-resolved step updates its own status, including the failure-absorbing site and reachability wrappers. `syncMeetings()` runs later from the Mercury `ONLINE` handler installed by `listenForEvents()`. | Registration readiness and active-meeting synchronization are distinct phases, and preserving wrapper-level settlement and actual concurrency prevents callers from depending on a nonexistent success definition or serial order. | `src/meetings/index.ts`, `src/meetings/meetings.types.ts` | `test/unit/spec/meetings/index.js` | none | PRESENT |
188
+ | `MEETINGS-R-007` | `emitWasmRuntimePerformance(correlationId)` is a `once()`-wrapped private probe that runs `WasmRuntimeProbe.check()` and reports `WASM_RUNTIME_PERFORMANCE` (`js_sdk_wasm_runtime_performance`) with `status`, `capability`, `reason`, the destructured measurements `divRatio`, `sqrtRatio`, `addNsPerOp`, `addMedianMs`, `divMedianMs`, `sqrtMedianMs`, and `correlation_id`. Each measurement defaults to `null` when `result.measurements` is absent or omits it. Both a probe rejection and a metric-submission rejection are caught and logged only. | The probe is diagnostic: it exists to find browsers where real-time WASM effects run poorly, so it must never be able to fail meeting creation. Explicit `null` defaults keep the metric schema fixed-width so the fields stay comparable across browsers that report partial measurements, and `once()` keeps one sample per plugin instance rather than one per meeting. | `src/meetings/index.ts`, `src/metrics/constants.ts` | `test/unit/spec/meetings/index.js` | none | PRESENT |
189
+ | `MEETINGS-R-008` | Meetings owns one shared `WasmLoader`, and at the Webex `ready` event builds one `E2eeManager` with it; after successful registration it calls `e2eeManager.preload()`, which starts E2EE WASM preloading only when `meetings.enableE2ee` is true and WebAssembly is supported, loading `e2ee-0.0.1.wasm` from the `meetings.assetsBaseUrl` directory. Preload is fire-and-forget, so a preload rejection is logged and does not change registration success. | Keep module initialization off the meeting join path while preserving registration behavior when the optional asset is unavailable. | `src/meetings/index.ts`, `src/common/wasm-loader.ts`, `src/e2ee/E2eeManager.ts`, `src/config.ts` | `test/unit/spec/meetings/index.js`, `test/unit/spec/common/wasm-loader.ts`, `test/unit/spec/e2ee/E2eeManager.ts` | `assetsBaseUrl` defaults to the UMD assets directory for this package version; the asset itself is published separately. | PRESENT |
190
+ | `MEETINGS-R-005` | Mercury/Locus events resolve an existing meeting by supported keys before creating or routing a new object. | Stable meeting identity prevents duplicate Meeting objects and misrouted realtime updates. | `src/meetings/index.ts`, `src/meetings/collection.ts` | `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/collection.js` | none | PRESENT |
191
+ | `MEETINGS-R-006` | Reachability, geo hints, site preferences, PMR, and active-meeting queries delegate to their current request/controller boundaries. | Central plugin access must preserve host credentials, service discovery, and established response/error behavior. | `src/meetings/index.ts`, `src/meetings/request.ts` | `test/unit/spec/meetings/request.js` | none | PRESENT |
192
+ | `MEETINGS-R-009` | A `register()` call while a registration is in flight returns the same promise; while an unregistration is in flight it waits for it (ignoring its outcome) and then registers. An `unregister()` call while an unregistration is in flight returns the same promise; while a registration is in flight it waits for it (ignoring its outcome) and then unregisters. Both promises are cleared when they settle. `register()` rejects with `SDK cannot authorize` when `webex.canAuthorize` is false and resolves at once when already registered. `unregister()` disconnects Mercury with code 3050 and reason `meetings unregister` before `device.unregister()`. | Overlapping calls must not register or unregister the device twice (test: prevents duplicate registrations), and the 3050 non-reconnecting close prevents Mercury auto-reconnect racing with `device.unregister()` (code comment). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | Present |
193
+ | `MEETINGS-R-010` | The Mercury `ONLINE` handler calls `syncMeetings({keepOnlyLocusMeetings: false})` without awaiting it and catches a rejection, logging a warning. | Nothing consumes this promise, so an unhandled rejection from a transient guest classic-sync failure would otherwise crash Node hosts (code comment). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | Present |
194
+ | `MEETINGS-R-011` | For an unverified guest (`webex.credentials.isUnverifiedGuest`), `syncMeetings()` skips `getActiveMeetings()`. Then, for every user, it calls `locusInfo.sync(meeting, {canSyncClassicLocus: isUnverifiedGuest, canSyncHashTree: !skipHashTreeSync})` for each remaining meeting with `locusInfo` and awaits them together. A `getActiveMeetings()` failure is logged and rethrown before any per-meeting sync. | Locus rejects `getActiveMeetings()` for unverified guests, so each classic meeting is resynced individually instead; for signed-in users classic meetings were already synced from the Loci list, so only the hash tree sync runs (JSDoc and code comment). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | Present |
195
+ | `MEETINGS-R-012` | After handling the returned Loci, `syncMeetings()` destroys with reason `NO_MEETINGS_TO_SYNC` each collected meeting whose `locusUrl` is not active (every meeting when `keepOnlyLocusMeetings` is true, only meetings with a `locusUrl` otherwise), except a meeting whose `locusInfo.info.globalMeetingId` matches a returned Locus. | Mercury events can be lost after a reconnect, so meetings Locus no longer returns are removed; a shared `globalMeetingId` means the user moved between breakouts while offline, for example a webinar attendee, so that meeting is kept (code comments). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | Present |
196
+ | `MEETINGS-R-013` | `destroy` runs `MeetingUtil.cleanUp` (without preserving the Voicea channel), then `meeting.locusInfo.cleanUp()`, stores a minimal `BasicMeetingInformation` in `deletedMeetings`, deletes the meeting from the collection, and emits `meeting:removed` with `{meetingId, reason}`. `getBasicMeetingInformation(id)` reads the collection first, then `deletedMeetings`. | Hash tree parsers are torn down here, not in `MeetingUtil.cleanUp`, so they survive leave and end-for-all to consume the final sentinel END message from Locus; only minimal Locus info is kept because `locusInfo` can be large (code comments). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | Present |
197
+ | `MEETINGS-R-014` | `createMeeting` emits `meeting:added` for a non-Locus destination only if the meeting is still in the collection, and the Locus-event path emits `meeting:added` and `client.call.remote-started` only if the created meeting still exists. | A meeting destroyed for missing meeting info, or a 1:1 meeting deleted because the other user left, must not reach consumers as an orphaned reference (code comments). | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` | none | Present |
198
+ | `MEETINGS-R-015` | For a Locus that is not active, with `enableUnifiedMeetings` and `useRandomDelayForInfo` (Locus events from Mercury), `createMeeting` delays `fetchMeetingInfo` by a random time up to the smaller of the time to start and 3 minutes; it skips the fetch for 1:1 calls and defers it for a Locus without `info` until Locus initial setup. With `failOnMissingMeetingInfo`, a fetch failure other than the captcha, password, permission, webinar, and forbidden errors destroys the meeting and throws `NoMeetingInfoError`. | The random delay spreads fetches for a scheduled meeting that starts in 5 to 6 minutes, avoiding a spike in traffic to the wbxappapi service; without meeting info the destination is assumed to be a 1:1 call or wireless share (code comments). | `src/meetings/index.ts`, `src/constants.ts` | `test/unit/spec/meetings/index.js` | none | Present |
199
+
200
+ ## Design overview
201
+
202
+ `Meetings` is the registered plugin facade and collection owner. `register()` starts site, geo, reachability, device-registration, and H.264 steps concurrently in `Promise.all`; Mercury connection follows successful device registration, and listeners are installed only after the aggregate succeeds. Site-preference fetching absorbs its own failures, and the registration callback absorbs a reachability rejection, so both wrappers can resolve and be marked successful without completing their underlying work. Synchronization is a separate `syncMeetings()` call triggered by the Mercury `ONLINE` handler.
203
+
204
+ The constructor builds `MeetingRequest`, the log-upload request, `MeetingCollection`, the
205
+ `deletedMeetings` map, `Reachability`, and the shared `WasmLoader`. Everything that needs the
206
+ initialized client waits for the Webex `ready` event: static and logging config, the logger proxy,
207
+ the media logger, `E2eeManager`, the meeting-info provider (`MeetingInfoV2` unless
208
+ `experimental.enableUnifiedMeetings` is false), `PersonalMeetingRoom`, `meetings:ready`, the H.264
209
+ check, and metrics setup.
210
+
211
+ Register and unregister serialize on `registrationPromise` and `unregistrationPromise`
212
+ (`MEETINGS-R-009`). Locus events arrive from Mercury, from `syncMeetings()` (as
213
+ `SDK_LOCUS_FROM_SYNC_MEETINGS`), and from breakouts held for later; `handleLocusEvent` finds the
214
+ meeting, decides through `isNeedHandleLocusDTO` and `isNeedHandleMainLocus` whether a classic event
215
+ must be processed, and either parses it into the existing meeting or creates a new one and runs
216
+ `locusInfo.initialSetup`. ROAP Mercury messages go to `MeetingsUtil.handleRoapMercury`.
217
+
218
+ ## Data flow and sequence coverage
219
+
220
+ Call style: in-process method calls on `webex.meetings`; outbound HTTPS through `webex.request`
221
+ (Locus `loci`, remote Locus clusters, and the site preference API) and through the device, services,
222
+ people, and user plugins; inbound Mercury events (`event:locus`, ROAP, `online`, `offline`).
223
+
224
+ ```mermaid
225
+ flowchart LR
226
+ Consumer[webex.meetings consumer] --> Plugin[index.ts]
227
+ Plugin --> Request[request.ts]
228
+ Plugin --> Info[src/meeting-info]
229
+ Plugin --> Collection[collection.ts]
230
+ Plugin --> Device[Webex device registration]
231
+ Plugin --> Mercury[Mercury connection and events]
232
+ Mercury --> Sync[syncMeetings]
233
+ Sync --> Request
234
+ Collection --> Meeting[src/meeting]
235
+ ```
236
+
237
+ Sequence coverage:
238
+
239
+ | Operation group | Diagram | Failure coverage |
240
+ |---|---|---|
241
+ | UC-1…UC-5 — Meetings registration and synchronization operation groups | Meetings registration and synchronization primary sequence | registration-step failure, independent setup requests, online sync rejection logged by the handler, per-meeting Locus sync, and listener teardown |
242
+ | UC-1…UC-5 — Meetings registration and synchronization alternate/failure paths | Meetings registration and synchronization alternate/failure sequence | registration-step rejection, Mercury/device failure, in-flight register or unregister reuse, device unregister 404, unsupported destination, site-preference parameter error, or meeting-sync request failure |
243
+ | UC-3 — meeting creation | Meeting creation sequence | option failure swallowed except `SpaceIDDeprecatedError`, meeting-info failure with and without `failOnMissingMeetingInfo`, delayed or deferred fetch |
244
+ | UC-6 — Locus event routing | Locus event routing sequence | ignored DTO, inactive or left-and-removed Locus, `initialSetup` failure, meeting destroyed before `meeting:added` |
245
+ | UC-4, UC-5 — preferences, reachability, PMR, static links, logs, effects | `src/meetings/index.ts`, `src/meetings/request.ts` (one delegated call each) | synchronous `ParameterError`, static-link rejections logged and rethrown, log upload failure resolves |
246
+
247
+ ### Meetings registration and synchronization primary sequence
248
+
249
+ ```mermaid
250
+ sequenceDiagram
251
+ participant C as Consumer
252
+ participant M as Meetings
253
+ participant D as Device
254
+ participant Q as Mercury
255
+ participant R as MeetingRequest
256
+ participant L as Meeting locusInfo
257
+ C->>M: register(options)
258
+ par independent registration work
259
+ M->>M: site, geo, reachability, and H.264 steps
260
+ and device path
261
+ M->>D: register device
262
+ D-->>M: device registration succeeds
263
+ M->>Q: connect Mercury
264
+ end
265
+ M->>M: install listeners after Promise.all succeeds
266
+ M->>M: emit meetings:registered, registered = true, start E2EE preload
267
+ M-->>C: registration result
268
+ Q-->>M: ONLINE
269
+ M->>M: syncMeetings({keepOnlyLocusMeetings:false})
270
+ alt signed-in user
271
+ M->>R: getActiveMeetings()
272
+ R-->>M: active Loci
273
+ M->>M: reconcile MeetingCollection
274
+ else unverified guest
275
+ M->>M: skip getActiveMeetings()
276
+ end
277
+ M->>L: sync(meeting, {canSyncClassicLocus, canSyncHashTree})
278
+ opt sync rejects
279
+ M->>M: log warning in the ONLINE handler
280
+ end
281
+ ```
282
+
283
+ ### Meetings registration and synchronization alternate/failure sequence
284
+
285
+ ```mermaid
286
+ sequenceDiagram
287
+ participant C as SDK consumer
288
+ participant M as Meetings
289
+ participant W as Webex registration dependencies
290
+ C->>M: register or unregister
291
+ alt registration or unregistration already in flight
292
+ M-->>C: same in-flight promise, or wait for the other operation then run
293
+ else registration
294
+ M->>W: run the configured steps, site/geo/reachability/H.264 setup may run in parallel
295
+ W-->>M: step result, absorbed site/reachability failure, or propagated rejection
296
+ M-->>C: registration result, absorbed steps are marked true and completed flags remain set on propagated rejection
297
+ else unregistration
298
+ M->>W: remove Mercury/device registration state (disconnect code 3050, then device unregister)
299
+ W-->>M: cleanup result, a device unregister 404 continues
300
+ M-->>C: unregistration result
301
+ end
302
+ ```
303
+
304
+ ### Meeting creation sequence
305
+
306
+ ```mermaid
307
+ sequenceDiagram
308
+ participant C as Consumer
309
+ participant M as Meetings
310
+ participant I as Meeting info provider
311
+ participant K as MeetingCollection
312
+ participant G as Meeting
313
+ C->>M: create(destination, type, ...)
314
+ M->>I: fetchInfoOptions(destination, type)
315
+ alt SpaceIDDeprecatedError
316
+ I--xM: rejection
317
+ M--xC: SpaceIDDeprecatedError
318
+ else other failure or options
319
+ I-->>M: options or swallowed failure
320
+ end
321
+ M->>K: getByKey(conversationUrl, non-calendar) then getByKey(sipUri)
322
+ alt meeting found
323
+ M->>G: updateCallStateForMetrics
324
+ M-->>C: existing meeting
325
+ else no meeting
326
+ M->>G: new Meeting(...) added to collection
327
+ alt meetingInfo passed
328
+ M->>G: injectMeetingInfo
329
+ else not 1:1 and delay applies
330
+ M->>G: setTimeout fetchMeetingInfo
331
+ else not 1:1 and Locus has info
332
+ M->>G: await fetchMeetingInfo
333
+ end
334
+ opt fetch fails, failOnMissingMeetingInfo, not a typed join error
335
+ M->>M: destroy(MISSING_MEETING_INFO)
336
+ M--xC: NoMeetingInfoError
337
+ end
338
+ M->>C: meeting:added if still collected (non-Locus destination)
339
+ M-->>C: new meeting, with destroy and upload-logs listeners
340
+ end
341
+ ```
342
+
343
+ ### Locus event routing sequence
344
+
345
+ ```mermaid
346
+ sequenceDiagram
347
+ participant Q as Mercury or syncMeetings
348
+ participant M as Meetings
349
+ participant K as MeetingCollection
350
+ participant G as Meeting
351
+ Q->>M: handleLocusEvent(data)
352
+ M->>K: find by locusUrl, hash tree message, correlationId, sipUri, conversationUrl, meetingNumber
353
+ alt classic event
354
+ M->>M: replaces fallback, main-session cache, isNeedHandleLocusDTO
355
+ opt not needed
356
+ M-->>Q: ignore
357
+ end
358
+ end
359
+ alt meeting found
360
+ M->>G: locusInfo.parse(meeting, data)
361
+ else no meeting
362
+ opt Locus INACTIVE, or self LEFT and removed
363
+ M-->>Q: ignore with warning
364
+ end
365
+ M->>G: create(locus, LOCUS_ID)
366
+ M->>G: locusInfo.initialSetup(...)
367
+ opt initialSetup throws
368
+ M->>M: destroy(LOCUS_DTO_SYNC_FAILED)
369
+ end
370
+ M->>M: checkHandleBreakoutLocus(locus)
371
+ M->>Q: meeting:added and client.call.remote-started if still collected
372
+ end
373
+ ```
374
+
375
+ ## Class and component relationships
376
+
377
+ ```mermaid
378
+ classDiagram
379
+ class Consumer
380
+ class Plugin
381
+ class Request
382
+ class Info
383
+ class Collection
384
+ class Device
385
+ class Mercury
386
+ class Sync
387
+ class Meeting
388
+ class PersonalMeetingRoom
389
+ class Reachability
390
+ class E2eeManager
391
+ class WasmLoader
392
+ Consumer --> Plugin
393
+ Plugin --> Request
394
+ Plugin --> Info
395
+ Plugin --> Collection
396
+ Plugin --> Device
397
+ Plugin --> Mercury
398
+ Mercury --> Sync
399
+ Sync --> Request
400
+ Collection --> Meeting
401
+ Plugin --> PersonalMeetingRoom
402
+ Plugin --> Reachability
403
+ Plugin --> E2eeManager
404
+ E2eeManager --> WasmLoader
405
+ ```
406
+
407
+ The arrows identify ownership and delegation inside `src/meetings/`; files that only declare types or constants are not presented as transports.
408
+
409
+ ## Use cases and flows
410
+
411
+ | Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
412
+ |---|---|---|---|---|
413
+ | `UC-1` | Application | Register device and Meetings-owned listeners through tracked registration steps without treating active-meeting synchronization as part of `register()` itself. | A failing device, Mercury, geo, or H.264 step rejects; site and reachability failures are absorbed | `src/meetings/index.ts`, `test/unit/spec/meetings/index.js` |
414
+ | `UC-2` | Mercury, reconnection manager, Locus info | On Mercury `ONLINE`, `Meetings.syncMeetings()` fetches active Loci through `MeetingRequest.getActiveMeetings()` and reconciles corresponding main/breakout Meeting models into the collection, then resyncs each meeting's Locus. | Unverified guests skip the fetch; the `ONLINE` handler logs a rejection | `src/meetings/index.ts`, `src/meetings/request.ts` |
415
+ | `UC-3` | Application | Create or retrieve a Meeting by destination/type while reusing collection identity when a matching model exists. | `SpaceIDDeprecatedError` rejects; `NoMeetingInfoError` with `failOnMissingMeetingInfo` | `src/meetings/index.ts`, `src/meetings/collection.ts` |
416
+ | `UC-4` | Application | Start/read reachability, fetch geo/site preferences, PMR, or basic meeting information through their independent request paths. | `fetchSitePreferencesMeViaSite()` throws synchronously without a site | `src/meetings/index.ts`, `src/meetings/request.ts` |
417
+ | `UC-5` | Application | Fetch, enable, or disable a static meeting link through the meeting-info V2 facade and preserve its typed outcomes. | Rejections are logged and rethrown unchanged | `src/meetings/index.ts`, `src/meeting-info/meeting-info-v2.ts` |
418
+ | `UC-6` | Mercury | A Locus event updates the matching meeting, or creates one and emits `meeting:added` | Ended or left Loci are ignored; a failed initial setup destroys the meeting | `src/meetings/index.ts`, `test/unit/spec/meetings/index.js` |
419
+
420
+ ### Cross-boundary use-case flow
421
+
422
+ | Boundary | Transport and ordering | Compatibility | Timeout, retry, and recovery |
423
+ |---|---|---|---|
424
+ | Device registration (`UC-1`) | `webex.internal.device.register(options)`, then Mercury connect, in that order | Options passed through unchanged | No retry here; the caller registers again |
425
+ | Mercury (`UC-1`, `UC-2`, `UC-6`) | WebSocket events delivered one at a time to the four listeners | Locus envelopes other than ROAP and approval requests go to `handleLocusEvent` | Disconnect uses code 3050 so Mercury does not reconnect during unregister |
426
+ | Locus `loci` (`UC-2`) | GET through `api: 'locus'`, then one GET per `remoteLocusClusterUrls` entry with `runWhitelistedDomains`, merged into `loci` and `locusUrls` | Response body shape owned by Locus | A failure is logged and rethrown as `Error`; the Locus retry interceptor applies (`src/interceptors/locusRetry.ts`) |
427
+ | Webex site API (`UC-4`) | GET `https://<siteUrl>/wbxappapi/v1/users/me/preference?select=<options>&siteurl=<siteName>` | `select` defaults to `scheduling`; the site name is derived with `multipartSitePrefixList` | No retry |
428
+ | Services, people, and user plugins (`UC-1`, `UC-4`) | `fetchClientRegionInfo`, `getMeetingPreferences`, `_getMe`, `user.get` | The preferred site is added to the catalog's allowed domains | Site lookup failures are logged and absorbed |
429
+
430
+ ## Client state model
431
+
432
+ Registration progress, meeting collection entries, sync state, and listener handles are held in memory for the plugin lifetime.
433
+
434
+ | State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
435
+ |---|---|---|---|---|
436
+ | `registered` | `Meetings` | `false` | `true` after registration succeeds; `false` after unregistration succeeds | In memory |
437
+ | `registrationStatus` | `Meetings` | Unset until `register()`, then `INITIAL_REGISTRATION_STATUS` (six `false` flags) | Each resolved step sets its flag | Reset by each `register()` and by a successful `unregister()` |
438
+ | `registrationPromise`, `unregistrationPromise` | `Meetings` | Unset | Set while an operation runs | Cleared when it settles |
439
+ | `meetingCollection` | `MeetingCollection` | Empty | `createMeeting`, `destroy` | In memory |
440
+ | `deletedMeetings` | `Meetings` | Empty `Map` | `destroy` | Never cleared during the plugin lifetime |
441
+ | `breakoutLocusForHandleLater` | `Meetings` | Unset | `sortLocusArrayToUpdate`, `checkHandleBreakoutLocus` | Replaced on each sort |
442
+ | `preferredWebexSite`, `geoHintInfo` | `Meetings` | `''`, unset | Registration steps | Overwritten by the next registration |
443
+ | `meetingInfo`, `personalMeetingRoom`, `e2eeManager` | `Meetings` | Unset until `ready` | `ready`; `_toggleUnifiedMeetings` replaces `meetingInfo` | In memory |
444
+
445
+ ## Business rules and invariants
446
+
447
+ | ID | Invariant | WHY | Enforcement source | Test evidence |
448
+ |---|---|---|---|---|
449
+ | `INV-001` | A realtime event is routed to its corresponding meeting before a new meeting is created | Stable meeting identity prevents duplicate Meeting objects (`MEETINGS-R-005`) | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` |
450
+ | `INV-002` | A main-session Locus is skipped when it carries an older `replaceAt` than this device's breakout join, when this device joined an active breakout, or when self moved and is removed or this device's resource left and moved; a breakout Locus for a new meeting is handled only when self is `JOINED`, and one for an existing meeting only when self has not moved | Expired or moved main-session states must not overwrite the active breakout session (log messages in `isNeedHandleMainLocus` name these as expired or not needing handling) | `src/meetings/index.ts`, `src/meetings/util.ts` | `test/unit/spec/meetings/index.js` |
451
+ | `INV-003` | When a sync returns a main Locus and its breakout for a meeting that does not exist, the main Locus is handled first and the breakout after the meeting is created | Handling only the breakout Locus would miss data (code comment) | `src/meetings/index.ts` | `test/unit/spec/meetings/index.js` |
452
+
453
+ ## Concurrency and reactive flow
454
+
455
+ - Execution model: Registration steps run through one `Promise.all` aggregate, with Mercury connection chained behind device registration. `executeRegistrationStep()` sets a flag after its callback resolves. Site-preference fetching and the registration reachability callback absorb their own failures and therefore still set their flags; a rejection from another step propagates without clearing flags already set. Unregistration removes the Mercury/device registration owned by the plugin; individual meeting synchronization requests remain separate returned promises rather than silently changing registration success.
456
+ - Ordering guarantees: overlapping register and unregister calls serialize on the in-flight promises (`MEETINGS-R-009`); `syncMeetings()` handles the Loci list before the per-meeting syncs, which run in parallel.
457
+ - Idempotency and retry: `register()` resolves when already registered and `unregister()` when already unregistered; `emitWasmRuntimePerformance` runs once per instance; nothing here retries.
458
+ - Shared-state protection: single-threaded event loop; the in-flight promises are the only guard.
459
+ - Blocking restrictions: the E2EE preload and the WASM probe are not awaited by registration or creation.
460
+
461
+ ## State machine
462
+
463
+ ```mermaid
464
+ stateDiagram-v2
465
+ [*] --> unregistered
466
+ unregistered --> registering: register()
467
+ registering --> registering: register() returns the in-flight promise
468
+ registering --> registered: required steps succeed
469
+ registering --> unregistered: aggregate rejects, completed step flags remain until next register()
470
+ registered --> syncing: Mercury ONLINE
471
+ syncing --> registered: collection reconciled or sync settles
472
+ registered --> unregistering: unregister()
473
+ unregistering --> unregistered: Mercury disconnected and device unregistered (or 404)
474
+ unregistering --> registered: disconnect or device unregister rejects
475
+ unregistering --> registering: register() waits for unregistration, then registers
476
+ ```
477
+
478
+ These labels summarize the concrete `registered`, registration-promise, registration-step, and Mercury-`ONLINE` transitions in `src/meetings/index.ts`.
479
+
480
+ `unregister()` during `registering` waits for the registration to settle and then unregisters. A
481
+ failed unregistration leaves `registered` true with the Locus, ROAP, and `ONLINE` listeners already
482
+ removed.
483
+
484
+ ## Caller-visible failure modes
485
+
486
+ | Condition | Signal | Caller recovery |
487
+ |---|---|---|
488
+ | Site-preference fetching or the registration reachability call fails | The inner catch logs/absorbs the failure, `executeRegistrationStep()` observes resolution, and `fetchWebexSite` or `startReachability` is marked `true`; that failure alone does not reject registration. | Treat those flags as wrapper-completion indicators and inspect diagnostics/current data before assuming the underlying work succeeded. |
489
+ | Another registration step or Mercury/device registration rejects | The returned registration promise rejects. The failing step is not marked successful, and flags already set by concurrently completed steps are not reset until the next `register()` initializes registration status. | Correct the failing dependency and treat the next registration call as the status reset boundary. |
490
+ | `fetchSitePreferencesMeViaSite()` has neither `options.siteUrl` nor `preferredWebexSite` | `MeetingRequest.fetchSitePreferencesMeViaSite()` throws `ParameterError` synchronously before returning a promise; the non-`async` facade returns that direct call, so `.catch()` on a nonexistent result cannot observe the error. | Supply either site URL and wrap the call boundary in synchronous error handling when inputs may be absent. |
491
+ | Another destination or preference request rejects | Its returned request promise preserves the implemented rejection. | Supply supported input or handle the returned rejection for that specific operation. |
492
+ | Meeting synchronization request rejects | A direct `syncMeetings()` call rejects independently of plugin registration state; the Mercury `ONLINE` handler catches the rejection and logs a warning. | Handle or repeat synchronization under the owning meeting workflow. |
493
+ | The WASM runtime probe or its metric submission rejects | The rejection is caught and logged as an error; no event is emitted, no metric is retried, and meeting creation is unaffected. | Read the logged diagnostic; do not treat a missing `js_sdk_wasm_runtime_performance` metric as a meeting-creation failure. |
494
+ | `webex.canAuthorize` is false | `register()` rejects with `Error('SDK cannot authorize')`. | Authorize the SDK, then register. |
495
+ | Mercury disconnect or a non-404 device unregister fails | `unregister()` rejects; `registered` stays true and `meetings:unregistered` is not emitted. | Call `unregister()` again. |
496
+ | `fetchInfoOptions` rejects in `create()` | `SpaceIDDeprecatedError` is rethrown; any other failure is logged and creation continues with the original destination. | Use a meeting ID or SIP address instead of a space ID. |
497
+ | Meeting info cannot be fetched with `failOnMissingMeetingInfo` | `create()` rejects with `NoMeetingInfoError` after the meeting is destroyed with `MISSING_MEETING_INFO`; no `meeting:added` is emitted. | Retry or handle the missing meeting. |
498
+
499
+ ## Pitfalls and constraints
500
+
501
+ - Registration is multi-step. Treating device registration, Mercury setup, and active-meeting sync as one opaque call loses the failing stage and can leak listeners.
502
+ - Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
503
+ - Teardown gap: unregister removes Locus/ROAP/`ONLINE` listeners and registration state but currently leaves the `OFFLINE` listener installed. `stopListeningForEvents()` calls `mercury.off(event)` without a handler and never removes `OFFLINE`, so after unregister and register the `OFFLINE` callback is installed twice and `network:disconnected` fires once per installed copy (`src/meetings/index.ts`).
504
+ - `uploadLogs()` resolves `undefined` on failure; check the `meeting:logUpload:failure` event, not the promise.
505
+ - The static-link facade methods call `fetchStaticMeetingLink`, `enableStaticMeetingLink`, and `disableStaticMeetingLink` on the meeting-info provider, which only `MeetingInfoV2` defines; with `experimental.enableUnifiedMeetings` false the call throws a `TypeError` synchronously.
506
+ - `PersonalMeetingRoom` keeps the meeting-info provider it was built with at `ready`; `_toggleUnifiedMeetings` replaces `meetings.meetingInfo` but not the personal room's provider.
507
+ - `_toggle*` and `_setLogUploadIntervalMultiplicationFactor` ignore values of the wrong type and change `config` in place; several must be called before `register()` or `joinWithMedia()` (JSDoc).
508
+
509
+ ## Host integration and theming
510
+
511
+ The Webex SDK host supplies initialized request/device/Mercury/media capabilities and exposes this behavior through `webex.meetings` or its Meeting objects. The module renders no UI and has no theme contract.
512
+
513
+ - Mount or entry contract: `registerPlugin('meetings', Meetings, {config, interceptors})` in `src/index.ts`; the instance is reached as `webex.meetings`.
514
+ - Required providers, peers, or host versions: the device, Mercury, conversation, metrics, and identity plugins imported by `src/index.ts` and `src/meetings/index.ts`; the host must emit `ready` before the meeting-info provider, personal room, and E2EE manager exist.
515
+ - Theme and design-token contract: none.
516
+ - Accessibility and lifecycle obligations: call `register()` before relying on realtime events and `unregister()` to release the device and Mercury connection.
517
+
518
+ ## Key design trade-off
519
+
520
+ | Chosen trade-off | Preserved invariant or benefit | Cost or limitation | Decision evidence |
521
+ |---|---|---|---|
522
+ | Central coordination favors consistent event routing and one meeting collection at the cost of a large orchestrator; feature behavior stays in child modules. | Every Locus event is matched against one collection | `src/meetings/index.ts` is large and holds routing rules for breakouts, hash trees, and sync | `src/meetings/index.ts` |
523
+
524
+ ## Verification
525
+
526
+ Use the current mirrored suites: `test/unit/spec/meetings/collection.js`, `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/request.js`, `test/unit/spec/meetings/utils.js`. Characterize the meetings-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
527
+
528
+ | Behavior / Requirement | Existing test evidence | Gap |
529
+ |---|---|---|
530
+ | `MEETINGS-R-001` | `test/unit/spec/meetings/index.js` | registration, online sync, create/lookup, preferences, reachability, and static-link groups are covered; the SIP URI reuse branch is covered only through `getByKey` stubs |
531
+ | `MEETINGS-R-002` | `test/unit/spec/meetings/index.js` | unregister does not remove the OFFLINE listener; retain as a targeted teardown gap |
532
+ | `MEETINGS-R-003` | `test/unit/spec/meetings/index.js` | the reachability rejection resolving registration and the progressive status flags are covered; assert the absorbed site failure flag, exact listener removal, and the surviving `OFFLINE` listener |
533
+ | `MEETINGS-R-004` | `test/unit/spec/meetings/index.js` | step status ordering and device-before-Mercury are covered with fake timers; a non-absorbed rejection leaving earlier flags set is not asserted |
534
+ | `MEETINGS-R-005` | `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/collection.js` | verify alternate-key collision cases |
535
+ | `MEETINGS-R-006` | `test/unit/spec/meetings/request.js` | none |
536
+ | `MEETINGS-R-007` | `test/unit/spec/meetings/index.js` | covered for the full-measurements payload, the `null` defaults when measurements are absent, and the swallowed probe rejection |
537
+ | `MEETINGS-R-008` | `test/unit/spec/meetings/index.js`, `test/unit/spec/common/wasm-loader.ts`, `test/unit/spec/e2ee/E2eeManager.ts` | the configured assets directory, config and capability gating, module caching and retry, and registration resilience are covered |
538
+ | `MEETINGS-R-009` | `test/unit/spec/meetings/index.js` | none |
539
+ | `MEETINGS-R-010` | `test/unit/spec/meetings/index.js` | none |
540
+ | `MEETINGS-R-011` | `test/unit/spec/meetings/index.js` | none |
541
+ | `MEETINGS-R-012` | `test/unit/spec/meetings/index.js` | none |
542
+ | `MEETINGS-R-013` | `test/unit/spec/meetings/index.js` | the auto-upload-logs-on-destroy case is skipped (`xit`) |
543
+ | `MEETINGS-R-014` | `test/unit/spec/meetings/index.js` | none |
544
+ | `MEETINGS-R-015` | `test/unit/spec/meetings/index.js` | none |
545
+ | `INV-002`, `INV-003` | `test/unit/spec/meetings/index.js`, `test/unit/spec/meetings/utils.js` | none |
546
+
547
+ Run a single suite with `yarn workspace @webex/plugin-meetings test:unit --targets meetings/index.js`;
548
+ the suites import this package's `src` modules directly. A module specification is complete only when its public surface, invariants, failure modes, and test evidence agree with the
549
+ implementation.