Skip to content

feat(plugin-meetings): hydrate recording duration on rejoin#5017

Open
junhao3268 wants to merge 5 commits into
webex:nextfrom
junhao3268:SPARK-809726-recording-duration-passthrough
Open

feat(plugin-meetings): hydrate recording duration on rejoin#5017
junhao3268 wants to merge 5 commits into
webex:nextfrom
junhao3268:SPARK-809726-recording-duration-passthrough

Conversation

@junhao3268

@junhao3268 junhao3268 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
  • 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

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

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

- 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
@junhao3268 junhao3268 requested review from a team as code owners June 3, 2026 06:59
@junhao3268 junhao3268 changed the title feat(plugin-meetings): hydrate recording duration passthrough feat(plugin-meetings): hydrate recording duration on rejoin Jun 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/@webex/plugin-meetings/src/meeting/index.ts
@aws-amplify-us-east-2

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-5017.d3m3l2kee0btzx.amplifyapp.com

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/@webex/plugin-meetings/src/meeting/index.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/@webex/plugin-meetings/src/meeting/index.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +2892 to +2896
this.recording = {
...this.recording,
lastDuration: duration.lastDuration,
lastTime: duration.lastTime,
needCalculate: duration.needCalculate,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +3011 to +3014
const resolvedNeedCalculate = pickDurationField(
needCalculate,
previousRecording.needCalculate
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants