-
Notifications
You must be signed in to change notification settings - Fork 85
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: updated isLoaded and isReady conditions for mixpanel #1650
Conversation
WalkthroughThis update introduces a modification to the Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
Outdated
Show resolved
Hide resolved
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (2 hunks)
Additional comments: 2
packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (2)
- 101-101: The change to use
__loaded
instead ofconfig
in theisLoaded
method aligns with the PR's objectives and improves the accuracy of the Mixpanel integration's loading state assessment.- 105-105: The update to the
isReady
method to check for the__loaded
property instead ofconfig
is consistent with the PR's objectives and enhances the reliability of the Mixpanel integration's readiness assessment.
packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1650 +/- ##
===========================================
+ Coverage 53.91% 53.93% +0.02%
===========================================
Files 461 461
Lines 15613 15616 +3
Branches 3102 3098 -4
===========================================
+ Hits 8417 8422 +5
- Misses 5869 5899 +30
+ Partials 1327 1295 -32 ☔ View full report in Codecov by Sentry. |
size-limit report 📦
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
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: 1
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/analytics-js-integrations/tests/integrations/Mixpanel/browser.test.js (5 hunks)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (3 hunks)
Additional comments not posted (6)
packages/analytics-js-integrations/__tests__/integrations/Mixpanel/browser.test.js (2)
30-30
: Adding aloaded
property withexpect.any(Function)
in the expectations of the Mixpanel initialization tests is a good practice. It ensures that theloaded
callback function is passed correctly during the initialization process. This change aligns with the modifications in theMixpanel
class to support theisLoaded
andisReady
enhancements.Also applies to: 44-44, 59-59, 73-73
78-115
: The introduction of new tests forisLoaded
andisReady
functionality with asynchronous behavior is commendable. These tests simulate the asynchronous loading of the Mixpanel SDK and verify thatisLoaded
andisReady
correctly reflect the SDK's load state. This approach effectively tests the new functionality and ensures that it behaves as expected in asynchronous scenarios.packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (4)
69-69
: AddingisNativeSDKLoaded
initialized tofalse
is a straightforward and effective way to track the load state of the Mixpanel SDK. This property serves as the basis for theisLoaded
andisReady
methods to accurately reflect the SDK's load status.
97-99
: The implementation of theloaded
callback within theinit
method to setisNativeSDKLoaded
totrue
is correct and aligns with the objective of accurately tracking the SDK's load state. This approach ensures thatisLoaded
andisReady
can reliably indicate when the SDK is ready for use.
105-105
: TheisLoaded
method's implementation, which simply returns the value ofisNativeSDKLoaded
, is appropriate and efficient. It directly reflects the load state of the Mixpanel SDK, fulfilling the requirement for theisLoaded
functionality.
109-109
: TheisReady
method's implementation, which delegates toisLoaded
, is a sensible approach. It ensures consistency betweenisLoaded
andisReady
in terms of indicating the SDK's readiness, aligning with the intended enhancements.
packages/analytics-js-integrations/__tests__/integrations/Mixpanel/browser.test.js
Outdated
Show resolved
Hide resolved
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: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/analytics-js-integrations/tests/integrations/Mixpanel/browser.test.js (5 hunks)
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- packages/analytics-js-integrations/tests/integrations/Mixpanel/browser.test.js
- packages/analytics-js-integrations/src/integrations/Mixpanel/browser.js
Quality Gate passedIssues Measures |
PR Description
Resolves INT-1852
Updated isLoaded and isReady conditions for mixpanel
Linear task (optional)
Linear task link
Cross Browser Tests
Please confirm you have tested for the following browsers:
Sanity Suite
Security
Summary by CodeRabbit
isLoaded
andisReady
checks in the Mixpanel integration by updating the property used for verification.isLoaded
andisReady
functionality in the Mixpanel integration to include asynchronous behavior.