We’ve got a weird caching issue with the genesyscloud-webrtc-sdk (messaging module) in our Node.js backend that serves the frontend config.
We’re setting custom guest attributes for authenticated users before initializing the widget. The goal is to pass the internal user ID so our Architect flow can look up their profile.
Here’s the initialization snippet we’re sending down:
const widgetConfig = {
organizationId: 'org-123',
deploymentId: 'deploy-456',
guestAttributes: {
internalUserId: req.session.userId,
userType: 'authenticated'
}
};
The widget loads fine. The flow picks up the internalUserId.
The problem hits when the user logs out of our app. We’re calling sdk.disconnect() and then re-initializing for the new user. The new user gets the widget, but the flow is still seeing the previous user’s internalUserId.
We’re not seeing any errors in the console. The network tab shows the new session token being generated correctly. It feels like the guest attributes are stuck in the local storage or the SDK session cache.
Has anyone hit this? Do we need to explicitly wipe the guest attributes or is there a different destroy method we’re missing?
POST /api/v2/conversations/webchat
Body: { "guestAttributes": { "internalUserId": "old-user-123" } }
That old ID is hanging around.