So, we’re back on this. Conversation detail events are showing up out of order after a WebSocket reconnection - feels like the baked-in reconnection handling is still a mess. It’s not a complete loss of events this time, which is…progress, I guess? It’s just that the order is scrambled. We’re seeing events from 3-4 minutes ago arriving after events from 30 seconds ago. It’s making event sequencing in the Architect flow a nightmare.
We’ve got an Architect flow that subscribes to conversation.v2.detail events for all conversations, using a wildcard for conversationId. It’s supposed to pull the updated conversation attributes and log them to a custom object - basic stuff, really. The flow is triggering correctly, but the data is…wrong. It’s like the events aren’t being processed in the order they occurred.
We’re hitting the WebSocket endpoint directly with a custom handler - no SDK involved, too much overhead. I’ve got the full handshake code here, just in case anyone thinks it’s something stupid:
const WebSocket = require('ws');
const ws = new WebSocket('wss://streaming.mypurecloud.com/v2/alerts/events');
ws.on('open', () => {
console.log('Connected');
ws.send(JSON.stringify({
"appId": "YOUR_APP_ID",
"topics": [
{
"topicName": "conversation.v2.detail",
"topicFilters": [
{
"type": "dimension",
"dimensionKey": "conversationId",
"value": "*"
}
]
}
]
}));
});
ws.on('message', (message) => {
console.log(message);
});
ws.on('close', (code, reason) => {
console.log('Disconnected', code, reason);
});
ws.on('error', (error) => {
console.error('Error', error);
});
Here’s what we’ve tried, and what didn’t work:
- Increased
maxEventBufferin the WebSocket configuration to 200, then 500. Still seeing out-of-order events. - Implemented a retry mechanism with exponential backoff. Reconnects happen quickly, but doesn’t fix the ordering.
- Added timestamps to the events within the Architect flow. Confirmed the events are arriving out of order before any processing happens.
- Checked the Genesys Cloud platform status page. No reported incidents.
- Verified the subscription is active via the developer tools. It shows as subscribed.
- We just yeet this into prod, it was working fine in staging.
The problem isn’t a complete data loss, it’s the jumbled order. It’s making the entire Architect flow unreliable. From what I’ve seen, it seems like the reconnection process isn’t handling the event stream properly. Any ideas what’s going on?