clarity icon indicating copy to clipboard operation
clarity copied to clipboard

salesforce chatbot conflict

Open DamonDay opened this issue 5 years ago • 4 comments

abnormal chatbot screenshot (with MS Clarity integrated) image

normal (MS Clarity disabled) image

the official document of salesforce chatbot: https://www.salesforce.com/products/service-cloud/features/live-agent/

DamonDay avatar Nov 11 '21 07:11 DamonDay

We are having the same issue, but have noticed this actually with Salesforce Snapins Chat, not necessarily Chatbots. We have since disabled Clarity due to the broken CSS with Salesforce Chat

bakervin avatar Nov 12 '21 02:11 bakervin

Spent some time investigating this issue today. Here is the summary.

Repro steps:

This issue only occurs when the scripts are loaded and executed in this order first Clarity and then Salesforce chatbot. Unfortunately, I can't share any live environment showcasing this issue.

Root cause analysis:

The way attachShadow is patched by Clarity is incompatible with the way Salesforce Lightning Web Component (LWC) patches the same API.

Clarity patches attachShadow on the HTMLElement.prototype (code), while LWC patches the same API on Element.prototype (code). Because Element is higher up in the proto-chain than HTMLElement, LWC's polyfill is never invoked.

pmdartus avatar Dec 07 '21 08:12 pmdartus

Thanks @DamonDay and @bakervin for reporting. Thanks @pmdartus for fixing the issue!

sarveshnagpal avatar Dec 09 '21 15:12 sarveshnagpal

Really appreciate for your efforts!

DamonDay avatar Dec 11 '21 15:12 DamonDay