microsoft / clarity-apps

Repo for distributing Clarity Apps packages
MIT License
46 stars 2 forks source link

[BUG][iOS] Bug Report #58

Closed rohanvasundhara closed 2 months ago

rohanvasundhara commented 2 months ago

Issue Title: Crash on integrating Microsoft Clarity SDK (v2.1.0) due to NSInvalidArgumentException

Description: I am encountering a recurring crash when integrating the Microsoft Clarity SDK (v2.1.0) into my iOS application. The crash is related to an NSInvalidArgumentException, specifically stating: Attempt to add script message handler with name 'clarityMessageHandler529' when one already exists.

Additional Information: Microsoft Clarity SDK Version: 2.1.0

Screenshot 2024-08-29 at 2 44 48 PM

amralaa-MSFT commented 2 months ago

Thanks @rohanvasundhara for reporting the issue. Could you please send your Clarity project ID to clarity-apps-support@microsoft.com? Is the issue consistent? If so, how can it be reproduced?

amralaa-MSFT commented 2 months ago

We've checked and found that this should never be possible from Clarity v2.1.0. Could you please double check that the crashed session is actually coming from a device with Clarity version 2.1.0 and not an older version?

sis3141 commented 2 months ago

We are getting report of similar issue from sentry but not sure how to reproduce this And this clarity version is the only version our service has ( we adopted version 3.0.1 as our first clarity feature)

Screenshot 2024-09-09 at 1 48 10 AM
sarthakmetazone commented 2 months ago

I am able to reproduce this issue, whenever we are using react-native-webview with clarity, then this issue is arising in IOS. "react-native-clarity": 3.0.1 "react-native": 0.74.3 "react-native-webview": 13.8.1

amralaa-MSFT commented 2 months ago

@sis3141 and @sarthakmetazone. This WebView issue should have been already fixed. Please try updating react-native-clarity to version 3.0.2 and let us know if it resolves the crash issue.

amralaa-MSFT commented 2 months ago

@sis3141 and @sarthakmetazone. We recommend upgrading to version 3.0.3 instead as it includes more fixes.