Skip to content

fix(cc): call recording pause resume fix - #727

Open
bhabalan wants to merge 2 commits into
webex:nextfrom
bhabalan:CAI-8389-call-recording-fix
Open

fix(cc): call recording pause resume fix#727
bhabalan wants to merge 2 commits into
webex:nextfrom
bhabalan:CAI-8389-call-recording-fix

Conversation

@bhabalan

@bhabalan bhabalan commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-8389

This pull request addresses

The CallControl recording toggle could display the wrong action after a recording was paused or resumed. The Contact Center SDK normalizes callProcessingDetails.isPaused to a boolean, but the widget compared it with the string "true". As a result, a boolean true value could be interpreted as an active recording, leaving the control on Pause Recording instead of Resume Recording. The state could remain incorrect after later task updates or a widget remount.

Vidcast: https://app.vidcast.io/share/c1fb7f9e-b343-4c44-bcc3-236f300ab403

by making the following changes

  • Normalize isPaused and recordInProgress values from both SDK booleans and legacy "true"/"false" strings.
  • Use isPaused as the primary recording-state signal and fall back to recordInProgress when isPaused is absent.
  • Leave the existing recording state unchanged when neither recording flag is available.
  • Add utility-level coverage for boolean values, fallback behavior, and payloads without recording-state flags.
  • Add CallControl integration coverage for active, paused, resumed, already-paused-on-mount, task-refresh, and remount scenarios.

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

  • The testing is done with the amplify link
  • yarn workspace @webex/cc-components test:unit --runInBand — 49 suites passed; 813 tests passed, 4 skipped; 228 snapshots passed.
  • yarn workspace @webex/cc-task test:unit --runInBand — 11 suites and 260 tests passed.
  • Verified automated coverage for recording active, pause, resume, paused-on-mount, task refresh, widget remount, legacy string values, and missing recording flags.

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
    • The generated changes were checked against the existing repository implementation and SDK-normalized payload behavior; no third-party copyrighted code or verbatim content was introduced; automated tests were added and run.
  • 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 - Claude Code
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

@bhabalan
bhabalan requested a review from a team as a code owner July 28, 2026 21:52
@bhabalan bhabalan added the validated Indicates that the PR is ready for actions label Jul 28, 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: 6ac251a9f3

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +434 to +435
// Mirrors the SDK's own precedence: isPaused wins when present, otherwise
// recordInProgress is the active recording signal.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Document the new recording-state precedence

Update the cc-components and task module specs to describe boolean normalization, isPaused precedence, and the recordInProgress fallback. The commit changes the recording-state contract and adds remount/refresh behavior tests, but leaves packages/contact-center/cc-components/ai-docs/cc-components-spec.md and packages/contact-center/task/ai-docs/task-spec.md unchanged, so the canonical documentation can no longer validate or protect this fix.

AGENTS.md reference: AGENTS.md:L68-L68

Useful? React with 👍 / 👎.

store.setDeviceType('BROWSER');
store.store.featureFlags = {isEndCallEnabled: true, isEndConsultEnabled: true, webRtcEnabled: true};
store.store.logger = {
log: jest.fn(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reset the store singleton after each recording test

Add per-test teardown that restores or resets the store singleton. This suite mutates cc, agentId, featureFlags, currentTask, and taskList, while every fake task reuses the same interaction ID; consequently later cases begin with the previous task and can take the isSameTask path during promoteTask, making results order-dependent and allowing stale state/listeners to mask regressions.

AGENTS.md reference: AGENTS.md:L87-L88

Useful? React with 👍 / 👎.

@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-727.d1b38q61t1z947.amplifyapp.com

@github-actions github-actions Bot removed the validated Indicates that the PR is ready for actions label Jul 29, 2026
@bhabalan bhabalan added the validated Indicates that the PR is ready for actions label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant