Hi all,
Is there a preferred method for handling real-time presence updates within the Embeddable Framework now? We’ve transitioned to v15.1 of the Client App SDK and are seeing inconsistent behavior with the gc.presence.stats events. Specifically, the agent status doesn’t reliably update in our custom desktop after a state change - like going from Available to Not Ready.
The flow looks like this: we’re subscribing to gc.presence.stats using the SDK, displaying the agent’s current state in a React component, and expect that component to re-render on status change. It sometimes works, but often requires a full page refresh to reflect the new state.
I’ve confirmed the state is updating correctly in the Genesys Cloud web app itself. The logs show the events are firing, but the component isn’t always reacting. Is there a specific lifecycle method or event I should be listening for within the Embeddable Framework to ensure the component re-renders after a presence update?
Here’s a simplified code snippet:
gc.presence.stats.on('change', (stats) => {
console.log('Presence stats changed:', stats);
this.setState({ agentStatus: stats.presence });
});
Is the stats.presence object the correct way to get the agent status, or is there something else I should be querying? Any guidance would be appreciated.