feat(plugin-meetings): hydrate recording duration on rejoin#5017
feat(plugin-meetings): hydrate recording duration on rejoin#5017junhao3268 wants to merge 5 commits into
Conversation
- Pass through controls.record duration metadata in controlsUtils/locus-info - Add RecordingController.getRecordingStatus() REST fallback - Defer & retry hydration until LINKS_SERVICES delivers serviceUrl - Preserve duration fields across non-IDLE Locus deltas; clear on stop - Guard hydrate response against in-flight stop race
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bbe201833
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d9b46615f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14d20ff4be
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c34f18624d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| this.recording = { | ||
| ...this.recording, | ||
| lastDuration: duration.lastDuration, | ||
| lastTime: duration.lastTime, | ||
| needCalculate: duration.needCalculate, |
There was a problem hiding this comment.
Validate the hydrated recording status before merging
When the recording resource service lags behind a Locus transition, this merges whatever duration the GET returns into the current this.recording without checking duration.status. For example, immediately after pause/resume or a quick stop/start, the request issued for the new state can still return the previous resource status and its lastDuration/needCalculate; because the epoch only proves no newer Locus control event arrived after this request started, stale service data can still seed the current timer with the wrong baseline. Please discard or retry responses whose status does not match the current recording state before applying these fields.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cd0d0743e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const resolvedNeedCalculate = pickDurationField( | ||
| needCalculate, | ||
| previousRecording.needCalculate | ||
| ); |
There was a problem hiding this comment.
Do not preserve needCalculate across state changes
When Locus omits duration fields on a pause/resume delta and the hydration request is delayed, unavailable, or fails, this keeps the previous needCalculate value even though the recording state has just changed. For example, a pause after recording emits meeting:recording:paused with needCalculate: true, so consumers using the new duration payload continue adding now - lastTime while paused; a resume after a hydrated pause can similarly emit needCalculate: false and freeze the timer until hydration succeeds. Infer this flag from the new state or leave it unset until fresh duration data arrives instead of carrying it across state transitions.
Useful? React with 👍 / 👎.
Pass through controls.record duration metadata in controlsUtils/locus-info
Add RecordingController.getRecordingStatus() REST fallback
Defer & retry hydration until LINKS_SERVICES delivers serviceUrl
Preserve duration fields across non-IDLE Locus deltas; clear on stop
Guard hydrate response against in-flight stop race
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-809726#
When a user rejoins an in-progress meeting, the recording duration is not displayed because:
Locus does not always replay controls.record.meta.duration on rejoin, so the consumer never sees lastDuration / lastTime.
The Recording Stream Service URL (used to fetch the authoritative recording state) is delivered asynchronously via LINKS_SERVICES, so the first CONTROLS_RECORDING_UPDATED event after rejoin can fire before serviceUrl / locusId are available.
This brings parity with the native client, where RecordingStreamSession::RecordingTime hydrates the timer on rejoin.
by making the following changes
controlsUtils – Pass through controls.record.meta?.duration ?? controls.record.duration as lastDuration / lastTime / needCalculate on parsedControls.record.
LocusInfo – Emit the new duration fields with CONTROLS_RECORDING_UPDATED so consumers can render the live timer immediately.
RecordingController – Add a public getRecordingStatus() that calls GET {serviceUrl}/loci/{locusId}/resource, mirroring the native RecordingStreamSession::RecordingTime request.
Meeting:
New hydrateRecordingDuration(event) issues getRecordingStatus() on rejoin and updates meeting.recording.
When serviceUrl / locusId are not yet available, the event is stashed in pendingRecordingHydrationEvent and retried from setUpLocusServicesListener after LINKS_SERVICES.
Skip writing the hydrated duration when the in-flight state has already reached RECORDING_STATE.IDLE, preventing a stale value from overwriting a newer stop event.
setupLocusControlsListener uses a typed pickDurationField helper to clear duration on stop and otherwise keep the previous values when an update arrives without them.
Change Type
The following scenarios were tested
Unit tests added/updated:
controlsUtils – duration pass-through, fallback from meta.duration to duration
locus-info/index – CONTROLS_RECORDING_UPDATED payload includes new duration fields
recording-controller/index – getRecordingStatus() request shape and error paths
meeting/index – hydrateRecordingDuration happy path, deferred-retry via LINKS_SERVICES, IDLE race guard, pickDurationField behavior on start/update/stop
yarn workspace @webex/plugin-meetings build:src succeeds
yarn workspace @webex/plugin-meetings test:unit passes for the touched files
Manual: rejoin an in-progress recorded meeting in the web client; the timer now hydrates within one round-trip instead of waiting for the next Locus DELTA
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.