@webex/plugin-meetings 3.13.0-next.13 → 3.13.0-next.15
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.
- package/.repo-context.json +577 -0
- package/.sdd/manifest.json +1320 -428
- package/AGENTS.md +528 -72
- package/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/config.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/webinar/index.js +1 -1
- package/docs/adr/0001-migrate-existing-docs-into-sdd.md +141 -0
- package/docs/adr/index.md +26 -0
- package/docs/architecture.md +816 -0
- package/docs/getting-started.md +177 -0
- package/docs/index.md +53 -0
- package/docs/specs/README.md +126 -0
- package/package.json +21 -21
- package/schemas/repo-context.schema.json +796 -0
- package/src/aiEnableRequest/docs/README.md +376 -0
- package/src/annotation/docs/README.md +402 -0
- package/src/breakouts/docs/README.md +643 -0
- package/src/controls-options-manager/docs/README.md +365 -0
- package/src/hashTree/docs/README.md +566 -0
- package/src/interceptors/docs/README.md +434 -0
- package/src/interpretation/docs/README.md +420 -0
- package/src/locus-info/docs/README.md +609 -0
- package/src/media/docs/README.md +488 -0
- package/src/meeting/docs/README.md +834 -0
- package/src/meeting-info/docs/README.md +352 -0
- package/src/meetings/docs/README.md +549 -0
- package/src/member/docs/README.md +347 -0
- package/src/members/docs/README.md +514 -0
- package/src/metrics/docs/README.md +287 -0
- package/src/multistream/docs/README.md +523 -0
- package/src/personal-meeting-room/docs/README.md +322 -0
- package/src/reachability/docs/README.md +548 -0
- package/src/reactions/docs/README.md +296 -0
- package/src/reconnection-manager/docs/README.md +485 -0
- package/src/recording-controller/docs/README.md +335 -0
- package/src/roap/docs/README.md +444 -0
- package/src/webinar/docs/README.md +425 -0
- package/.sdd/templates/.source.json +0 -30
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +0 -111
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +0 -321
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +0 -59
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +0 -49
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +0 -42
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +0 -120
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +0 -206
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +0 -90
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +0 -68
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +0 -111
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +0 -57
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +0 -69
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +0 -96
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +0 -84
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +0 -82
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +0 -94
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +0 -64
- package/.sdd/templates/component-repo/template-map.json +0 -112
- package/ai-docs/ARCHITECTURE.md +0 -208
- package/ai-docs/CONTRACTS.md +0 -267
- package/ai-docs/DATA_MODEL.md +0 -64
- package/ai-docs/GETTING_STARTED.md +0 -73
- package/ai-docs/GLOSSARY.md +0 -56
- package/ai-docs/REVIEW_CHECKLIST.md +0 -45
- package/ai-docs/RULES.md +0 -79
- package/ai-docs/SECURITY.md +0 -74
- package/ai-docs/SERVICE_STATE.md +0 -59
- package/ai-docs/SPEC_INDEX.md +0 -85
- package/ai-docs/TEST_INDEX.md +0 -45
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +0 -61
- package/ai-docs/patterns/defensive-error-propagation.md +0 -55
- package/ai-docs/patterns/event-scope-emission.md +0 -46
- package/ai-docs/patterns/source-to-test-path-mirroring.md +0 -45
- package/ai-docs/patterns/stateless-plugin-request-classes.md +0 -53
- package/ai-docs/patterns/typed-constants-and-enum-values.md +0 -47
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +0 -223
- package/src/annotation/ai-docs/annotation-spec.md +0 -236
- package/src/breakouts/ai-docs/breakouts-spec.md +0 -324
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +0 -243
- package/src/hashTree/ai-docs/hash-tree-spec.md +0 -267
- package/src/interceptors/ai-docs/interceptors-spec.md +0 -247
- package/src/interpretation/ai-docs/interpretation-spec.md +0 -256
- package/src/locus-info/ai-docs/locus-info-spec.md +0 -293
- package/src/media/ai-docs/media-spec.md +0 -267
- package/src/meeting/ai-docs/meeting-spec.md +0 -404
- package/src/meeting-info/ai-docs/meeting-info-spec.md +0 -261
- package/src/meetings/ai-docs/meetings-spec.md +0 -298
- package/src/member/ai-docs/member-spec.md +0 -196
- package/src/members/ai-docs/members-spec.md +0 -256
- package/src/metrics/ai-docs/metrics-spec.md +0 -185
- package/src/multistream/ai-docs/multistream-spec.md +0 -295
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +0 -234
- package/src/reachability/ai-docs/reachability-spec.md +0 -261
- package/src/reactions/ai-docs/reactions-spec.md +0 -198
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +0 -272
- package/src/recording-controller/ai-docs/recording-controller-spec.md +0 -223
- package/src/roap/ai-docs/roap-spec.md +0 -241
- package/src/webinar/ai-docs/webinar-spec.md +0 -243
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Module Spec
|
|
3
|
+
title: 'Locus info specification'
|
|
4
|
+
description: Responsibilities, boundaries, design, state, invariants, and verification for the Locus info module that turns Locus state into the meeting projection.
|
|
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
|
+
# Locus info
|
|
17
|
+
|
|
18
|
+
This source-local document at `src/locus-info/docs/README.md` owns the stable specification for
|
|
19
|
+
**the Locus info module**: `LocusInfo`, which every `Meeting` creates to hold one normalized copy of
|
|
20
|
+
its Locus state, and the classic delta sequencer in `parser.ts`. `LocusInfo` accepts full Locus DTOs,
|
|
21
|
+
classic deltas, Locus API responses, and hash-tree updates, and reports what changed through the
|
|
22
|
+
`updateMeeting` callback and scoped events that `Meeting` subscribes to. Hash-tree datasets are kept
|
|
23
|
+
by the [hash tree module](../../hashTree/docs/README.md); the roster built from the participants is
|
|
24
|
+
owned by the [members module](../../members/docs/README.md). Ground every claim in package evidence
|
|
25
|
+
and link to the [package architecture](../../../docs/architecture.md) instead of repeating broader
|
|
26
|
+
facts. No service specification exists because this package is a library.
|
|
27
|
+
|
|
28
|
+
Related context: [documentation index](../../../docs/index.md) ·
|
|
29
|
+
[package agent instructions](../../../AGENTS.md)
|
|
30
|
+
|
|
31
|
+
## Metadata
|
|
32
|
+
|
|
33
|
+
| Field | Value |
|
|
34
|
+
| ----- | ----- |
|
|
35
|
+
| Owner | @webex/web-client, @webex/web-sdk |
|
|
36
|
+
| Source path | `src/locus-info` |
|
|
37
|
+
| Resource kind | module |
|
|
38
|
+
| Status | Draft |
|
|
39
|
+
| Last verified | 2026-11-16 at `0b8c34db7f` |
|
|
40
|
+
| Module id | `plugin-meetings/locus-info` |
|
|
41
|
+
| Parent spec | — |
|
|
42
|
+
| Doc kind | Module spec |
|
|
43
|
+
| Coverage score | Pending coverage assessment |
|
|
44
|
+
| Validation status | not-run |
|
|
45
|
+
|
|
46
|
+
## Applicability
|
|
47
|
+
|
|
48
|
+
| Condition ID | Status | Evidence or reason | Owned section |
|
|
49
|
+
| ------------------------------------ | ---------- | ------------------ | ------------- |
|
|
50
|
+
| `module.has_tiers` | N/A | No tier policy exists in `package.json` or `.sdd/manifest.json` | Tier |
|
|
51
|
+
| `module.has_ui` | N/A | `src/locus-info/index.ts` reports state through a callback and events and renders nothing | UI use-case flow |
|
|
52
|
+
| `module.crosses_service_boundaries` | Applicable | `src/locus-info/index.ts` fetches Locus DTOs through the meeting request, calls webex.meetings destroy and syncMeetings, and injects webex.request into each hash tree parser | Cross-boundary use-case flow |
|
|
53
|
+
| `module.holds_client_state` | Applicable | `src/locus-info/index.ts` keeps the parsed projection, raw subdocument copies, parser entries, and the main session cache; `src/locus-info/parser.ts` keeps the delta queue and working copy | Client state model |
|
|
54
|
+
| `module.enforces_domain_rules` | Applicable | Sequence rules in `src/locus-info/parser.ts`; transport, replacement, and meeting-end rules in `src/locus-info/index.ts` | Business rules and invariants |
|
|
55
|
+
| `module.is_concurrent_async` | Applicable | Promise-based syncs, a sorted delta queue with a sync timer in `src/locus-info/parser.ts`, and asynchronous hash tree callbacks in `src/locus-info/index.ts` | Concurrency and reactive flow |
|
|
56
|
+
| `module.owns_persistence` | N/A | Everything is in memory; `src/locus-info/index.ts` writes no storage | Data, schema, and migration discipline |
|
|
57
|
+
| `module.stateful_transitions` | Applicable | The delta parser moves between IDLE, WORKING, BLOCKED, and PAUSED in `src/locus-info/parser.ts` | State machine |
|
|
58
|
+
| `module.exposes_wire_protocol` | Applicable | Locus full and delta DTO, Mercury event, hash tree message, and API response shapes read by `src/locus-info/index.ts`, `src/locus-info/parser.ts`, and `src/locus-info/types.ts` | Protocol and wire format |
|
|
59
|
+
| `module.ui_multi_screen` | N/A | No UI | UI flow |
|
|
60
|
+
| `module.large_data_model` | N/A | The Locus DTO is owned by Locus; the few client types in `src/locus-info/types.ts` are listed under Protocol and wire format | Data model |
|
|
61
|
+
| `module.returns_caller_errors` | Applicable | initialSetup and onFullLocus throw, and sync rejects on a transient failure, in `src/locus-info/index.ts` | Caller-visible failure modes |
|
|
62
|
+
| `module.module_specific_conventions` | N/A | The module follows the package-wide logging, metrics, and event conventions seen in `src/locus-info/index.ts`; no extra rule is set | Module-specific rules |
|
|
63
|
+
| `module.published_package` | N/A | `src/index.ts` exports nothing from this module; it is internal to the package | Export stability |
|
|
64
|
+
| `module.embedded_in_host` | N/A | No host theme or embed API | Host integration and theming |
|
|
65
|
+
| `module.has_design_tradeoff` | N/A | `.sdd/manifest.json` records has_design_tradeoff false for this module; the classic versus hash tree split is described under Design overview | Key design trade-off |
|
|
66
|
+
| `module.has_submodules` | N/A | The src/locus-info directory has no child module in `.sdd/manifest.json` | Sub-modules |
|
|
67
|
+
|
|
68
|
+
## Evidence register
|
|
69
|
+
|
|
70
|
+
Requirements cite current implementation and mirrored unit-test paths. Current code wins over prose
|
|
71
|
+
when they conflict; commit and PR history are excluded by repository-owner decision. Missing test
|
|
72
|
+
evidence is stated as a gap rather than inferred.
|
|
73
|
+
|
|
74
|
+
| Evidence | What it establishes |
|
|
75
|
+
| -------- | ------------------- |
|
|
76
|
+
| `src/locus-info/index.ts` | `LocusInfo` (extends `EventsScope`), `findMeetingForHashTreeMessage`, `createLocusFromHashTreeMessage`, and the exported types `LocusLLMEvent`, `LocusApiResponseBody`, `HashTreeParserEntry`, `LocusInfoCallbacks`; every entry path, sync, parser switch, projection update, and event emission |
|
|
77
|
+
| `src/locus-info/parser.ts` | The classic delta sequencer: `IDLE`, `WORKING`, `BLOCKED`, `PAUSED`; the `loci` comparison results; a sorted queue; the out-of-order wait of 10 to 15 seconds and the queue limit of 5 |
|
|
78
|
+
| `src/locus-info/controlsUtils.ts` | Controls parsing and change flags, `isNeedReplaceMembers`, `getSessionSwitchStatus`, `isMainSessionDTO` |
|
|
79
|
+
| `src/locus-info/selfUtils.ts` | Self parsing (`getSelves`) and the self change flags that drive the self events |
|
|
80
|
+
| `src/locus-info/infoUtils.ts` | Meeting info parsing with roles and joined state, `DisplayHintSection`, lock and unlock flags |
|
|
81
|
+
| `src/locus-info/fullState.ts`, `src/locus-info/hostUtils.ts` | Full state parsing with meeting state and type change; host id parsing and the new-host flag |
|
|
82
|
+
| `src/locus-info/mediaSharesUtils.ts`, `src/locus-info/embeddedAppsUtils.ts` | Content and whiteboard share extraction; embedded app parsing (Slido detection) and the similarity check by count and state |
|
|
83
|
+
| `src/locus-info/types.ts` | `LocusDTO`, `LocusFullState`, `Links`, `ReplacesInfo`, `EndMeetingReason`, and `LocusErrorCodes` (`LOCUS_INACTIVE` 2403004, `LOCUS_USER_FULL` 2423001) |
|
|
84
|
+
| `src/hashTree/hashTreeParser.ts` | The parser `LocusInfo` creates; `LocusInfoUpdateType` values `OBJECTS_UPDATED`, `MEETING_ENDED`, `LOCUS_NOT_FOUND`; `reevaluateLlmWatchdogs`; uses `LocusErrorCodes.LOCUS_INACTIVE` |
|
|
85
|
+
| `src/meeting/index.ts` | Creates `LocusInfo`, subscribes to its events, calls `initialSetup`, `parse`, `syncAllHashTreeDatasets`, and `suspendDestroyMeeting`; compares `LocusErrorCodes.LOCUS_USER_FULL` |
|
|
86
|
+
| `src/meeting/util.ts` | Passes Locus API response bodies to `handleLocusAPIResponse` |
|
|
87
|
+
| `src/meetings/index.ts` | Calls `initialSetup` for meetings created from Locus events and destroys the meeting when it throws; calls `sync` from `syncMeetings` |
|
|
88
|
+
| `src/meetings/util.ts` | `isSelfMovedOrBreakoutEnded`, `isWholeMeetingEnded`, and `getThisDevice`; reads `EndMeetingReason.breakoutEnded` |
|
|
89
|
+
| `src/constants.ts` | `LOCUSEVENT` names (`locus.difference`, `locus.state_message`, `jsSdk.locus_from_sync_meetings`), `EVENTS` and `LOCUSINFO.EVENTS` names, removal reasons |
|
|
90
|
+
| `src/config.ts` | `meetings.locus.excludedDataSets` defaults to `attendees` |
|
|
91
|
+
| `test/unit/spec/locus-info/index.js` | Behavioral cases for initial setup, every update family, hash tree switching, API responses, sync and doLocusSync failure branches, caches, meeting end, and out-of-order deltas |
|
|
92
|
+
| `test/unit/spec/locus-info/parser.js` | Sequence comparison fixture cases, queueing, DESYNC pause, USE_INCOMING, locus URL change, full DTO freshness, invalid loci |
|
|
93
|
+
| `src/locus-info/index.ts` (observation) | `updateParticipants` emits `PARTICIPANT_REASON_CHANGED` for every participant whose `reason` is `FAILURE`; no reason is recorded in code |
|
|
94
|
+
| `src/locus-info/index.ts` (observation) | `handleHashTreeParserSwitchForAPIResponse` starts `initializeFromGetLociResponse` and `resumeFromApiResponse` without awaiting or catching them, so their `LocusNotFoundError` or `MeetingEndedError` rejection is not handled; no reason is recorded in code |
|
|
95
|
+
| `src/locus-info/parser.ts` (observation) | On `LOCUS_URL_CHANGED` the parser clears its working copy but does not pause, so deltas already queued are dropped as invalid until the sync result arrives; no reason is recorded in code |
|
|
96
|
+
| `src/locus-info/index.ts` (observation) | For 1:1 call types `isMeetingActive` still emits `DESTROY_MEETING` while destroy is suspended (it only adds the metric and `joinInProgress`); for meeting type it suppresses the event; no reason is recorded in code |
|
|
97
|
+
|
|
98
|
+
## Purpose and boundary
|
|
99
|
+
|
|
100
|
+
- Responsibility: Normalizes Locus full-state, delta, API-response, and hash-tree inputs into one
|
|
101
|
+
meeting-state projection and scoped callbacks.
|
|
102
|
+
- In scope: the four entry paths (`initialSetup`, `parse`, `handleLocusAPIResponse`, `sync`); the
|
|
103
|
+
classic delta queue and its Locus sync (`doLocusSync`); creating, stopping, and reactivating one
|
|
104
|
+
`HashTreeParser` per Locus URL and converting its updates into a Locus-shaped object; projecting
|
|
105
|
+
controls, self, host, info, full state, media shares, embedded apps, links, participants, URLs,
|
|
106
|
+
and sequences; detecting that a 1:1 call or a meeting has ended; the main session cache used when
|
|
107
|
+
moving between breakouts.
|
|
108
|
+
- Out of scope: hash comparison, dataset requests, and heartbeat watchdogs (`src/hashTree`); building
|
|
109
|
+
and diffing `Member` models (`src/members`, `src/member`); what `Meeting` does with each event;
|
|
110
|
+
the Locus HTTP routes (`src/meeting/request.ts`); destroying a meeting and resyncing all meetings
|
|
111
|
+
(`src/meetings/index.ts`).
|
|
112
|
+
- Consumers: `Meeting` (`src/meeting/index.ts`) creates one `LocusInfo` per meeting and is the only
|
|
113
|
+
listener of its events; `Meetings` (`src/meetings/index.ts`) calls `initialSetup`, `parse`, and
|
|
114
|
+
`sync`, and uses `findMeetingForHashTreeMessage`; `src/meeting/util.ts` forwards API responses.
|
|
115
|
+
Applications reach the state only through `Meeting` properties and events.
|
|
116
|
+
|
|
117
|
+
## Structure and key files
|
|
118
|
+
|
|
119
|
+
`src/locus-info` contains 10 source files and has 10 mirrored unit-test files under
|
|
120
|
+
`test/unit/spec/locus-info` (seven suites plus the `selfConstant.js`, `lib/BasicSeqCmp.json`, and
|
|
121
|
+
`lib/SeqCmp.json` fixtures). There is no dedicated suite for `fullState.ts`, `hostUtils.ts`, or
|
|
122
|
+
`types.ts`; `index.js` exercises them through `LocusInfo`.
|
|
123
|
+
|
|
124
|
+
The code is TypeScript in the Node 22.14 Yarn workspace, built on the package's `EventsScope` and
|
|
125
|
+
Webex core abstractions, with Mocha, Sinon, and `@webex/test-helper-chai` tests run by `test:unit`
|
|
126
|
+
(`webex-legacy-tools test --unit --runner mocha`). Build target: `yarn workspace
|
|
127
|
+
@webex/plugin-meetings build:src`.
|
|
128
|
+
|
|
129
|
+
| File | Holds |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `src/locus-info/controlsUtils.ts` | Parses `controls` and computes the per-control change flags; decides member replacement and breakout to main session switches |
|
|
132
|
+
| `src/locus-info/embeddedAppsUtils.ts` | Parses embedded apps (Slido or other) and compares app lists by count and state |
|
|
133
|
+
| `src/locus-info/fullState.ts` | Parses `fullState` into type, meeting state, lock, and attendee count, with state and type change detection |
|
|
134
|
+
| `src/locus-info/hostUtils.ts` | Parses `host` into a host id and flags a new host |
|
|
135
|
+
| `src/locus-info/index.ts` | `LocusInfo`: entry paths, syncs, hash tree parser entries, projection updates, scoped events, caches; the hash tree message helpers |
|
|
136
|
+
| `src/locus-info/infoUtils.ts` | Parses `info` with the self roles and joined state into display hints, policy, and lock flags |
|
|
137
|
+
| `src/locus-info/mediaSharesUtils.ts` | Extracts content and whiteboard share state, floors, beneficiaries, and URLs from `mediaShares` |
|
|
138
|
+
| `src/locus-info/parser.ts` | Classic delta sequencer: sequence comparison rules, sorted queue, IDLE, WORKING, BLOCKED, and PAUSED status, sync trigger |
|
|
139
|
+
| `src/locus-info/selfUtils.ts` | Parses `self` and computes the self change flags (roles, mute, lobby, breakout, layout, media) |
|
|
140
|
+
| `src/locus-info/types.ts` | Locus DTO, full state, links, replaces, end meeting reason, and Locus error code types |
|
|
141
|
+
| `test/unit/spec/locus-info/index.js` and 9 sibling test files | Mirrored unit coverage: `controlsUtils.js`, `embeddedAppsUtils.js`, `infoUtils.js`, `mediaSharesUtils.ts`, `parser.js`, `selfUtils.js`, and the fixtures `selfConstant.js`, `lib/BasicSeqCmp.json`, `lib/SeqCmp.json` |
|
|
142
|
+
| `src/locus-info/docs/README.md` | This module specification |
|
|
143
|
+
|
|
144
|
+
## Public surface
|
|
145
|
+
|
|
146
|
+
`LocusInfo` is internal to the package: `src/index.ts` does not export it, and applications reach it
|
|
147
|
+
only as `meeting.locusInfo`. Contract ID `locus-info-projection` is indexed in the
|
|
148
|
+
[package architecture](../../../docs/architecture.md) and its native source is
|
|
149
|
+
`src/locus-info/index.ts`.
|
|
150
|
+
|
|
151
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
152
|
+
|---|---|---|---|---|---|---|
|
|
153
|
+
| `locus-info-projection` | SDK / initialization | `init()`, `initialSetup(data, onLocusSynced)`, `handleLocusAPIResponse()`, and `applyLocusDeltaData()` / `handleLocusDelta()` | Establish the Locus projection from a join response, a Locus message, or a GET loci response, and queue API or Mercury deltas through the delta parser. | Preserve initialization order, the three `initialSetup` triggers, and single-event mutation discipline; `onLocusSynced` errors are logged, not thrown. | `src/locus-info/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
154
|
+
| `locus-info-projection` | SDK / hash-tree | `updateLocusFromHashTreeObject()`, `sendClassicVsHashTreeMismatchMetric()`, and `syncAllHashTreeDatasets({onlyLLM})` | Convert synchronized hash-tree objects into the same Locus projection and emit the existing metric when an update arrives in the unexpected transport shape. | Preserve parser callback ownership, metric trigger conditions (at most 5 metrics per instance), and sequential dataset synchronization per parser. | `src/locus-info/index.ts`, `src/hashTree/hashTreeParser.ts` | [architecture](../../../docs/architecture.md) |
|
|
155
|
+
| `locus-info-projection` | SDK / parsing/event | `parse()`, `emitScoped()`, `onFullLocus()`, `onDeltaLocus()`, and `handleOneOnOneEvent()` | Parse full and delta payloads and notify Meeting through the `updateMeeting` callback and scoped events. | Preserve event names and payloads and the 1:1 `REMOTE_RESPONSE` handling; `onFullLocus()` throws when `dataSets` arrive without metadata. | `src/locus-info/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
156
|
+
| `locus-info-projection` | SDK / projection | `updateLocusInfo()`, `getLocusPartner()`, `isMeetingActive()`, `suspendDestroyMeeting()`, `compareAndUpdate()`, and `compareSelfAndHost()` | Reconcile meeting activity, partner, self, and host changes and decide when the meeting has ended, without duplicating remote transport. | Preserve comparison semantics, the `DESTROY_MEETING` reasons, and destroy-suspension behavior. | `src/locus-info/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
157
|
+
| `locus-info-projection` | SDK / projection | `updateParticipants()`, `updateControls()`, `updateConversationUrl()`, `updateCreated()`, `updateLinks()`, `updateFullState()`, `updateHostInfo()`, `updateMeetingInfo()`, `updateEmbeddedApps()`, `updateMediaShares()`, `updateReplaces()`, `updateSelf()`, `ensureSelfParticipantExists()`, and `mergeParticipants()` | Project the Locus subdocuments into Meeting, Members, controls, media shares, and related state. | Preserve per-subdocument comparison with the stored raw copy and callback routing. | `src/locus-info/index.ts`, `src/locus-info/controlsUtils.ts`, `src/locus-info/embeddedAppsUtils.ts`, `src/locus-info/mediaSharesUtils.ts` | [architecture](../../../docs/architecture.md) |
|
|
158
|
+
| `locus-info-projection` | SDK / identity/cache | `updateLocusUrl()`, `updateAclUrl()`, `updateBasequence()`, `updateSequence()`, `updateLocusCache()`, `getTheLocusToUpdate()`, `updateMainSessionLocusCache()`, `clearMainSessionLocusCache()`, and `cleanUp()` | Maintain the current and main session Locus identity and the cached main session payload used when returning from a breakout. | Preserve main-session separation; `cleanUp()` cleans up and forgets every hash tree parser. | `src/locus-info/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
159
|
+
| `locus-info-projection` | parser comparison | `locus2string()`, `checkSequenceOverlap()`, `checkUnequalRanges()`, `checkForUniqueEntries()`, `checkIfOutOfSync()`, `compare()`, `compareFullDtoSequence()`, `isNewFullLocus()`, `compareSequence()`, `compareToAction()`, `extractComparisonState()`, `getMetaData()`, `getUniqueSequences()`, `getNumbersOutOfRange()`, `isValidLocus()`, `isSequenceEmpty()`, and `isLoci()` | Determine whether a delta is applicable, stale, out of order, from another Locus URL, or requires a full sync. | Preserve the `loci` results (`USE_INCOMING`, `USE_CURRENT`, `WAIT`, `DESYNC`, `LOCUS_URL_CHANGED`) and the `IDLE`, `PAUSED`, `WORKING`, and `BLOCKED` parser-state transitions. | `src/locus-info/parser.ts` | [architecture](../../../docs/architecture.md) |
|
|
160
|
+
| `locus-info-projection` | parser queue/lifecycle | `nextEvent()`, `onDeltaAction()`, `onDeltaEvent()`, `packComparisonResult()`, `pause()`, `processDeltaEvent()`, `resume()`, and `getDebugMessage()` | Serialize queued deltas and expose the parser's current blocking or working state for debugging. | Pause/resume and queue ordering are observable through applied callback order. | `src/locus-info/parser.ts` | [architecture](../../../docs/architecture.md) |
|
|
161
|
+
| `locus-info-projection` | exported helpers/contracts | `findMeetingForHashTreeMessage()`, `createLocusFromHashTreeMessage()`, `LocusLLMEvent`, `LocusApiResponseBody`, `HashTreeParserEntry`, `LocusInfoCallbacks`, `DisplayHintSection`, `EndMeetingReason`, `LocusFullState`, `Links`, `LocusDTO`, `ReplacesInfo`, and `LocusErrorCodes` | Share the exact Locus and hash-tree integration vocabulary used by Meetings and composed controllers. | Add fields compatibly; raw error, status, and link shapes remain cross-module contracts. | `src/locus-info/index.ts`, `src/locus-info/types.ts`, `src/locus-info/infoUtils.ts` | [architecture](../../../docs/architecture.md) |
|
|
162
|
+
| `locus-info-projection` | SDK / sync | `sync(meeting, {canSyncClassicLocus, canSyncHashTree})` and `isUsingHashTrees()` | Resync this meeting after a reconnection through whichever mechanism it uses, and tell callers which one that is. | A hash tree meeting never takes the classic path; the classic path rejects only on a transient failure so the caller can retry. | `src/locus-info/index.ts` | [architecture](../../../docs/architecture.md) |
|
|
163
|
+
|
|
164
|
+
Compatibility notes:
|
|
165
|
+
|
|
166
|
+
- Prefer additive options and payload fields. Preserve method and event names, rejection semantics,
|
|
167
|
+
and cleanup timing. The module is internal: change its surface together with its callers in
|
|
168
|
+
`src/meeting/index.ts`, `src/meeting/util.ts`, and `src/meetings/index.ts`, not through
|
|
169
|
+
`src/index.ts`.
|
|
170
|
+
|
|
171
|
+
## Dependencies
|
|
172
|
+
|
|
173
|
+
`LocusInfo` needs Locus payloads and fetch access through the meeting request, the hash-tree parser,
|
|
174
|
+
event scope utilities, the meeting update callback, and metrics.
|
|
175
|
+
|
|
176
|
+
| Dependency | Why it is required | Failure behavior |
|
|
177
|
+
| ---------- | ------------------ | ---------------- |
|
|
178
|
+
| `src/hashTree` (contract `hash-tree-sync`) | `HashTreeParser` keeps each visible dataset and calls back with `OBJECTS_UPDATED`, `MEETING_ENDED`, or `LOCUS_NOT_FOUND` | Initialization rejections propagate out of `initialSetup`; other sync failures stay inside the parser |
|
|
179
|
+
| Meeting request, `meeting.meetingRequest.getLocusDTO` (contract `locus-http`) | Delta and full Locus DTO fetches in `doLocusSync` | A delta failure falls back to a full fetch unless it is a 403; see Caller-visible failure modes |
|
|
180
|
+
| `webex.meetings` (`src/meetings/index.ts`) | `destroy` after a failed or terminal sync and on `MEETING_ENDED`; `syncMeetings` on `LOCUS_NOT_FOUND`; `meetingCollection` lookup | A `syncMeetings` rejection is logged |
|
|
181
|
+
| `webex.request`, `webex.sessionId`, `webexTrackingIdSequenceNumbers` from `@webex/webex-core` | Injected into each `HashTreeParser` as its request function and tracking id source | The tracking id falls back to a uuid when no interceptor sequence exists |
|
|
182
|
+
| `webex.internal.device.url` | Finding this device's `replaces` entry and parsing self | — |
|
|
183
|
+
| `webex.internal.newMetrics.submitClientEvent`, `Metrics.sendBehavioralMetric` (`src/metrics`) | `client.call.remote-ended`, delta sync failure, sync handling failure, classic versus hash tree mismatch, destroy while suspended, out-of-order delta, unsupported hash tree operation | Fire and forget |
|
|
184
|
+
| `EventsScope` (`src/common/events/events-scope.ts`), `SortedQueue` (`src/common/queue.ts`) | Scoped event emission; the delta queue ordered by base sequence | — |
|
|
185
|
+
| `MeetingsUtil` (`src/meetings/util.ts`), `src/constants.ts` | Moved or breakout-ended detection, whole meeting end, this device lookup; event and state names | — |
|
|
186
|
+
| `webex.config.meetings.locus.excludedDataSets` (`src/config.ts`) | Datasets the hash tree parser must not sync (default `attendees`) | — |
|
|
187
|
+
| `lodash` (`isEqual`, `assignWith`, `cloneDeep`, `isEmpty`), `uuid` | Change detection by deep equality, cache merging and copying, empty-body detection, tracking id fallback | — |
|
|
188
|
+
|
|
189
|
+
## Requirements
|
|
190
|
+
|
|
191
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
192
|
+
|---|---|---|---|---|---|---|
|
|
193
|
+
| `LOCUS-INFO-R-001` | `init()`, `initialSetup()`, `parse()`, and the `update*()` family initialize and update the Locus state held on `LocusInfo`: a raw copy of each subdocument plus the parsed `parsedLocus` projection, pushed to Meeting through `callbacks.updateMeeting`. | Meeting needs one normalized projection and scoped callbacks instead of raw Locus full-state, delta, API-response, and hash-tree inputs (the class JSDoc: LocusInfo converts Locus info into a private emitter for the parent object). | `src/locus-info/index.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
194
|
+
| `LOCUS-INFO-R-002` | Full, delta, API, and hash-tree updates are applied by path: a classic full DTO is applied only when `isNewFullLocus()` finds it newer than the working copy; a classic delta is queued in `parser.ts` and applied through `onDeltaLocus()` on `USE_INCOMING`; a hash-tree update is converted to a Locus-shaped object and applied through `onDeltaLocus()`. | Full, delta, API, and hash-tree inputs must converge on one ordered Locus projection without applying gaps or older state. | `src/locus-info/index.ts`, `src/locus-info/parser.ts` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js` | none | PRESENT |
|
|
195
|
+
| `LOCUS-INFO-R-003` | Malformed or stale deltas follow parser comparison rules. `doLocusSync()` fetches the delta DTO from the working copy's `syncUrl` (full DTO from the meeting or new Locus URL otherwise), falls back from delta to full sync unless the delta fetch got a 403, applies a delta body through `handleLocusDelta()` and a full body through `onFullLocus()`, and ignores an empty body. It returns a promise: a terminal 403 always destroys the meeting with `LOCUS_DTO_SYNC_FAILED` and resolves; a transient fetch failure destroys and resolves by default, or with `destroyOnTransientFailure: false` keeps the meeting and rejects; a failure to apply a fetched DTO sends `LOCUS_SYNC_HANDLING_FAILED` and resolves. Its `finally` resumes the parser when the meeting survives. | Parser recovery is internal on the delta path, which does not await it; only the caller-driven reconnection path may retry, and code comments state that re-applying the same unprocessable DTO would fail identically and retry forever. | `src/locus-info/index.ts`, `src/locus-info/parser.ts` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js` | none | PRESENT |
|
|
196
|
+
| `LOCUS-INFO-R-004` | Full-state, delta, API-response, and hash-tree inputs converge into the same current Locus projection through `updateLocusInfo()` and `updateParticipants()`. A meeting uses one transport: `isUsingHashTrees()` is true once any parser exists, classic mode ignores `locus.state_message` events received before a parser exists, and hash-tree mode routes `jsSdk.locus_from_sync_meetings` through `handleLocusAPIResponse()`. | Alternate synchronization transports must not expose divergent meeting state; the `doLocusSync` JSDoc forbids the classic sync for hash-tree meetings, and a code comment says an early hash-tree event before the join response is safe to ignore. | `src/locus-info/index.ts`, `src/locus-info/parser.ts` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js` | none | PRESENT |
|
|
197
|
+
| `LOCUS-INFO-R-005` | Sequence gaps trigger synchronization rather than speculative application: an out-of-order delta (`WAIT`) blocks the parser and starts a 10 to 15 second timer, and the timer or more than 5 queued deltas triggers a `DESYNC` sync; a delta whose base sequence equals its sequence also requests a sync. Hash-tree dataset gaps are reconciled by `HashTreeParser`. `sendClassicVsHashTreeMismatchMetric()` reports an unexpected transport shape (a non hash-tree event in hash-tree mode, or `dataSets` in a classic API response), logs every time, and sends at most 5 metrics; it does not compare classic and hash-tree state values. | Applying stale or incomplete remote state can produce false meeting, member, or control events, while the metric contract must not imply a state-diff computation that does not exist; the cap keeps it from flooding the metrics system (code comment). | `src/locus-info/index.ts`, `src/locus-info/parser.ts`, `src/hashTree/hashTreeParser.ts` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js`, `test/unit/spec/hashTree/hashTreeParser.ts` | none | PRESENT |
|
|
198
|
+
| `LOCUS-INFO-R-006` | Normalized changes invoke the scoped event for what changed: `LOCUS_INFO_UPDATE_PARTICIPANTS` on every participants update; `LOCUS_INFO_UPDATE_SELF`, `LOCUS_INFO_UPDATE_HOST`, `LOCUS_INFO_UPDATE_MEDIA_SHARES`, `LOCUS_INFO_UPDATE_URL`, `LOCUS_INFO_CAN_ASSIGN_HOST`; the `LOCUSINFO.EVENTS` control, self, info, full state, embedded apps, and links events; `DESTROY_MEETING` and `REMOTE_RESPONSE` for meeting lifecycle. Each update compares the incoming subdocument with the stored raw copy (deep equality, or count and state for embedded apps) and emits only on change. | Parent Meeting and consumers need domain-specific deltas for members, self, controls, media shares, host, embedded apps, and meeting lifecycle, not an undifferentiated Locus payload. | `src/locus-info/index.ts`, `src/locus-info/controlsUtils.ts`, `src/locus-info/selfUtils.ts` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/controlsUtils.js`, `test/unit/spec/locus-info/selfUtils.js` | none | PRESENT |
|
|
199
|
+
| `LOCUS-INFO-R-007` | `LocusErrorCodes` is the shared catalogue of raw Locus `errorCode` values the client branches on: `LOCUS_INACTIVE` (`2403004`), read by the hash-tree parser's meeting-ended check, and `LOCUS_USER_FULL` (`2423001`), read by Meeting. When constructing the hash-tree parser, `LocusInfo` injects `isLlmExpected: () => this.parsedLocus.self?.joinedWith?.state === 'JOINED'`, and when `updateSelf()` turns that from false to true it calls `reevaluateLlmWatchdogs()` on every parser. | These numeric codes cross module boundaries and drive caller-visible decisions, so their values are contracts, not internal constants. Anchoring the LLM expectation on `joinedWith` prevents heartbeat watchdogs from supervising a transport this device does not hold, and the re-evaluation arms watchdogs skipped before the device joined (code comment). | `src/locus-info/types.ts`, `src/locus-info/index.ts`, `src/hashTree/hashTreeParser.ts`, `src/meeting/index.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
200
|
+
| `LOCUS-INFO-R-008` | `createHashTreeParser()` stops every other active parser, records the new `replacedAt` on them when known, stores the new entry by Locus URL with `initializedFromHashTree: false`, and clears the object id to participant id map. A stopped parser is reactivated only when this device's `replaces` entry has a `replacedAt` newer than the one stored for it; the parser it replaces is then stopped. The first `OBJECTS_UPDATED` after creation or reactivation starts from an empty Locus and sets `forceReplaceMembers`, except for a parser created from a full join-response Locus, which counts as initialized. | Locus only sends updates for the current Locus URL, and a move from breakout A to breakout B and back to A must reuse A's parser; a new URL starts from a clean state (code comments). | `src/locus-info/index.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
201
|
+
| `LOCUS-INFO-R-009` | On `MEETING_ENDED` from a parser, `LocusInfo` destroys its meeting with `SELF_REMOVED` when the meeting is still in the collection; on `LOCUS_NOT_FOUND` it calls `webex.meetings.syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true})` and logs a rejection. | The parser reports that the meeting ended or that the Locus URL no longer exists (a 404 means it was replaced or ended, per the hash-tree parser's comment), so the meeting must be removed or its Locus found again. | `src/locus-info/index.ts`, `src/hashTree/hashTreeParser.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
202
|
+
| `LOCUS-INFO-R-010` | `isMeetingActive()` decides the end of a meeting. For `CALL`, `SIP_BRIDGE`, and `SPACE_SHARE` it sends the `updateMeeting` partner, then emits `DESTROY_MEETING` with `CALL_INACTIVE` (full state inactive), `PARTNER_LEFT` (partner left while self declined, notified, or joined; `shouldLeave` when self `joinedWith` is not left), or `SELF_LEFT` (self left while the partner left, declined, was notified, or idle), each after a `client.call.remote-ended` client event. For `MEETING` it emits `MEETING_INACTIVE_TERMINATING` when the whole meeting ended, or `SELF_REMOVED` when self is removed. | Locus reports the end through state rather than a dedicated event, so Meeting relies on these reasons to tear down; code comments note a removed guest gets no further events. | `src/locus-info/index.ts`, `src/meetings/util.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
203
|
+
| `LOCUS-INFO-R-011` | `suspendDestroyMeeting(true)` makes `isMeetingActive()` suppress the meeting-type `DESTROY_MEETING` and send `DESTROY_MEETING_WHILE_SUSPENDED` instead; the 1:1 paths send the metric and `joinInProgress: true` in the client event. `suspendDestroyMeeting(false)` restores emission. | The method JSDoc: `joinWithMedia` uses it to prevent meeting destruction during retry flows. | `src/locus-info/index.ts`, `src/meeting/index.ts` | `test/unit/spec/locus-info/index.js` | The 1:1 paths still emit `DESTROY_MEETING`; see the Evidence register observation | PRESENT |
|
|
204
|
+
| `LOCUS-INFO-R-012` | Main session DTOs are cached: `updateLocusCache()` merges each main session DTO into `mainSessionLocusCache`, merging participants by id. `getTheLocusToUpdate()` returns a copy of the cache when a classic event returns the user from a breakout to the main session (or when the creator's session switch needs it), and clears the cache when the main session is no longer active or self was removed from it. | Locus does not send the full main session participant list on return from a breakout or when a host or cohost leaves a breakout (code comments). | `src/locus-info/index.ts`, `src/locus-info/controlsUtils.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
205
|
+
| `LOCUS-INFO-R-013` | When members are replaced, `onDeltaLocus()` copies self into participants if it is missing; a hash-tree SELF update for a webinar attendee also adds a participant built from self; a hash-tree participant matching self identity with state `LEFT` and reason `MOVED` is copied into self. | The web app relies on a self participant while Locus briefly sends none during breakout moves, webinar attendees get no participant for themselves, and the participant update for a move often arrives over LLM before self (code comments). | `src/locus-info/index.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
206
|
+
| `LOCUS-INFO-R-014` | `updateLocusInfo()` ignores a DTO for which `MeetingsUtil.isSelfMovedOrBreakoutEnded()` is true and returns false, so `onDeltaLocus()` sends no participant update for it. | When moved to a breakout, Locus sends a message for the previous Locus saying self was moved, which would otherwise be read as leaving the call (code comment). | `src/locus-info/index.ts`, `src/meetings/util.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
207
|
+
| `LOCUS-INFO-R-015` | `initialSetup()` handles three triggers: `locus-message` (a hash-tree message must carry a Metadata object with `visibleDataSets`, otherwise it throws; a classic message is applied as a full Locus), `join-response` (full Locus, with a hash-tree parser when `dataSets` are present), and `get-loci-response` (a parser when the Locus has a visibleDataSets link). It awaits the parser initialization, calls `onLocusSynced` with the join-response Locus or the classic GET loci Locus, otherwise with a snapshot of current state, logs a callback error, and sets `emitChange`. | Meetings creates a meeting object before setup and destroys it when setup throws (code comment and `src/meetings/index.ts`); the snapshot gives the caller full state even when only hash-tree messages arrived. | `src/locus-info/index.ts`, `src/meetings/index.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
208
|
+
| `LOCUS-INFO-R-016` | `sync()` syncs all hash-tree datasets when the meeting uses hash trees and `canSyncHashTree` is set; otherwise, when `canSyncClassicLocus` is set and the meeting has a Locus URL, it pauses the parser and awaits `doLocusSync()` with `destroyOnTransientFailure: false`. | A reconnection must not tear down the meeting on a transient failure and must not fetch a DTO for a meeting without a Locus URL; signed-in users resync classic meetings through `getActiveMeetings` instead (method JSDoc). | `src/locus-info/index.ts`, `src/meetings/index.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
209
|
+
| `LOCUS-INFO-R-017` | `handleLocusAPIResponse()` accepts a wrapped body (`{dataSets, locus, metadata}`) or a bare Locus. In hash-tree mode it passes it to the active parser for its Locus URL, or switches or creates a parser when none is active; in classic mode it queues the Locus as a delta. | Locus returns the whole Locus unwrapped for meeting-wide actions such as mute all (type comment), and a response can name a new Locus URL after a breakout move. | `src/locus-info/index.ts`, `src/meeting/util.ts` | `test/unit/spec/locus-info/index.js` | none | PRESENT |
|
|
210
|
+
| `LOCUS-INFO-R-018` | `updateMeetingInfo()` re-parses info when the info, the self roles, or the joined state changes, using the stored info when the update has none, then emits `MEETING_LOCKED` or `MEETING_UNLOCKED` on a lock change and `MEETING_INFO_UPDATED` with `isInitializing` when no self was passed. | The display hints depend on info, roles, and joined state, and a delta that turns self JOINED often carries no info (code comment). | `src/locus-info/index.ts`, `src/locus-info/infoUtils.ts` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/infoUtils.js` | none | PRESENT |
|
|
211
|
+
|
|
212
|
+
## Design overview
|
|
213
|
+
|
|
214
|
+
`LocusInfo` owns the normalized meeting projection. The utility files compare individual Locus
|
|
215
|
+
domains, while `parser.ts` serializes classic delta application and asks `LocusInfo` to run
|
|
216
|
+
`doLocusSync()` when a gap requires the meeting request to fetch a delta or full DTO.
|
|
217
|
+
|
|
218
|
+
A meeting runs in one of two modes, chosen by what Locus sends:
|
|
219
|
+
|
|
220
|
+
- Classic: full DTOs and deltas with `sequence`, `baseSequence`, and `syncUrl`. Full DTOs pass the
|
|
221
|
+
freshness check in `parser.isNewFullLocus()`; deltas go through the parser queue.
|
|
222
|
+
- Hash tree: once any `HashTreeParser` exists (`isUsingHashTrees()`), Locus messages and API
|
|
223
|
+
responses go to the parser for their Locus URL. The parser calls `updateFromHashTree()` with the
|
|
224
|
+
objects that changed; `LocusInfo` builds a Locus-shaped object from the current state and those
|
|
225
|
+
objects (`updateLocusFromHashTreeObject()`) and applies it through `onDeltaLocus()`. It keeps a map
|
|
226
|
+
from hash-tree object ids to participant ids so a removed participant object can be reported as a
|
|
227
|
+
removed participant id.
|
|
228
|
+
|
|
229
|
+
Both modes end in the same update functions, so Meeting sees one projection and one set of events.
|
|
230
|
+
Each `update*()` function compares the incoming subdocument with the raw copy it stored last time,
|
|
231
|
+
asks the matching utility for the parsed form and change flags, calls `updateMeeting`, and emits the
|
|
232
|
+
scoped events for the flags that are set.
|
|
233
|
+
|
|
234
|
+
```mermaid
|
|
235
|
+
flowchart LR
|
|
236
|
+
LocusEvent[Locus full or delta event] --> Info[index.ts]
|
|
237
|
+
HashTreeEvent[Hash tree message or API response] --> HT[HashTreeParser]
|
|
238
|
+
HT --> Info
|
|
239
|
+
Info --> Parser[parser.ts delta sequencer]
|
|
240
|
+
Parser --> Info
|
|
241
|
+
Info --> Utils[controls/self/info/media-share/host/app utils]
|
|
242
|
+
Parser --> Sync[LocusInfo.doLocusSync]
|
|
243
|
+
Sync --> Request[meetingRequest.getLocusDTO]
|
|
244
|
+
Request --> Info
|
|
245
|
+
Utils --> Projection[normalized meeting projection + change flags]
|
|
246
|
+
Projection --> Meeting[updateMeeting callback and scoped events]
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Data flow and sequence coverage
|
|
250
|
+
|
|
251
|
+
Call style: in-process method calls from Meeting and Meetings; outbound HTTPS only through
|
|
252
|
+
`meeting.meetingRequest.getLocusDTO` and the `webex.request` function injected into each
|
|
253
|
+
`HashTreeParser`; outbound in-process events through `EventsScope`.
|
|
254
|
+
|
|
255
|
+
Sequence coverage:
|
|
256
|
+
|
|
257
|
+
| Operation group | Diagram | Failure coverage |
|
|
258
|
+
|---|---|---|
|
|
259
|
+
| Classic full and delta Locus projection (UC-1, UC-2, UC-5) | Diagram 1 — classic Locus projection primary sequence | older full DTO ignored, duplicate or stale delta (`USE_CURRENT`) ignored, out-of-order delta blocks the parser, moved self ignored |
|
|
260
|
+
| Classic recovery and caller-driven sync (UC-3) | Diagram 2 — classic Locus recovery alternate/failure sequence | missing sequence range, delta sync failure with full fallback, 403, transient failure with and without destroy, invalid DTO, apply failure, parser resume |
|
|
261
|
+
| Hash-tree updates (UC-4, UC-5) | Diagram 3 — hash-tree update | meeting ended, Locus not found, unexpected transport shape metric |
|
|
262
|
+
| Hash-tree parser switch on breakout moves (UC-4, UC-6) | Diagram 4 — parser switch | replacement not newer, missing metadata, missing Locus URL |
|
|
263
|
+
| Meeting end detection | `src/locus-info/index.ts` (`isMeetingActive`, LOCUS-INFO-R-010, LOCUS-INFO-R-011) | suppression while destroy is suspended |
|
|
264
|
+
|
|
265
|
+
Diagram 1 — classic Locus projection primary sequence:
|
|
266
|
+
|
|
267
|
+
```mermaid
|
|
268
|
+
sequenceDiagram
|
|
269
|
+
participant E as Locus event
|
|
270
|
+
participant L as LocusInfo
|
|
271
|
+
participant P as parser.ts
|
|
272
|
+
participant M as Meeting
|
|
273
|
+
E-->>L: parse(meeting, data) with full DTO or delta
|
|
274
|
+
alt full DTO event
|
|
275
|
+
L->>P: isNewFullLocus(locus)
|
|
276
|
+
alt newer than the working copy
|
|
277
|
+
L->>L: onFullLocus applies the authoritative projection
|
|
278
|
+
L->>P: workingCopy = locus
|
|
279
|
+
else not newer
|
|
280
|
+
L->>L: ignore old full Locus DTO
|
|
281
|
+
end
|
|
282
|
+
else delta (locus.difference)
|
|
283
|
+
L->>L: handleLocusDelta(locus)
|
|
284
|
+
L->>P: onDeltaEvent queues and compares the delta
|
|
285
|
+
alt contiguous delta (USE_INCOMING)
|
|
286
|
+
P->>L: onDeltaAction(USE_INCOMING)
|
|
287
|
+
L->>L: onDeltaLocus applies utility comparisons
|
|
288
|
+
else stale delta (USE_CURRENT)
|
|
289
|
+
P->>P: ignore
|
|
290
|
+
else out-of-order delta (WAIT)
|
|
291
|
+
P->>P: put it back, BLOCKED, start sync timer
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
L-->>M: updateMeeting(...) and scoped events for changed fields
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Diagram 2 — classic Locus recovery alternate/failure sequence:
|
|
298
|
+
|
|
299
|
+
```mermaid
|
|
300
|
+
sequenceDiagram
|
|
301
|
+
participant E as Locus delta input or caller sync()
|
|
302
|
+
participant L as LocusInfo
|
|
303
|
+
participant P as parser.ts sequencer
|
|
304
|
+
participant R as meetingRequest.getLocusDTO
|
|
305
|
+
participant S as webex.meetings
|
|
306
|
+
E-->>L: delta with sequence range, or sync(meeting, {canSyncClassicLocus})
|
|
307
|
+
alt gap, too many queued deltas, timer expiry, or caller sync
|
|
308
|
+
P->>P: pause (PAUSED)
|
|
309
|
+
P->>L: onDeltaAction(DESYNC) or sync() calls doLocusSync
|
|
310
|
+
L->>R: getLocusDTO(syncUrl for a delta, else Locus URL)
|
|
311
|
+
alt delta fetch rejects without 403
|
|
312
|
+
L->>R: getLocusDTO(meeting.locusUrl) full fallback
|
|
313
|
+
end
|
|
314
|
+
alt synchronization succeeds
|
|
315
|
+
R-->>L: delta, full DTO, or empty body
|
|
316
|
+
L->>L: handleLocusDelta (delta) or onFullLocus applies the full DTO
|
|
317
|
+
opt applying it throws
|
|
318
|
+
L->>L: send LOCUS_SYNC_HANDLING_FAILED and resolve
|
|
319
|
+
end
|
|
320
|
+
L->>P: resume queued deltas after handling settles
|
|
321
|
+
else terminal 403, or transient failure with destroyOnTransientFailure
|
|
322
|
+
R--xL: rejected request
|
|
323
|
+
L->>S: destroy(meeting, LOCUS_DTO_SYNC_FAILED)
|
|
324
|
+
L->>P: do not resume destroyed meeting parser
|
|
325
|
+
else transient failure from sync()
|
|
326
|
+
R--xL: rejected request
|
|
327
|
+
L->>P: resume
|
|
328
|
+
L--xE: reject so the caller can retry
|
|
329
|
+
end
|
|
330
|
+
else stale or applicable delta
|
|
331
|
+
P->>P: ignore stale input or apply current delta
|
|
332
|
+
end
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
Diagram 3 — hash-tree update:
|
|
336
|
+
|
|
337
|
+
```mermaid
|
|
338
|
+
sequenceDiagram
|
|
339
|
+
participant M as Meeting or Meetings
|
|
340
|
+
participant L as LocusInfo
|
|
341
|
+
participant H as HashTreeParser
|
|
342
|
+
participant S as webex.meetings
|
|
343
|
+
M->>L: parse(meeting, {eventType: locus.state_message, stateElementsMessage})
|
|
344
|
+
L->>L: handleHashTreeParserSwitch (Diagram 4) or pick the entry for locusUrl
|
|
345
|
+
L->>H: handleMessage(message)
|
|
346
|
+
H-->>L: updateFromHashTree(locusUrl, update)
|
|
347
|
+
alt OBJECTS_UPDATED
|
|
348
|
+
L->>L: build Locus from current state (empty on the first update) and apply each object
|
|
349
|
+
L->>L: onDeltaLocus(locus)
|
|
350
|
+
else MEETING_ENDED
|
|
351
|
+
L->>S: destroy(meeting, SELF_REMOVED)
|
|
352
|
+
else LOCUS_NOT_FOUND
|
|
353
|
+
L->>S: syncMeetings({keepOnlyLocusMeetings: false, skipHashTreeSync: true})
|
|
354
|
+
end
|
|
355
|
+
opt event type is not locus.state_message in hash-tree mode
|
|
356
|
+
L->>L: sendClassicVsHashTreeMismatchMetric and drop the event
|
|
357
|
+
end
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
Diagram 4 — parser switch:
|
|
361
|
+
|
|
362
|
+
```mermaid
|
|
363
|
+
sequenceDiagram
|
|
364
|
+
participant M as Hash tree message or API response
|
|
365
|
+
participant L as LocusInfo
|
|
366
|
+
participant A as Active HashTreeParser
|
|
367
|
+
participant B as Parser for the incoming Locus URL
|
|
368
|
+
M->>L: message or response for locusUrl B
|
|
369
|
+
alt no entry for B
|
|
370
|
+
opt message has Metadata with visibleDataSets, or response has a Locus URL
|
|
371
|
+
L->>A: stop() and record replacedAt
|
|
372
|
+
L->>B: create, then handleMessage or initializeFromGetLociResponse
|
|
373
|
+
end
|
|
374
|
+
else entry for B is stopped
|
|
375
|
+
alt replaces.replacedAt is newer than B's replacedAt
|
|
376
|
+
L->>A: stop() the replaced parser
|
|
377
|
+
L->>B: resumeFromMessage or resumeFromApiResponse
|
|
378
|
+
else not newer or no replaces info
|
|
379
|
+
L->>L: log and drop
|
|
380
|
+
end
|
|
381
|
+
else entry for B is active
|
|
382
|
+
L->>B: handleMessage or handleLocusUpdate
|
|
383
|
+
end
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
## Class and component relationships
|
|
387
|
+
|
|
388
|
+
```mermaid
|
|
389
|
+
classDiagram
|
|
390
|
+
class EventsScope
|
|
391
|
+
class LocusInfo {
|
|
392
|
+
parsedLocus
|
|
393
|
+
hashTreeParsers
|
|
394
|
+
mainSessionLocusCache
|
|
395
|
+
initialSetup(data, onLocusSynced)
|
|
396
|
+
parse(meeting, data)
|
|
397
|
+
handleLocusAPIResponse(meeting, responseBody)
|
|
398
|
+
sync(meeting, options)
|
|
399
|
+
cleanUp()
|
|
400
|
+
}
|
|
401
|
+
class Parser {
|
|
402
|
+
status
|
|
403
|
+
queue
|
|
404
|
+
workingCopy
|
|
405
|
+
onDeltaEvent(loci)
|
|
406
|
+
pause()
|
|
407
|
+
resume()
|
|
408
|
+
}
|
|
409
|
+
class HashTreeParser
|
|
410
|
+
class Utils
|
|
411
|
+
class Request
|
|
412
|
+
class Projection
|
|
413
|
+
class LocusEvent
|
|
414
|
+
EventsScope <|-- LocusInfo
|
|
415
|
+
LocusEvent --> LocusInfo : Meeting and Meetings call parse
|
|
416
|
+
LocusInfo *-- Parser : locusParser
|
|
417
|
+
LocusInfo o-- HashTreeParser : one entry per Locus URL
|
|
418
|
+
HashTreeParser --> LocusInfo : updateFromHashTree callback
|
|
419
|
+
LocusInfo ..> Utils : controls, self, info, fullState, host, mediaShares, embeddedApps
|
|
420
|
+
LocusInfo ..> Request : meeting.meetingRequest.getLocusDTO in doLocusSync
|
|
421
|
+
LocusInfo --> Projection : updateMeeting callback and scoped events
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
The arrows identify ownership and delegation inside `src/locus-info/`; files that only declare types
|
|
425
|
+
or constants are not presented as transports. `HashTreeParser` belongs to `src/hashTree` and is
|
|
426
|
+
created and owned here.
|
|
427
|
+
|
|
428
|
+
## Use cases and flows
|
|
429
|
+
|
|
430
|
+
| Use case | Actor or caller | Primary steps and outcome | Failure or boundary behavior | Evidence |
|
|
431
|
+
| -------- | --------------- | ------------------------- | ---------------------------- | -------- |
|
|
432
|
+
| `UC-001` | Meeting after join, Meetings for a new Locus event or GET loci | Initialize from a full Locus API response, Locus message, or GET loci response and project self, host, participants, controls, links, meeting info, shares, embedded apps, and replacement state; create a hash-tree parser when datasets are present | A hash-tree message without Metadata visibleDataSets throws and Meetings destroys the meeting | `src/locus-info/index.ts`, `src/meetings/index.ts`, `test/unit/spec/locus-info/index.js` |
|
|
433
|
+
| `UC-002` | Meeting receiving Mercury Locus events or API responses | Serialize incoming Locus deltas so only one queued event mutates the projection at a time | Stale deltas are ignored; invalid loci are skipped | `src/locus-info/parser.ts`, `src/locus-info/index.ts`, `test/unit/spec/locus-info/parser.js` |
|
|
434
|
+
| `UC-003` | The parser, or Meetings after a reconnection | Pause/block parsing and run the Locus sync when sequence comparison finds missing or out-of-order state, or when `sync()` is called | Full fallback, destroy on terminal or default failure, reject on a transient failure from `sync()` | `src/locus-info/parser.ts`, `src/locus-info/index.ts`, `test/unit/spec/locus-info/index.js` |
|
|
435
|
+
| `UC-004` | Meeting receiving hash-tree messages and API responses | Convert hash-tree messages and API responses into Locus updates through the parser for their Locus URL, switching parsers on breakout moves; emit the existing diagnostic when an update arrives in the unexpected transport shape; no classic-vs-hash-tree value comparison is performed | Meeting ended destroys the meeting; Locus not found resyncs meetings | `src/locus-info/index.ts`, `src/hashTree/hashTreeParser.ts`, `test/unit/spec/locus-info/index.js` |
|
|
436
|
+
| `UC-005` | Meeting listening to LocusInfo | Emit scoped callbacks only for the Locus subdocuments that changed, preserving Meeting, Members, and controller ownership | A moved-self DTO is ignored; unchanged subdocuments emit nothing except the participants update | `src/locus-info/index.ts`, `src/locus-info/controlsUtils.ts`, `src/locus-info/embeddedAppsUtils.ts`, `src/locus-info/mediaSharesUtils.ts` |
|
|
437
|
+
| `UC-006` | Meeting moving between main session and breakouts | Maintain and clear distinct current and main-session Locus caches as breakout session context changes | The cache is cleared when the main session is inactive or self was removed | `src/locus-info/index.ts`, `src/locus-info/controlsUtils.ts`, `test/unit/spec/locus-info/index.js` |
|
|
438
|
+
|
|
439
|
+
### Cross-boundary use-case flow
|
|
440
|
+
|
|
441
|
+
| Boundary | Transport and ordering | Compatibility | Timeout, retry, and recovery |
|
|
442
|
+
| -------- | ---------------------- | ------------- | ---------------------------- |
|
|
443
|
+
| Locus DTO fetch (`UC-003`) | HTTPS through `meeting.meetingRequest.getLocusDTO`; delta first, then one full fallback | An empty body means the client already has the latest DTO; a delta body is recognized by `baseSequence` | No retry here; the reconnection caller retries after a rejection |
|
|
444
|
+
| Hash-tree dataset requests (`UC-001`, `UC-004`) | HTTPS issued by `HashTreeParser` through the injected `webex.request`; syncs run one parser at a time in `syncAllHashTreeDatasets` | Excluded datasets come from `meetings.locus.excludedDataSets` | Owned by the hash tree module |
|
|
445
|
+
| Meetings collection (`UC-003`, `UC-004`) | In-process calls to `webex.meetings.destroy` and `syncMeetings` | Removal reasons from `src/constants.ts` | A `syncMeetings` rejection is logged |
|
|
446
|
+
| Meeting (`UC-005`) | Synchronous `updateMeeting` callback and `EventsScope` events, in update order | Event names and payloads from `src/constants.ts` | — |
|
|
447
|
+
|
|
448
|
+
<!-- Include if: the module holds client-side state. [condition-id: module.holds_client_state] -->
|
|
449
|
+
|
|
450
|
+
## Client state model
|
|
451
|
+
|
|
452
|
+
Normalized Locus, sequence state, hash-tree parser entries, partner, self, and member projections,
|
|
453
|
+
and the destroy-suspension flag are held per meeting on one `LocusInfo` instance; dataset hashes
|
|
454
|
+
live in each `HashTreeParser`.
|
|
455
|
+
|
|
456
|
+
| State or slice | Owner | Initial state | Transition triggers | Reset or persistence boundary |
|
|
457
|
+
| -------------- | ---------- | ------------- | ------------------- | ----------------------------- |
|
|
458
|
+
| Parsed projection (`parsedLocus`: controls, self, host, info, fullState, mediaShares, and the self `states` history) | `LocusInfo` | `{states: []}` | Each `update*()` call that sees a change | Instance memory for the meeting's life |
|
|
459
|
+
| Raw subdocument copies (`controls`, `self`, `host`, `info`, `fullState`, `mediaShares`, `embeddedApps`, `links`, `participants`, `url`, `sequence`, and others) | `LocusInfo` | `undefined` | Stored after each comparison; compared with the next update | Instance memory |
|
|
460
|
+
| Delta parser (`status`, `queue`, `workingCopy`, `syncTimer`) | `parser.ts` | `IDLE`, empty queue, `null` working copy | Deltas, sync start and resume, full DTOs | See State machine |
|
|
461
|
+
| Hash-tree parser entries (`hashTreeParsers` by Locus URL, with `replacedAt` and `initializedFromHashTree`) | `LocusInfo` | Empty map | Created on hash-tree input; stopped or reactivated on breakout moves | `cleanUp()` cleans up and clears them |
|
|
462
|
+
| Object id to participant id map | `LocusInfo` | Empty map | Participant objects added or removed; cleared on parser creation, reactivation, and `cleanUp()` | Instance memory |
|
|
463
|
+
| Main session cache (`mainSessionLocusCache`) | `LocusInfo` | `undefined` | `updateLocusCache` merges main session DTOs; `getTheLocusToUpdate` clears it | Instance memory |
|
|
464
|
+
| Flags (`destroyMeetingSuspended`, `compareAndUpdateFlags`, `emitChange`, mismatch metric counter) | `LocusInfo` | `false`, `{}`, `false`, `0` | `suspendDestroyMeeting`, host and self updates, the end of `initialSetup`, the mismatch metric | Instance memory |
|
|
465
|
+
|
|
466
|
+
<!-- Include if: the module enforces domain rules or entity invariants. [condition-id: module.enforces_domain_rules] -->
|
|
467
|
+
|
|
468
|
+
## Business rules and invariants
|
|
469
|
+
|
|
470
|
+
| ID | Invariant | WHY | Enforcement source | Test evidence |
|
|
471
|
+
| -- | --------- | --- | ------------------ | ------------- |
|
|
472
|
+
| `INV-001` | Older or mismatched updates must not silently replace newer state: a classic full DTO applies only when its last sequence entry is greater than the working copy's (or either sequence is empty), and a delta applies only on `USE_INCOMING`. | Applying stale Locus state would emit false meeting, member, and control events. | `src/locus-info/parser.ts`, `src/locus-info/index.ts` | `test/unit/spec/locus-info/parser.js`, `test/unit/spec/locus-info/index.js` |
|
|
473
|
+
| `INV-002` | The self participant exists in the participants of any update that replaces members, and a webinar attendee's self is copied into a participant. | The web app expects a self member at all times (code comments). | `src/locus-info/index.ts` | `test/unit/spec/locus-info/index.js` |
|
|
474
|
+
| `INV-003` | A meeting is in hash-tree mode exactly when `hashTreeParsers` is not empty, and `doLocusSync` is never run for it. | The two transports keep different sequence state, and the JSDoc forbids the classic sync for hash-tree meetings. | `src/locus-info/index.ts` | `test/unit/spec/locus-info/index.js` |
|
|
475
|
+
| `INV-004` | At most one hash-tree parser is active; creating or reactivating one stops the others. | Locus sends updates only for the current Locus URL (code comment). | `src/locus-info/index.ts` | `test/unit/spec/locus-info/index.js` |
|
|
476
|
+
| `INV-005` | Only one classic delta is processed at a time, in base sequence order. | The status field ensures one event at a time (code comment), so each comparison sees the last applied working copy. | `src/locus-info/parser.ts` | `test/unit/spec/locus-info/parser.js` |
|
|
477
|
+
|
|
478
|
+
<!-- Include if: the module is concurrent, asynchronous, reactive, or event-driven. [condition-id: module.is_concurrent_async] -->
|
|
479
|
+
|
|
480
|
+
## Concurrency and reactive flow
|
|
481
|
+
|
|
482
|
+
- Execution model: one JavaScript event loop. Delta processing is synchronous inside
|
|
483
|
+
`onDeltaEvent`; Locus syncs and hash-tree initialization are promises; hash-tree callbacks arrive
|
|
484
|
+
whenever a parser applies a message or finishes a sync.
|
|
485
|
+
- Ordering guarantees: Delta inputs are ordered by the parser's sequence state. A gap or a too-long
|
|
486
|
+
out-of-order wait enters the parser's synchronization path, the parser stays paused until the
|
|
487
|
+
fetched delta or full DTO is handled, and stale inputs follow the comparison result instead of
|
|
488
|
+
being applied speculatively. `syncAllHashTreeDatasets` syncs parsers one after another.
|
|
489
|
+
- Idempotency and retry: every `update*()` call is a no-op for an unchanged subdocument; a full DTO
|
|
490
|
+
that is not newer is ignored; this module does not retry a failed sync itself, and `sync()` rejects
|
|
491
|
+
so its caller can.
|
|
492
|
+
- Shared-state protection: none beyond the parser status. A classic `DESYNC` sync is started without
|
|
493
|
+
awaiting; the `finally` resume is the only re-entry point. The `LOCUS_URL_CHANGED` sync does not
|
|
494
|
+
pause the parser (see the Evidence register observation).
|
|
495
|
+
- Blocking restrictions: no work blocks the event loop; the out-of-order wait is a timer of 10 to 15
|
|
496
|
+
seconds, cleared when the missing delta arrives or a sync starts.
|
|
497
|
+
|
|
498
|
+
<!-- Include if: the module has non-trivial state transitions. [condition-id: module.stateful_transitions] -->
|
|
499
|
+
|
|
500
|
+
## State machine
|
|
501
|
+
|
|
502
|
+
```mermaid
|
|
503
|
+
stateDiagram-v2
|
|
504
|
+
[*] --> IDLE
|
|
505
|
+
IDLE --> WORKING: dequeue delta
|
|
506
|
+
WORKING --> IDLE: queue drained
|
|
507
|
+
WORKING --> BLOCKED: missing predecessor
|
|
508
|
+
BLOCKED --> WORKING: predecessor arrives
|
|
509
|
+
BLOCKED --> PAUSED: sync timer expires or more than 5 queued
|
|
510
|
+
WORKING --> PAUSED: full sync starts
|
|
511
|
+
IDLE --> PAUSED: sync() pauses for a caller-driven sync
|
|
512
|
+
PAUSED --> WORKING: resume after sync
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
The diagram uses the parser's `IDLE`, `WORKING`, `BLOCKED`, and `PAUSED` values from
|
|
516
|
+
`src/locus-info/parser.ts`.
|
|
517
|
+
|
|
518
|
+
- Guards: `nextEvent` does nothing while `PAUSED` or `BLOCKED`; `onDeltaEvent` only enqueues while
|
|
519
|
+
`WORKING` or `PAUSED`, and while `BLOCKED` it processes the head of the queue again unless more
|
|
520
|
+
than 5 deltas are queued.
|
|
521
|
+
- Rejected transitions: none are guarded; `resume()` sets `WORKING` from any state and drains the
|
|
522
|
+
queue.
|
|
523
|
+
- No state is terminal. A meeting destroyed by a failed sync is never resumed, so after a `DESYNC`
|
|
524
|
+
sync its parser stays `PAUSED`.
|
|
525
|
+
|
|
526
|
+
<!-- Include if: callers depend on a wire protocol or serialized format. [condition-id: module.exposes_wire_protocol] -->
|
|
527
|
+
|
|
528
|
+
## Protocol and wire format
|
|
529
|
+
|
|
530
|
+
External payloads are parsed by files under `src/locus-info/` and by `src/hashTree`. Preserve
|
|
531
|
+
current field names, enum and raw values, sequence identifiers, and compatibility behavior; do not
|
|
532
|
+
treat the normalized client model as the wire schema. The Locus DTO itself is owned by the Locus
|
|
533
|
+
service; `src/locus-info/types.ts` types only the fields the client reads.
|
|
534
|
+
|
|
535
|
+
| Message or frame | Version | Producer or serializer | Consumer or parser | Compatibility and ordering rule |
|
|
536
|
+
| ---------------- | ------- | ---------------------- | ------------------ | ------------------------------- |
|
|
537
|
+
| Classic full Locus DTO | Unversioned | Locus, through Mercury events and API responses | `onFullLocus` in `src/locus-info/index.ts` | `sequence.entries` last value orders full DTOs; `meeting`, `participants`, and every subdocument are read |
|
|
538
|
+
| Classic Locus delta | Unversioned | Locus `locus.difference` events, API responses, and `syncUrl` fetches | `src/locus-info/parser.ts` | `baseSequence`, `sequence` (`rangeStart`, `rangeEnd`, `entries`), `syncUrl`, `url`; a delta with equal base sequence and sequence requests a sync |
|
|
539
|
+
| Mercury Locus event types | Unversioned | Locus through Mercury | `parse` in `src/locus-info/index.ts` | Participant, controls, self, floor, and declined events carry a full DTO; `locus.difference` and unknown types carry a delta |
|
|
540
|
+
| Hash-tree message (`LocusLLMEvent`, `locus.state_message`) | Unversioned | Locus over Mercury or LLM | `src/hashTree/hashTreeParser.ts`, then `updateFromHashTree` | `locusUrl`, `dataSets`, `locusStateElements` with `htMeta.elementId` type, id, and version; object types map to Locus keys through `ObjectTypeToLocusKeyMap` |
|
|
541
|
+
| Locus API response (`LocusApiResponseBody`) | Unversioned | Locus REST responses | `handleLocusAPIResponse` | Wrapped `{dataSets, locus, metadata}` or a bare Locus DTO |
|
|
542
|
+
| `replaces` entry on this device | Unversioned | Locus self devices | `findMeetingForHashTreeMessage`, parser switch | `locusUrl`, `replacedAt` (compared as strings), `sessionId` |
|
|
543
|
+
| `LocusErrorCodes`, `EndMeetingReason` | Unversioned | Locus error bodies and `fullState.endMeetingReason` | `src/hashTree/hashTreeParser.ts`, `src/meeting/index.ts`, `src/meetings/util.ts` | Raw numeric codes and string reasons are compared exactly |
|
|
544
|
+
|
|
545
|
+
<!-- Include if: the module returns or raises errors callers must handle. [condition-id: module.returns_caller_errors] -->
|
|
546
|
+
|
|
547
|
+
## Caller-visible failure modes
|
|
548
|
+
|
|
549
|
+
| Condition | Signal | Caller recovery |
|
|
550
|
+
|---|---|---|
|
|
551
|
+
| Delta sequence is stale, out of order, or has a missing range | `parser.ts` follows its sequence comparison result: stale input is ignored, an out-of-order delta blocks the parser until its predecessor arrives or the timer or queue limit starts a sync, and a gap requests synchronization. | Wait for the synchronized DTO before consuming later projected changes. |
|
|
552
|
+
| `getLocusDTO()` rejects during `doLocusSync()` | `doLocusSync()` returns a promise. A 403 is terminal: it destroys the meeting with `LOCUS_DTO_SYNC_FAILED` and resolves. A transient failure destroys and resolves on the delta path (the default), and rejects without destroying when `sync()` set `destroyOnTransientFailure: false`. Its `finally` resumes the parser when the meeting survives. | On the delta path observe the owning meeting lifecycle; a `sync()` caller retries after a rejection. |
|
|
553
|
+
| The DTO is fetched but applying it throws | `doLocusSync()` sends `LOCUS_SYNC_HANDLING_FAILED`, resolves, and resumes the parser. | Nothing to retry; later deltas or a later sync bring the state up to date. |
|
|
554
|
+
| Full/API/hash-tree input is accepted | `LocusInfo` updates its normalized projection and invokes only the callbacks for changed member, self, control, share, host, app, or lifecycle fields. | Consume the scoped change callback rather than the raw Locus payload. |
|
|
555
|
+
| `initialSetup()` gets a `locus-message` whose hash-tree message has no Metadata with `visibleDataSets` | It throws `Error('Metadata object with visibleDataSets is missing in the message')`. | Meetings destroys the partially created meeting. |
|
|
556
|
+
| Hash-tree initialization in `initialSetup()` gets a 404 or a 409 with `LOCUS_INACTIVE` | The awaited parser initialization rejects with `LocusNotFoundError` or `MeetingEndedError`, so `initialSetup()` rejects. | The caller destroys or abandons the meeting. |
|
|
557
|
+
| `onFullLocus()` receives `dataSets` without metadata | It throws an `Error` saying the hash tree metadata is missing. | Pass the metadata from the same response. |
|
|
558
|
+
|
|
559
|
+
## Pitfalls and constraints
|
|
560
|
+
|
|
561
|
+
- Full, delta, and hash-tree messages can overlap or arrive out of order. Updating callbacks before
|
|
562
|
+
reconciliation creates transient false state.
|
|
563
|
+
- `LocusInfo` is not exported from `src/index.ts`; its behavior is reachable only through the parent
|
|
564
|
+
`Meeting` (`meeting.locusInfo`) and `Meetings`, so a change here is a change to Meeting's events.
|
|
565
|
+
- `doLocusSync()` must not be used for hash-tree meetings; use `sync()` or
|
|
566
|
+
`syncAllHashTreeDatasets()`.
|
|
567
|
+
- `LOCUS_INFO_UPDATE_PARTICIPANTS` is emitted on every `updateParticipants()` call, changed or not;
|
|
568
|
+
the members module computes the real delta.
|
|
569
|
+
- The parser-switch path for API responses does not await or catch the parser initialization (see
|
|
570
|
+
the Evidence register observation), so a rejection there surfaces as an unhandled rejection.
|
|
571
|
+
- Main session participants come from the cache after a breakout; clearing the cache too early
|
|
572
|
+
loses the participant list.
|
|
573
|
+
|
|
574
|
+
## Verification
|
|
575
|
+
|
|
576
|
+
Use the current mirrored suites: `test/unit/spec/locus-info/controlsUtils.js`,
|
|
577
|
+
`test/unit/spec/locus-info/embeddedAppsUtils.js`, `test/unit/spec/locus-info/index.js`,
|
|
578
|
+
`test/unit/spec/locus-info/infoUtils.js`, `test/unit/spec/locus-info/mediaSharesUtils.ts`,
|
|
579
|
+
`test/unit/spec/locus-info/parser.js`, `test/unit/spec/locus-info/selfUtils.js`, with the fixtures
|
|
580
|
+
`test/unit/spec/locus-info/selfConstant.js`, `test/unit/spec/locus-info/lib/BasicSeqCmp.json`, and
|
|
581
|
+
`test/unit/spec/locus-info/lib/SeqCmp.json`. Run them with
|
|
582
|
+
`yarn workspace @webex/plugin-meetings test:unit --targets locus-info/index.js` (or another suite)
|
|
583
|
+
after `build:src`. Characterize the use cases above and each listed failure condition; add cleanup
|
|
584
|
+
or transition cases only for resources and state this module owns.
|
|
585
|
+
|
|
586
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
587
|
+
|---|---|---|
|
|
588
|
+
| `LOCUS-INFO-R-001` | `test/unit/spec/locus-info/index.js` | `init()` has no direct case; cover it with every changed-subdocument callback family |
|
|
589
|
+
| `LOCUS-INFO-R-002` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js` | none; full sync failure while the parser is blocked is covered by the out-of-order cases |
|
|
590
|
+
| `LOCUS-INFO-R-003` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js` | the destroyed meeting leaving the parser paused is not asserted |
|
|
591
|
+
| `LOCUS-INFO-R-004` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/parser.js` | none |
|
|
592
|
+
| `LOCUS-INFO-R-005` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/hashTree/hashTreeParser.ts` | none; the mismatch metric cap of 5 is asserted, and dataset recovery is verified separately in the hash-tree suite |
|
|
593
|
+
| `LOCUS-INFO-R-006` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/controlsUtils.js`, `test/unit/spec/locus-info/selfUtils.js` | `updateLinks` events and `LOCUS_INFO_CAN_ASSIGN_HOST` have no direct case |
|
|
594
|
+
| `LOCUS-INFO-R-007` | `test/unit/spec/locus-info/index.js` | covered for the `isLlmExpected` joined and self-joined-but-device-not-joined cases and for the watchdog re-evaluation; `LocusErrorCodes` values are asserted only where the hash-tree parser and Meeting use them |
|
|
595
|
+
| `LOCUS-INFO-R-008` | `test/unit/spec/locus-info/index.js` | none |
|
|
596
|
+
| `LOCUS-INFO-R-009` | `test/unit/spec/locus-info/index.js` | none |
|
|
597
|
+
| `LOCUS-INFO-R-010` | `test/unit/spec/locus-info/index.js` | none |
|
|
598
|
+
| `LOCUS-INFO-R-011` | `test/unit/spec/locus-info/index.js` | none |
|
|
599
|
+
| `LOCUS-INFO-R-012` | `test/unit/spec/locus-info/index.js` | none |
|
|
600
|
+
| `LOCUS-INFO-R-013` | `test/unit/spec/locus-info/index.js` | none; the missing-self copy is a parametrized `onDeltaLocus` case |
|
|
601
|
+
| `LOCUS-INFO-R-014` | `test/unit/spec/locus-info/index.js` | none |
|
|
602
|
+
| `LOCUS-INFO-R-015` | `test/unit/spec/locus-info/index.js` | rejection of the awaited hash-tree initialization is not asserted |
|
|
603
|
+
| `LOCUS-INFO-R-016` | `test/unit/spec/locus-info/index.js` | none |
|
|
604
|
+
| `LOCUS-INFO-R-017` | `test/unit/spec/locus-info/index.js` | none |
|
|
605
|
+
| `LOCUS-INFO-R-018` | `test/unit/spec/locus-info/index.js`, `test/unit/spec/locus-info/infoUtils.js` | none |
|
|
606
|
+
| `INV-001` to `INV-005` | `test/unit/spec/locus-info/parser.js`, `test/unit/spec/locus-info/index.js` | none |
|
|
607
|
+
|
|
608
|
+
Record coverage gaps explicitly and link follow-up work. A module specification is complete only
|
|
609
|
+
when its public surface, invariants, failure modes, and test evidence agree with the implementation.
|