microsoft / omnichannel-chat-sdk

Headless Chat SDK to build your own chat widget against Dynamics 365 Omnichannel Services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get Post Chat Survey Context fails after end chat

xTEddie opened this issue · comments

Reproducing Steps:

  1. Initiates chat
  2. Agent accepts invite
  3. Customer ends chat
  4. Getting Post Chat Survey Context fails

Root cause is on calling chatSDK.endChat(), the requestId is generated with a new uuidv4. Calling chatSDK.getPostChatSurveyContext() would use the new requestId which is not valid.

Temporary solution would be to call chatSDK.getPostChatSurveyContext() before chatSDK.endChat() is called.

...

const postChatSurveyContext = chatSDK.getPostChatSurveyContext(); 
await chatSDK.endChat();

// Display Post Chat Survey