-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: microsoft clarity identify error handling #1948
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request modify the Changes
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js (1)
58-68
: Consider race conditions in concurrent identify callsThe current implementation might lead to race conditions if multiple identify calls are made in quick succession, as trait setting operations could get interleaved.
Consider implementing a queue mechanism or adding a lock to ensure sequential processing of identify calls. Would you like me to provide an example implementation?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js
(1 hunks)
🔇 Additional comments (1)
packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js (1)
58-68
: Verify Microsoft Clarity SDK's promise support
The code assumes that window.clarity('identify', ...)
returns a Promise, but this should be verified with Microsoft Clarity's documentation.
packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js
Show resolved
Hide resolved
packages/analytics-js-integrations/src/integrations/MicrosoftClarity/browser.js
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1948 +/- ##
===========================================
- Coverage 58.30% 58.29% -0.01%
===========================================
Files 485 485
Lines 16614 16615 +1
Branches 3351 3349 -2
===========================================
Hits 9686 9686
- Misses 5683 5702 +19
+ Partials 1245 1227 -18 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
Basically we need to set traits call after the identify call, right? |
Yes. The previous code was written that way, we are sticking with that approach |
size-limit report 📦
|
PR Description
Adding error handling for microsoft clarity destination
Linear task (optional)
Resolves INT-2937
Cross Browser Tests
Please confirm you have tested for the following browsers:
Sanity Suite
Security
Summary by CodeRabbit
New Features
Bug Fixes