We’re building a custom agent desktop wrapper using the Genesys Cloud Client App SDK. The goal is to maintain a persistent state object that survives media changes, specifically when a voice call gets transferred to another queue or agent.
The issue is that while we can successfully write attributes during the initial connection, they disappear or fail to update once the media type changes from voice to transfer or when the interaction is reassigned.
Here is the logic we’re using in the onEvent listener for conversation.participant.update:
sdkClient.conversations.on('conversation.participant.update', (event) => {
const interactionId = event.data.interactionId;
const participantId = event.data.id;
// Attempting to patch attributes
const payload = {
participant: {
attributes: {
'custom.sessionId': generateSessionId(),
'custom.lastUpdated': new Date().toISOString()
}
}
};
sdkClient.api.conversationsApi.postConversationParticipantsPatch(
interactionId,
participantId,
payload
).catch(err => console.error('Patch failed', err));
});
The API call returns a 200 OK, and if we immediately call getConversationParticipants, the attributes are there. However, as soon as the transfer is accepted by the receiving agent, the participant object in the SDK seems to reset or the attributes vanish from the UI context.
We tried moving the logic to interaction.update, but that doesn’t give us the specific participant context we need for the attribute patch. Is there a specific event we’re missing that signals the participant identity has shifted? Or are we hitting a limitation where attributes are scoped to the media type rather than the interaction?
Also, the logs show a 409 Conflict occasionally when the patch happens right at the moment of transfer. Is there a race condition with the internal state management of the SDK?