Skip to content

fix(store,samples): support multi-login hydrate and WebRTC gating#703

Open
Shreyas281299 wants to merge 1 commit into
webex:task-refactorfrom
Shreyas281299:multi-webrtc-tf
Open

fix(store,samples): support multi-login hydrate and WebRTC gating#703
Shreyas281299 wants to merge 1 commit into
webex:task-refactorfrom
Shreyas281299:multi-webrtc-tf

Conversation

@Shreyas281299

Copy link
Copy Markdown
Contributor

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

This pull request addresses

Multi-login mirrored widget sessions were not consistently hydrating ENGAGED custom state, and the sample React app did not expose or enforce the disableWebRTCRegistration behavior for WebRTC-dependent widgets.

by making the following changes

  • add task:multiLoginHydrate handling in cc-store event wiring, including listener registration/removal and dedupe for already-known new interactions
  • add SDK task-class compatibility accessors when resolving interaction id/state in store event handling
  • update store tests to cover multi-login hydrate listener wiring, skip-path, and process-path behavior
  • update samples-cc-react-app to pass disableWebRTCRegistration in SDK config, add UI toggle, and uncheck WebRTC-dependent widgets before locking their selection

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
  • Automated: yarn workspace @webex/cc-store exec jest tests/storeEventsWrapper.ts --runInBand
  • Automated: yarn workspace samples-cc-react-app build
  • Automated (hook validation): repository pre-commit checks executed during commit

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
      • Cursor/Codex
  • 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.

Made with Cursor

Add task:multiLoginHydrate handling with task-class compatibility so engaged state is hydrated reliably in mirrored sessions, and update the React sample to pass disableWebRTCRegistration while unchecking WebRTC-dependent widgets before locking their toggles.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Shreyas281299 Shreyas281299 requested a review from a team as a code owner June 18, 2026 16:42
@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-703.d1b38q61t1z947.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: ac9c8e1f2a

ℹ️ 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 +100 to +102
const WEBRTC_DEPENDENT_WIDGETS = ['incomingTask', 'taskList', 'callControl', 'callControlCAD'];
const isWidgetDisabledByWebRTC = (widget: string) =>
isWebRTCWidgetSelectionLocked && WEBRTC_DEPENDENT_WIDGETS.includes(widget);

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 Keep non-WebRTC task widgets selectable

With disableWebRTCRegistration enabled and the agent using Extension/DN, this list causes the effect below to uncheck and lock IncomingTask, TaskList, CallControl, and CAD. That SDK flag disables browser media registration, but these widgets are still the UI used to accept/select/control non-browser tasks; the widgets only special-case deviceType === 'BROWSER' for browser-specific labels/media. The sample can initialize for an Extension/DN agent and then hide all task-handling UI, so calls cannot be answered or controlled.

Useful? React with 👍 / 👎.


this.registerTaskEventListeners(task);
this.refreshTaskList();
this.handleTaskAssigned(task);

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 Normalize task-class hydrate payloads before assigning

When task:multiLoginHydrate carries one of the SDK task-class payloads supported by the new getInteractionId()/getInteractionState() fallbacks, passing the raw object into handleTaskAssigned stores it as currentTask. The rest of the store/widgets still read task.data.*, so a class payload without legacy data will crash on the next refresh/render instead of hydrating the mirrored session; normalize to the legacy shape or keep all downstream access class-safe.

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.

1 participant