@webex/plugin-meetings 3.12.0-next.15 → 3.12.0-next.150
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/.sdd/manifest.json +1312 -0
- package/.sdd/templates/.source.json +30 -0
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
- package/.sdd/templates/component-repo/template-map.json +112 -0
- package/AGENTS.md +135 -0
- package/ai-docs/ARCHITECTURE.md +207 -0
- package/ai-docs/CONTRACTS.md +267 -0
- package/ai-docs/DATA_MODEL.md +64 -0
- package/ai-docs/GETTING_STARTED.md +73 -0
- package/ai-docs/GLOSSARY.md +56 -0
- package/ai-docs/REVIEW_CHECKLIST.md +45 -0
- package/ai-docs/RULES.md +79 -0
- package/ai-docs/SECURITY.md +74 -0
- package/ai-docs/SERVICE_STATE.md +59 -0
- package/ai-docs/SPEC_INDEX.md +85 -0
- package/ai-docs/TEST_INDEX.md +45 -0
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
- package/ai-docs/patterns/defensive-error-propagation.md +55 -0
- package/ai-docs/patterns/event-scope-emission.md +46 -0
- package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
- package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
- package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/annotation/index.js +2 -2
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +99 -4
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +37 -10
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +46 -10
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/hashTree/constants.js +4 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1096 -391
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +20 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +75 -15
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +55 -12
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +615 -176
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/types.js +20 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +15 -2
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +4 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +7 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1684 -835
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +37 -3
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +2 -1
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +9 -3
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +300 -128
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +7 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +62 -15
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/constants.d.ts +13 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +1 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +201 -22
- package/dist/types/hashTree/utils.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +106 -8
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +22 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
- package/dist/types/media/properties.d.ts +6 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +6 -0
- package/dist/types/meeting/index.d.ts +176 -11
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +9 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +40 -19
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +6 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +3 -0
- package/dist/webinar/index.js +307 -161
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -23
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/annotation/ai-docs/annotation-spec.md +236 -0
- package/src/annotation/index.ts +6 -4
- package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +122 -2
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +2 -2
- package/src/constants.ts +21 -3
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
- package/src/controls-options-manager/index.ts +62 -10
- package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
- package/src/hashTree/constants.ts +7 -0
- package/src/hashTree/hashTreeParser.ts +861 -193
- package/src/hashTree/utils.ts +19 -0
- package/src/index.ts +6 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interceptors/dataChannelAuthToken.ts +88 -12
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
- package/src/interpretation/index.ts +65 -10
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +566 -164
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +26 -1
- package/src/media/MediaConnectionAwaiter.ts +21 -4
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +8 -3
- package/src/meeting/ai-docs/meeting-spec.md +401 -0
- package/src/meeting/in-meeting-actions.ts +12 -0
- package/src/meeting/index.ts +937 -119
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +51 -7
- package/src/meeting/voicea-meeting.ts +1 -1
- package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
- package/src/meeting-info/meeting-info-v2.ts +10 -4
- package/src/meetings/ai-docs/meetings-spec.md +296 -0
- package/src/meetings/index.ts +200 -80
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/ai-docs/member-spec.md +196 -0
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/ai-docs/members-spec.md +256 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/ai-docs/metrics-spec.md +185 -0
- package/src/metrics/constants.ts +6 -0
- package/src/multistream/ai-docs/multistream-spec.md +292 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
- package/src/reachability/ai-docs/reachability-spec.md +261 -0
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/ai-docs/reactions-spec.md +198 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
- package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/ai-docs/roap-spec.md +241 -0
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/ai-docs/webinar-spec.md +243 -0
- package/src/webinar/index.ts +216 -38
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/annotation/index.ts +3 -3
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +223 -3
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +139 -32
- package/test/unit/spec/hashTree/hashTreeParser.ts +2451 -184
- package/test/unit/spec/hashTree/utils.ts +37 -0
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interpretation/index.ts +119 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +1014 -58
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +23 -23
- package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
- package/test/unit/spec/meeting/index.js +2811 -117
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +12 -0
- package/test/unit/spec/meeting/utils.js +179 -16
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
- package/test/unit/spec/meetings/index.js +544 -49
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +89 -0
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +332 -31
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<!-- sdd-generated-metadata
|
|
2
|
+
doc_kind: module-spec
|
|
3
|
+
generated_from: module-spec@0.2.2
|
|
4
|
+
generator_plugin: repo-annotation@1.0.5+codex.20260818094939
|
|
5
|
+
generated_by: codex
|
|
6
|
+
approved_by: repository user
|
|
7
|
+
updated_at: 2026-08-22T15:21:29Z
|
|
8
|
+
validation_status: pass-with-warnings
|
|
9
|
+
-->
|
|
10
|
+
# RECORDING CONTROLLER — SPEC
|
|
11
|
+
|
|
12
|
+
> Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/recording-controller/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `recording-controller` |
|
|
19
|
+
| Source path(s) | `src/recording-controller/` |
|
|
20
|
+
| Parent spec | — |
|
|
21
|
+
| Doc kind | Module spec |
|
|
22
|
+
| Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
|
|
23
|
+
| Generated from | `module-spec` @ SDLC template library `0.2.2` |
|
|
24
|
+
| generated_by / approved_by / updated_at | codex / repository user / 2026-08-22T15:21:29Z |
|
|
25
|
+
| Validation status | pass-with-warnings |
|
|
26
|
+
|
|
27
|
+
## Evidence Rules
|
|
28
|
+
|
|
29
|
+
Requirements cite current source and mirrored tests. Current code wins over retained prose when they conflict; commit and PR history are excluded. Missing evidence stays a gap.
|
|
30
|
+
|
|
31
|
+
## Source Material Register
|
|
32
|
+
|
|
33
|
+
| Source material | Scope | Decision | Detail location or disposition |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| No routed legacy module spec | overview / API / behavior / tests | none; generated from current recording controller/util/enums and tests |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/recording-controller/` contains 3 direct source/reference file(s) and has 2 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
|
|
41
|
+
|
|
42
|
+
## Purpose / Responsibility
|
|
43
|
+
|
|
44
|
+
Validates consumer recording actions against display hints/policy, selects cloud or premise recording, and returns the owning request method's promise.
|
|
45
|
+
|
|
46
|
+
## Stack
|
|
47
|
+
|
|
48
|
+
TypeScript/JavaScript in the Node 22.14 Yarn workspace; Webex core/plugin abstractions and Mocha/Sinon/`@webex/test-helper-chai` tests.
|
|
49
|
+
|
|
50
|
+
## Folder / Package Structure
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
src/recording-controller/
|
|
54
|
+
├── enums.ts — declared action/control enum values
|
|
55
|
+
├── index.ts — module facade/controller or primary exports
|
|
56
|
+
├── util.ts — normalization/helper functions
|
|
57
|
+
└── ai-docs/recording-controller-spec.md — canonical module specification
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Key Files (source of truth)
|
|
61
|
+
|
|
62
|
+
| File | Holds |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `src/recording-controller/enums.ts` | declared action/control enum values |
|
|
65
|
+
| `src/recording-controller/index.ts` | module facade/controller or primary exports |
|
|
66
|
+
| `src/recording-controller/util.ts` | normalization/helper functions |
|
|
67
|
+
| `test/unit/spec/recording-controller/index.js` and 1 sibling test file(s) | mirrored characterization/unit coverage |
|
|
68
|
+
|
|
69
|
+
## Public Surface
|
|
70
|
+
|
|
71
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
72
|
+
|---|---|---|---|---|---|---|
|
|
73
|
+
| `recording-controller.1` | SDK / configuration | `RecordingController.set()`, `setLocusUrl()`, `setDisplayHints()`, `setUserPolicy()`, `setSessionId()`, `setServiceUrl()`, `getLocusUrl()`, `getLocusId()`, `getSessionId()`, `getServiceUrl()`, and `getDisplayHints()` | Refresh/read the request context and capability inputs used by later recording actions. | Preserve derived Locus id and getter/setter behavior; no recording status is stored. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
74
|
+
| `recording-controller.2` | SDK / remote | `startRecording()` | Validate the current start capability and send a `START` action with the selected `RecordingType`. | Preserve action/type values and selected service-vs-Locus route. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
75
|
+
| `recording-controller.3` | SDK / remote | `pauseRecording()` and `resumeRecording()` | Map pause/resume intent to the permitted recording action under current display hints/policy. | Rejections remain the selected facade promise; the controller applies no response state. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
76
|
+
| `recording-controller.4` | SDK / remote | `stopRecording()` | Send the permitted `STOP` action through the current recording route. | Preserve caller-visible rejection and remote-authority ownership of final status. | `src/recording-controller/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
77
|
+
| `recording-controller.5` | exported enums | `RecordingAction` and `RecordingType` | Define the exact action/type vocabulary serialized by controller operations. | Existing raw enum values are request contracts; additions must be compatible. | `src/recording-controller/enums.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
78
|
+
|
|
79
|
+
Compatibility notes:
|
|
80
|
+
- Prefer additive fields/options and preserve current return and rejection semantics. Internal helpers are not public merely because they are exported within the source directory.
|
|
81
|
+
|
|
82
|
+
## Requires (dependencies)
|
|
83
|
+
|
|
84
|
+
Meeting request access, Locus URL/state, recording action/type enums, capability state, and utility validation.
|
|
85
|
+
|
|
86
|
+
## Requirements
|
|
87
|
+
|
|
88
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
89
|
+
|---|---|---|---|---|---|---|
|
|
90
|
+
| `RECORDING-CONTROLLER-R-001` | `startRecording`, `pauseRecording`, `resumeRecording`, and `stopRecording` call `recordingFacade()` immediately. The facade derives the recording type, checks the corresponding display hint/self policy, rejects a denied action before transport, and otherwise returns the selected request promise. | The permission decision belongs inside the facade, while accepted actions must preserve the actual request result without inventing local state application. | `src/recording-controller/index.ts` | `test/unit/spec/recording-controller/index.js` | none | PRESENT |
|
|
91
|
+
| `RECORDING-CONTROLLER-R-002` | select recording type/action payload. | Recording action/type pairs choose the remote transition and cannot be generalized without changing service behavior. | `src/recording-controller/index.ts`, `src/recording-controller/util.ts` | `test/unit/spec/recording-controller/index.js` | service and Locus paths need the same action/type rejection matrix | PRESENT |
|
|
92
|
+
| `RECORDING-CONTROLLER-R-003` | Invalid action/type/capability inputs or request failures reject the returned promise; this controller allocates no independent listener, lock, or timer. | Remote recording state remains authoritative, so rejection cannot be masked by a fabricated local transition. | `src/recording-controller/` | `test/unit/spec/recording-controller/index.js` | none | PRESENT |
|
|
93
|
+
|
|
94
|
+
## Design Overview
|
|
95
|
+
|
|
96
|
+
`RecordingController` stores request context, validates actions through `util.ts`, selects cloud or premise recording, and delegates either to `request.request` for the recording service or `request.locusDeltaRequest` for legacy Locus controls. It returns that promise and does not inspect the response or apply recording state. It owns no listeners or timers.
|
|
97
|
+
|
|
98
|
+
## Data Flow
|
|
99
|
+
|
|
100
|
+
```mermaid
|
|
101
|
+
flowchart LR
|
|
102
|
+
Consumer[Meeting recording API] --> Controller[index.ts]
|
|
103
|
+
Enums[enums.ts action/type values] --> Controller
|
|
104
|
+
Controller --> Util[util.ts payload builder]
|
|
105
|
+
Util --> Controller
|
|
106
|
+
Controller --> Meeting[owning Meeting request method]
|
|
107
|
+
Meeting --> Locus[Locus recording operation]
|
|
108
|
+
Locus --> Meeting
|
|
109
|
+
Meeting --> Controller
|
|
110
|
+
Controller --> Consumer
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Sequence Diagram(s)
|
|
114
|
+
|
|
115
|
+
Sequence coverage:
|
|
116
|
+
|
|
117
|
+
| Operation group | Diagram | Failure coverage |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| UC-1…UC-3 — recording control operation groups | Recording control primary sequence | denied action/type, service-vs-Locus request rejection, and no local state application |
|
|
120
|
+
| UC-1…UC-3 — recording control alternate/failure paths | Recording control alternate/failure sequence | unsupported action/type combination, missing recording capability, or recording request rejection |
|
|
121
|
+
|
|
122
|
+
### Recording control primary sequence
|
|
123
|
+
|
|
124
|
+
```mermaid
|
|
125
|
+
sequenceDiagram
|
|
126
|
+
participant C as Meeting consumer
|
|
127
|
+
participant R as RecordingController
|
|
128
|
+
participant U as util.ts
|
|
129
|
+
participant M as Meeting request owner
|
|
130
|
+
C->>R: start / pause / resume / stop
|
|
131
|
+
R->>R: call recordingFacade(action)
|
|
132
|
+
R->>U: derive recording type and test capability
|
|
133
|
+
U-->>R: route/type and allowed or denied
|
|
134
|
+
R->>M: send service or Locus request when allowed
|
|
135
|
+
M-->>R: request result or rejection
|
|
136
|
+
R-->>C: same request promise outcome
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Recording control alternate/failure sequence
|
|
140
|
+
|
|
141
|
+
```mermaid
|
|
142
|
+
sequenceDiagram
|
|
143
|
+
participant C as Meeting recording consumer
|
|
144
|
+
participant R as RecordingController
|
|
145
|
+
participant U as util.ts
|
|
146
|
+
participant F as recordingFacade
|
|
147
|
+
C->>R: start, pause, resume, or stop
|
|
148
|
+
R->>F: recordingFacade(action)
|
|
149
|
+
F->>U: derive recording type and check display hint/self policy
|
|
150
|
+
alt action is allowed
|
|
151
|
+
F->>F: send selected recording request
|
|
152
|
+
F-->>C: same request promise result or rejection
|
|
153
|
+
else action is unsupported
|
|
154
|
+
F--xC: PermissionError promise rejection before transport
|
|
155
|
+
end
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Class / Component Relationships
|
|
159
|
+
|
|
160
|
+
```mermaid
|
|
161
|
+
classDiagram
|
|
162
|
+
class Consumer
|
|
163
|
+
class Controller
|
|
164
|
+
class Enums
|
|
165
|
+
class Util
|
|
166
|
+
class Meeting
|
|
167
|
+
class Locus
|
|
168
|
+
Consumer --> Controller
|
|
169
|
+
Enums --> Controller
|
|
170
|
+
Controller --> Util
|
|
171
|
+
Util --> Controller
|
|
172
|
+
Controller --> Meeting
|
|
173
|
+
Meeting --> Locus
|
|
174
|
+
Locus --> Meeting
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The arrows identify ownership and delegation inside `src/recording-controller/`; files that only declare types or constants are not presented as transports.
|
|
178
|
+
|
|
179
|
+
## Use Cases
|
|
180
|
+
|
|
181
|
+
- **UC-1:** Refresh Locus/service/session/display-hint/policy context without creating a local recording-status projection. Evidence: `src/recording-controller/index.ts`.
|
|
182
|
+
- **UC-2:** Map start, pause, resume, and stop to the exact `RecordingAction`/`RecordingType` payload allowed by current hints and policy. Evidence: `src/recording-controller/index.ts`.
|
|
183
|
+
- **UC-3:** Route through the recording service when `serviceUrl` is present; otherwise send the derived `record` body through `locusDeltaRequest`, returning the selected dependency promise unchanged. Evidence: `src/recording-controller/index.ts`.
|
|
184
|
+
|
|
185
|
+
## State Model
|
|
186
|
+
|
|
187
|
+
The controller stores `serviceUrl`, `sessionId`, `locusUrl`, derived `locusId`, `displayHints`, and `selfUserPolicies`. It does not store current recording status or apply a response projection; the recording service/Locus remains authoritative.
|
|
188
|
+
|
|
189
|
+
## Business Rules & Invariants
|
|
190
|
+
|
|
191
|
+
- Only actions allowed by the current display hints/self policy are sent. Presence of `serviceUrl` selects the recording-service PUT; absence selects the Locus controls PATCH. The controller itself makes no recording-state change. Enforced under `src/recording-controller/`.
|
|
192
|
+
|
|
193
|
+
## Concurrency & Reactive Flow
|
|
194
|
+
|
|
195
|
+
- Each accepted action returns an independent request promise. The controller has no queue, cancellation, response ordering, or supersession guard; callers and the remote recording authority determine the outcome of overlapping actions.
|
|
196
|
+
|
|
197
|
+
## Error Handling & Failure Modes
|
|
198
|
+
|
|
199
|
+
| Condition | Signal | Caller recovery |
|
|
200
|
+
|---|---|---|
|
|
201
|
+
| Display hint/self policy does not permit the requested operation | The public method calls `recordingFacade()`; the facade returns a rejected `PermissionError` promise before selecting either transport request. | Refresh recording controls and issue only a currently allowed action. |
|
|
202
|
+
| `recordingFacade` request rejects | The controller returns that rejected promise; it does not apply a fabricated local recording state. | Handle the request failure and wait for authoritative recording state. |
|
|
203
|
+
| Recording action is accepted | The caller receives the facade request result for the selected typed payload. | Continue from service/Locus-projected recording state. |
|
|
204
|
+
|
|
205
|
+
## Pitfalls
|
|
206
|
+
|
|
207
|
+
- Action names and recording types are separate enums. Conflating them produces a syntactically valid request with the wrong server meaning.
|
|
208
|
+
- Verify both typed constants/enums and raw wire values before changing a logical condition in this legacy package.
|
|
209
|
+
|
|
210
|
+
## Test-Case Strategy (module)
|
|
211
|
+
|
|
212
|
+
Use the current mirrored suites: `test/unit/spec/recording-controller/index.js`, `test/unit/spec/recording-controller/util.js`. Characterize the recording-controller-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
213
|
+
|
|
214
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| `RECORDING-CONTROLLER-R-001` | `test/unit/spec/recording-controller/index.js` | cover configuration plus each recording action on service and Locus routes |
|
|
217
|
+
| `RECORDING-CONTROLLER-R-002` | `test/unit/spec/recording-controller/index.js` | cover every action/type payload against both service and Locus routing contexts |
|
|
218
|
+
| `RECORDING-CONTROLLER-R-003` | `test/unit/spec/recording-controller/index.js` | assert facade rejection is returned unchanged and no local recording status is applied |
|
|
219
|
+
|
|
220
|
+
## Traceability
|
|
221
|
+
|
|
222
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
223
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|
|
@@ -261,8 +261,7 @@ export default class RecordingController {
|
|
|
261
261
|
|
|
262
262
|
LoggerProxy.logger.log(`RecordingController:index#recordingControls --> ${record}`);
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
return this.request.request({
|
|
264
|
+
return this.request.locusDeltaRequest({
|
|
266
265
|
uri: `${this.locusUrl}/${CONTROLS}`,
|
|
267
266
|
body: {
|
|
268
267
|
record,
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<!-- sdd-generated-metadata
|
|
2
|
+
doc_kind: module-spec
|
|
3
|
+
generated_from: module-spec@0.2.2
|
|
4
|
+
generator_plugin: repo-annotation@1.0.5+codex.20260818094939
|
|
5
|
+
generated_by: codex
|
|
6
|
+
approved_by: repository user
|
|
7
|
+
updated_at: 2026-08-22T15:21:29Z
|
|
8
|
+
validation_status: pass-with-warnings
|
|
9
|
+
-->
|
|
10
|
+
# ROAP — SPEC
|
|
11
|
+
|
|
12
|
+
> Start here → root [`AGENTS.md`](../../../AGENTS.md) · router [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md) · system [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md). This is the canonical source-local spec for `src/roap/`.
|
|
13
|
+
|
|
14
|
+
## Metadata
|
|
15
|
+
|
|
16
|
+
| Field | Value |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Module id | `roap` |
|
|
19
|
+
| Source path(s) | `src/roap/` |
|
|
20
|
+
| Parent spec | — |
|
|
21
|
+
| Doc kind | Module spec |
|
|
22
|
+
| Coverage score | 93% assessed 2026-08-22; 13/14 mandatory fields present; all critical and Important fields present; one noncritical polish gap remains; pending independent validation of the participant-role repair |
|
|
23
|
+
| Generated from | `module-spec` @ SDLC template library `0.2.2` |
|
|
24
|
+
| generated_by / approved_by / updated_at | codex / repository user / 2026-08-22T15:21:29Z |
|
|
25
|
+
| Validation status | pass-with-warnings |
|
|
26
|
+
|
|
27
|
+
## Evidence Rules
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
## Source Material Register
|
|
32
|
+
|
|
33
|
+
| Source material | Scope | Decision | Detail location or disposition |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| No routed legacy module spec | overview / API / behavior / tests | none; generated from current ROAP/request/TURN code and tests |
|
|
36
|
+
| Current source and mirrored tests | implementation / tests | verified | requirements, flows, failures, and test strategy below |
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
`src/roap/` contains 4 direct source/reference file(s) and has 3 mirrored unit-test file(s). This spec separates its public operations, runtime data movement, component ownership, state applicability, and verification boundary.
|
|
41
|
+
|
|
42
|
+
## Purpose / Responsibility
|
|
43
|
+
|
|
44
|
+
Sends outgoing ROAP media requests, processes their SDP responses, and performs TURN discovery for meeting media. Incoming Mercury ROAP routing and glare handling are owned by `MeetingsUtil` and `Meeting`.
|
|
45
|
+
|
|
46
|
+
## Stack
|
|
47
|
+
|
|
48
|
+
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`.
|
|
49
|
+
|
|
50
|
+
## Folder / Package Structure
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
src/roap/
|
|
54
|
+
├── index.ts — module facade/controller or primary exports
|
|
55
|
+
├── request.ts — HTTP request boundary
|
|
56
|
+
├── turnDiscovery.ts — turnDiscovery implementation responsibility
|
|
57
|
+
├── types.ts — module type declarations
|
|
58
|
+
└── ai-docs/roap-spec.md — canonical module specification
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Key Files (source of truth)
|
|
62
|
+
|
|
63
|
+
| File | Holds |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `src/roap/index.ts` | module facade/controller or primary exports |
|
|
66
|
+
| `src/roap/request.ts` | HTTP request boundary |
|
|
67
|
+
| `src/roap/turnDiscovery.ts` | turnDiscovery implementation responsibility |
|
|
68
|
+
| `src/roap/types.ts` | module type declarations |
|
|
69
|
+
| `test/unit/spec/roap/index.ts` and 2 sibling test file(s) | mirrored characterization/unit coverage |
|
|
70
|
+
|
|
71
|
+
## Public Surface
|
|
72
|
+
|
|
73
|
+
| Contract ID | Type | Surface | Purpose | Compatibility / deprecation | Schema / detail link | Root index |
|
|
74
|
+
|---|---|---|---|---|---|---|
|
|
75
|
+
| `roap.1` | SDK / remote | `Roap.sendRoapOK()`, `sendRoapAnswer()`, `sendRoapError()`, and `sendRoapMediaRequest()` | Build and send outgoing ROAP control/media messages through the current Locus media route. | Preserve message/action fields and returned promise behavior; inbound Mercury ordering is owned elsewhere. | `src/roap/index.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
76
|
+
| `roap.2` | request adapter | `RoapRequest.sendRoap()` | Issue the outgoing Locus media request and return its response/rejection to `Roap`. | Preserve request URL/body and direct promise propagation. | `src/roap/request.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
77
|
+
| `roap.3` | TURN discovery | `Roap.doTurnDiscovery()`, `generateTurnDiscoveryRequestMessage()`, `handleTurnDiscoveryHttpResponse()`, and `abortTurnDiscovery()` | Delegate TURN discovery lifecycle through the active `TurnDiscovery` instance. | Preserve skip-vs-rethrow distinctions and abort ownership. | `src/roap/index.ts`, `src/roap/turnDiscovery.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
78
|
+
| `roap.4` | TURN discovery component | `TurnDiscovery.handleTurnDiscoveryResponse()`, `generateTurnDiscoveryRequestMessage()`, `handleTurnDiscoveryHttpResponse()`, `abort()`, `sendRoapOK()`, `isSkipped()`, and `doTurnDiscovery()` | Generate the discovery offer, interpret HTTP results, and expose normalized TURN server information or skip reason. | HTTP 409/403 are rethrown; other handled discovery failures may resolve a skipped result. | `src/roap/turnDiscovery.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
79
|
+
| `roap.5` | exported contracts | `TurnDiscoveryResult`, `TurnServerInfo`, and `TurnDiscoverySkipReason` | Share the exact success/skip shape returned to Meeting negotiation. | Add fields and skip reasons compatibly; existing values are consumer-visible. | `src/roap/types.ts`, `src/roap/turnDiscovery.ts` | [CONTRACTS](../../../ai-docs/CONTRACTS.md) |
|
|
80
|
+
|
|
81
|
+
Compatibility notes:
|
|
82
|
+
- 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.
|
|
83
|
+
|
|
84
|
+
## Requires (dependencies)
|
|
85
|
+
|
|
86
|
+
Meeting/Locus media request transport, SDP utilities, media connection, Webex TURN discovery, and sequence state.
|
|
87
|
+
|
|
88
|
+
## Requirements
|
|
89
|
+
|
|
90
|
+
| ID | WHAT | WHY | Source Evidence | Test / Example Evidence | Assumptions / Gaps | Confidence |
|
|
91
|
+
|---|---|---|---|---|---|---|
|
|
92
|
+
| `ROAP-R-001` | Send outgoing ROAP media messages and process the returned response; inbound Mercury routing is outside `src/roap/`. | Ownership must match current call paths so changes to incoming sequence/glare logic are made in `MeetingsUtil` and `Meeting`, not in this sender. | `src/roap/index.ts`, `src/meetings/util.ts`, `src/meeting/index.ts` | `test/unit/spec/roap/index.ts`, `test/unit/spec/meeting/index.js` | none | PRESENT |
|
|
93
|
+
| `ROAP-R-002` | send Locus media requests and apply SDP answers. | Locus media requests and TURN discovery have different response and failure semantics during negotiation. | `src/roap/index.ts`, `src/roap/request.ts` | `test/unit/spec/roap/index.ts` | non-409/403 TURN failures need explicit skip-reason coverage | PRESENT |
|
|
94
|
+
| `ROAP-R-003` | Outgoing media-request failures reject their caller. TURN discovery rethrows HTTP 409/403, while other handled discovery failures resolve a result with `turnDiscoverySkippedReason`; this sender owns no inbound Mercury listener. | Negotiation code must distinguish direct request rejection from TURN skip results and the specific 409/403 rethrow path. | `src/roap/index.ts`, `src/roap/request.ts`, `src/roap/turnDiscovery.ts` | `test/unit/spec/roap/index.ts`, `test/unit/spec/roap/turnDiscovery.ts` | non-409/403 skip reasons need a complete matrix | PRESENT |
|
|
95
|
+
| `ROAP-R-004` | Incoming ROAP sequence and glare handling are delegated by `MeetingsUtil.handleRoapMercury()` to `Meeting.roapMessageReceived()`; `src/roap/types.ts` only declares TURN-discovery shapes. | Explicit cross-module ownership prevents passive TURN types from being mistaken for inbound negotiation guards. | `src/meetings/util.ts`, `src/meeting/index.ts`, `src/roap/types.ts` | `test/unit/spec/meeting/index.js` | none | PRESENT |
|
|
96
|
+
| `ROAP-R-005` | TURN discovery normalizes service results for the active media negotiation, rethrows 409/403, and reports other handled failures through the documented skip reason. | Media setup needs the correct relay configuration and an explicit skipped outcome rather than fabricated credentials or a blanket rejection claim. | `src/roap/turnDiscovery.ts`, `src/roap/request.ts` | `test/unit/spec/roap/turnDiscovery.ts`, `test/unit/spec/roap/request.ts` | none | PRESENT |
|
|
97
|
+
|
|
98
|
+
## Design Overview
|
|
99
|
+
|
|
100
|
+
`src/roap/index.ts` is the outgoing ROAP sender: it builds/sends Locus media requests through `request.ts` and handles the returned SDP answer. `turnDiscovery.ts` separately resolves TURN data. Incoming Mercury routing and glare handling belong to `MeetingsUtil` and `Meeting`, outside this module.
|
|
101
|
+
|
|
102
|
+
## Data Flow
|
|
103
|
+
|
|
104
|
+
```mermaid
|
|
105
|
+
flowchart LR
|
|
106
|
+
Meeting[Meeting outgoing negotiation] --> Roap[index.ts]
|
|
107
|
+
Roap --> Request[request.ts]
|
|
108
|
+
Request --> Locus[Locus media endpoint]
|
|
109
|
+
Locus --> Request
|
|
110
|
+
Request --> Roap
|
|
111
|
+
Roap --> Media[apply returned SDP answer]
|
|
112
|
+
Meeting --> Turn[turnDiscovery.ts]
|
|
113
|
+
Turn --> Discovery[Webex service discovery]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Sequence Diagram(s)
|
|
117
|
+
|
|
118
|
+
Sequence coverage:
|
|
119
|
+
|
|
120
|
+
| Operation group | Diagram | Failure coverage |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| UC-1…UC-4 — outgoing ROAP and TURN operation groups | Outgoing ROAP and TURN primary sequence | outgoing request rejection, TURN 409/403 rethrow, handled skip result, and abort |
|
|
123
|
+
| UC-1…UC-4 — outgoing ROAP and TURN alternate/failure paths | Outgoing ROAP and TURN alternate/failure sequence | missing media URL/payload, Locus media request rejection, invalid returned SDP, or TURN discovery failure |
|
|
124
|
+
|
|
125
|
+
### Outgoing ROAP and TURN primary sequence
|
|
126
|
+
|
|
127
|
+
```mermaid
|
|
128
|
+
sequenceDiagram
|
|
129
|
+
participant M as Meeting
|
|
130
|
+
participant R as Roap index.ts
|
|
131
|
+
participant Q as roap/request.ts
|
|
132
|
+
participant L as Locus media endpoint
|
|
133
|
+
M->>R: sendRoapMediaRequest(options)
|
|
134
|
+
R->>Q: send outgoing ROAP payload
|
|
135
|
+
Q->>L: HTTP media request
|
|
136
|
+
L-->>Q: response with SDP/ROAP or rejection
|
|
137
|
+
Q-->>R: response
|
|
138
|
+
R-->>M: processed outgoing result
|
|
139
|
+
Note over M: Incoming Mercury ROAP and glare are handled in MeetingsUtil/Meeting, not src/roap
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Outgoing ROAP and TURN alternate/failure sequence
|
|
143
|
+
|
|
144
|
+
```mermaid
|
|
145
|
+
sequenceDiagram
|
|
146
|
+
participant M as Meeting outgoing negotiation
|
|
147
|
+
participant R as Roap
|
|
148
|
+
participant Q as request.ts
|
|
149
|
+
participant L as Locus media endpoint
|
|
150
|
+
M->>R: sendRoapMediaRequest(options)
|
|
151
|
+
R->>Q: outgoing ROAP payload
|
|
152
|
+
alt media URL/payload is valid
|
|
153
|
+
Q->>L: HTTP media request
|
|
154
|
+
L-->>Q: ROAP/SDP response or rejection
|
|
155
|
+
Q-->>R: response or rejection
|
|
156
|
+
R-->>M: processed result or propagated rejection
|
|
157
|
+
else required media request context is missing
|
|
158
|
+
Q--xR: rejected promise from request.ts
|
|
159
|
+
R--xM: propagated rejection
|
|
160
|
+
end
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Class / Component Relationships
|
|
164
|
+
|
|
165
|
+
```mermaid
|
|
166
|
+
classDiagram
|
|
167
|
+
class Meeting
|
|
168
|
+
class Roap
|
|
169
|
+
class Request
|
|
170
|
+
class Locus
|
|
171
|
+
class Media
|
|
172
|
+
class Turn
|
|
173
|
+
class Discovery
|
|
174
|
+
Meeting --> Roap
|
|
175
|
+
Roap --> Request
|
|
176
|
+
Request --> Locus
|
|
177
|
+
Locus --> Request
|
|
178
|
+
Request --> Roap
|
|
179
|
+
Roap --> Media
|
|
180
|
+
Meeting --> Turn
|
|
181
|
+
Turn --> Discovery
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The arrows identify ownership and delegation inside `src/roap/`; files that only declare types or constants are not presented as transports.
|
|
185
|
+
|
|
186
|
+
## Use Cases
|
|
187
|
+
|
|
188
|
+
- **UC-1:** Send outgoing ROAP OK, answer, error, or media-request payloads through `RoapRequest.sendRoap()` and return the response/rejection. Evidence: `src/roap/index.ts`, `src/roap/request.ts`.
|
|
189
|
+
- **UC-2:** Generate a TURN discovery request, interpret its response, and expose normalized TURN server information. Evidence: `src/roap/turnDiscovery.ts`.
|
|
190
|
+
- **UC-3:** Abort an active discovery through the owning `Roap`/`TurnDiscovery` lifecycle. Evidence: `src/roap/index.ts`, `src/roap/turnDiscovery.ts`.
|
|
191
|
+
- **UC-4:** Distinguish 409/403 rethrows from other handled discovery outcomes that produce a skip reason, without assigning inbound Mercury/glare processing to this module. Evidence: `src/roap/turnDiscovery.ts`, `src/meeting/index.ts`, `src/meetings/util.ts`.
|
|
192
|
+
|
|
193
|
+
## State Model
|
|
194
|
+
|
|
195
|
+
ROAP sequence, pending offer/answer, negotiation state, and TURN discovery results are held per media negotiation.
|
|
196
|
+
|
|
197
|
+
## Business Rules & Invariants
|
|
198
|
+
|
|
199
|
+
- `src/roap/` owns outgoing request/response and TURN discovery only. Incoming Mercury sequencing/glare remains in `src/meetings/util.ts` and `src/meeting/index.ts`. Direct outgoing ROAP request failures reject; TURN discovery rethrows 409/403, while its other handled failures resolve a result containing `turnDiscoverySkippedReason`.
|
|
200
|
+
|
|
201
|
+
## Concurrency & Reactive Flow
|
|
202
|
+
|
|
203
|
+
- Each outgoing ROAP/TURN operation is represented by its returned promise and owns no inbound Mercury listener or persistent negotiation state. Incoming ROAP sequence/glare ordering remains in `MeetingsUtil.handleRoapMercury()` and `Meeting.roapMessageReceived()`.
|
|
204
|
+
|
|
205
|
+
## Protocol / Wire Format
|
|
206
|
+
|
|
207
|
+
- External payloads are parsed/serialized by files under `src/roap/` and existing Webex/media dependencies. Preserve current field names, enum/raw values, sequence identifiers, and compatibility behavior; do not treat the normalized client model as the wire schema.
|
|
208
|
+
|
|
209
|
+
## Error Handling & Failure Modes
|
|
210
|
+
|
|
211
|
+
| Condition | Signal | Caller recovery |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| Required Locus media request context/payload is absent | The request helper rejects rather than issuing an invalid outgoing ROAP request. | Supply the current media URL and ROAP payload. |
|
|
214
|
+
| Locus media request rejects, or TURN discovery encounters a handled failure | The media-request promise rejects; TURN 409/403 rethrows, while other handled discovery failures resolve with `turnDiscoverySkippedReason`. `src/roap/` has no inbound Mercury listener to clean up. | Branch on request rejection versus TURN rethrow/skip result in the Meeting negotiation flow. |
|
|
215
|
+
| Locus returns an accepted ROAP/SDP response | `Roap` processes and returns the outgoing operation result to Meeting. | Apply it only within the current Meeting negotiation. |
|
|
216
|
+
|
|
217
|
+
## Pitfalls
|
|
218
|
+
|
|
219
|
+
- Offer/answer messages are ordered protocol state. Retrying or applying a stale sequence can corrupt the peer connection.
|
|
220
|
+
- Public behavior may be reachable through a parent `Meeting`/`Meetings` object even when the source helper is not exported directly.
|
|
221
|
+
|
|
222
|
+
## Key Design Trade-off
|
|
223
|
+
|
|
224
|
+
- Explicit ROAP state preserves interoperability and recoverable errors but makes media setup sequential and stateful.
|
|
225
|
+
|
|
226
|
+
## Test-Case Strategy (module)
|
|
227
|
+
|
|
228
|
+
Use the current mirrored suites: `test/unit/spec/roap/index.ts`, `test/unit/spec/roap/request.ts`, `test/unit/spec/roap/turnDiscovery.ts`. Characterize the roap-specific use cases above and each listed failure condition; add cleanup or transition cases only for resources and state this module actually owns.
|
|
229
|
+
|
|
230
|
+
| Behavior / Requirement | Existing test evidence | Gap |
|
|
231
|
+
|---|---|---|
|
|
232
|
+
| `ROAP-R-001` | `test/unit/spec/roap/index.ts` | cover outgoing ROAP, request adapter, TURN discovery, skip/rethrow, and abort groups |
|
|
233
|
+
| `ROAP-R-002` | `test/unit/spec/roap/index.ts` | non-409/403 TURN failures need explicit skip-reason coverage |
|
|
234
|
+
| `ROAP-R-003` | `test/unit/spec/roap/index.ts`, `test/unit/spec/roap/turnDiscovery.ts` | cover 409/403 rethrow, handled skip results, and abort as distinct outcomes |
|
|
235
|
+
| `ROAP-R-004` | `test/unit/spec/meeting/index.js` | keep inbound sequence/glare coverage with the owning Meeting module |
|
|
236
|
+
| `ROAP-R-005` | `test/unit/spec/roap/turnDiscovery.ts`, `test/unit/spec/roap/request.ts` | none |
|
|
237
|
+
|
|
238
|
+
## Traceability
|
|
239
|
+
|
|
240
|
+
- Repo architecture: [`ARCHITECTURE.md`](../../../ai-docs/ARCHITECTURE.md) · Registry: [`SPEC_INDEX.md`](../../../ai-docs/SPEC_INDEX.md)
|
|
241
|
+
- Coverage state and contracts baseline: `../../../.sdd/manifest.json`
|
|
@@ -229,9 +229,17 @@ export default class TurnDiscovery {
|
|
|
229
229
|
* @returns {TurnDiscoveryResult}
|
|
230
230
|
*/
|
|
231
231
|
private handleTurnDiscoveryFailure(meeting: Meeting, error: Error): TurnDiscoveryResult {
|
|
232
|
+
// if we got a 409/403 from Locus, it means we've been dropped from the meeting,
|
|
233
|
+
// so there's no point continuing with the media connection attempt
|
|
234
|
+
if ((error as any).statusCode === 409 || (error as any).statusCode === 403) {
|
|
235
|
+
this.defer = undefined;
|
|
236
|
+
throw error;
|
|
237
|
+
}
|
|
238
|
+
|
|
232
239
|
// we catch any errors and resolve with no turn information so that the normal call join flow can continue without TURN
|
|
233
240
|
LoggerProxy.logger.info(
|
|
234
|
-
`Roap:turnDiscovery#doTurnDiscovery --> TURN discovery failed, continuing without TURN
|
|
241
|
+
`Roap:turnDiscovery#doTurnDiscovery --> TURN discovery failed, continuing without TURN:`,
|
|
242
|
+
error
|
|
235
243
|
);
|
|
236
244
|
|
|
237
245
|
Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.TURN_DISCOVERY_FAILURE, {
|