From 57168f380a8a9d56c73e9e68ea5f2d78bfb84802 Mon Sep 17 00:00:00 2001 From: Kesava Krishnan Madavan Date: Fri, 8 May 2026 11:05:52 +0530 Subject: [PATCH 1/2] docs(samples): disableWebRTCRegistration toggle --- .../cc/samples-cc-react-app/src/App.tsx | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/widgets-samples/cc/samples-cc-react-app/src/App.tsx b/widgets-samples/cc/samples-cc-react-app/src/App.tsx index 8860bf10e..286c35bbe 100644 --- a/widgets-samples/cc/samples-cc-react-app/src/App.tsx +++ b/widgets-samples/cc/samples-cc-react-app/src/App.tsx @@ -90,6 +90,14 @@ function App() { const savedAllowInternationalDn = window.localStorage.getItem('allowInternationalDn'); return savedAllowInternationalDn === 'true'; }); + const [disableWebRTCRegistration, setDisableWebRTCRegistration] = useState(() => { + const savedDisableWebRTCRegistration = window.localStorage.getItem('disableWebRTCRegistration'); + return savedDisableWebRTCRegistration === 'true'; + }); + + const WEBRTC_DEPENDENT_WIDGETS = ['incomingTask', 'taskList', 'callControl', 'callControlCAD']; + const isWidgetDisabledByWebRTC = (widget: string) => + disableWebRTCRegistration && WEBRTC_DEPENDENT_WIDGETS.includes(widget); const handleSaveStart = () => { setShowLoader(true); @@ -138,6 +146,7 @@ function App() { }, cc: { allowMultiLogin: isMultiLoginEnabled, + disableWebRTCRegistration, }, ...(integrationEnv && { services: { @@ -224,6 +233,17 @@ function App() { } }; + const toggleDisableWebRTCRegistration = () => { + const newValue = !disableWebRTCRegistration; + setDisableWebRTCRegistration(newValue); + if (newValue) { + setSelectedWidgets((prev) => ({ + ...prev, + ...WEBRTC_DEPENDENT_WIDGETS.reduce((acc, w) => ({...acc, [w]: false}), {}), + })); + } + }; + function playNotificationSound() { const ctx = new AudioContext(); const osc = ctx.createOscillator(); @@ -328,6 +348,9 @@ function App() { redirect_uri: redirectUri, scope: requestedScopes, }, + cc: { + disableWebRTCRegistration, + }, }, }; @@ -365,6 +388,9 @@ function App() { useEffect(() => { window.localStorage.setItem('hideDesktopLogin', JSON.stringify(hideDesktopLogin)); }, [hideDesktopLogin]); + useEffect(() => { + window.localStorage.setItem('disableWebRTCRegistration', JSON.stringify(disableWebRTCRegistration)); + }, [disableWebRTCRegistration]); useEffect(() => { store.setIncomingTaskCb(onIncomingTaskCB); @@ -526,6 +552,7 @@ function App() { name={widget} checked={selectedWidgets[widget]} onChange={handleCheckboxChange} + disabled={isWidgetDisabledByWebRTC(widget)} data-testid={`samples:widget-${widget}`} />   @@ -633,7 +660,11 @@ function App() {
Note: The "Enable Multi Login" option must be set before initializing the SDK. Changes to this setting after SDK initialization will not take effect. Please ensure @@ -642,6 +673,41 @@ function App() { +
From 43c81dc9ea3ffbb9fbd867456d6d0bd92a0e7474 Mon Sep 17 00:00:00 2001 From: vamshi Date: Thu, 28 May 2026 18:16:08 +0530 Subject: [PATCH 2/2] fix(store): CAI-7899 attach SDK listeners on stationLoginSuccess addEventListeners() previously ran only in the AGENT_DN_REGISTERED and AGENT_RELOGIN_SUCCESS handlers. When Mobius registration is skipped (Epic Hyperspace non-calling windows, Extension/AgentDN logins) and silent relogin does not run, neither event fires, so agent:stateChange (and related) listeners were never attached and UserState froze. Also invoke addEventListeners() from handleLogin, guarded by the existing listenersAdded flag so listeners attach exactly once regardless of which event fires first. Co-authored-by: Cursor --- packages/contact-center/store/src/storeEventsWrapper.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/contact-center/store/src/storeEventsWrapper.ts b/packages/contact-center/store/src/storeEventsWrapper.ts index 0b53cc974..51f396e88 100644 --- a/packages/contact-center/store/src/storeEventsWrapper.ts +++ b/packages/contact-center/store/src/storeEventsWrapper.ts @@ -923,6 +923,13 @@ class StoreWrapper implements IStoreWrapper { // @ts-expect-error To be fixed in SDK - https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6762 this.setTeamId(payload.teamId); }); + // CAI-7899: Ensure CC SDK listeners (incl. agent:stateChange) are attached even when + // Mobius registration is skipped (non-WebRTC tabs e.g. Epic Hyperspace secondary windows, + // or Extension/AgentDN logins) and silent relogin doesn't run. + if (!listenersAdded) { + addEventListeners(); + listenersAdded = true; + } }; ccSDK.on(CC_EVENTS.AGENT_STATION_LOGIN_SUCCESS, handleLogin);