fix(store,samples): support multi-login hydrate and WebRTC gating#703
fix(store,samples): support multi-login hydrate and WebRTC gating#703Shreyas281299 wants to merge 1 commit into
Conversation
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>
|
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: 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".
| const WEBRTC_DEPENDENT_WIDGETS = ['incomingTask', 'taskList', 'callControl', 'callControlCAD']; | ||
| const isWidgetDisabledByWebRTC = (widget: string) => | ||
| isWebRTCWidgetSelectionLocked && WEBRTC_DEPENDENT_WIDGETS.includes(widget); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 👍 / 👎.
COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7899
This pull request addresses
Multi-login mirrored widget sessions were not consistently hydrating
ENGAGEDcustom state, and the sample React app did not expose or enforce thedisableWebRTCRegistrationbehavior for WebRTC-dependent widgets.by making the following changes
task:multiLoginHydratehandling incc-storeevent wiring, including listener registration/removal and dedupe for already-knownnewinteractionssamples-cc-react-appto passdisableWebRTCRegistrationin SDK config, add UI toggle, and uncheck WebRTC-dependent widgets before locking their selectionChange Type
The following scenarios were tested
yarn workspace @webex/cc-store exec jest tests/storeEventsWrapper.ts --runInBandyarn workspace samples-cc-react-app buildThe GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.
Made with Cursor