fix: add diagnostics + retry logic to isEnabled and getTopLevelDomain#1543
Open
daniel-graham-amplitude wants to merge 11 commits intomainfrom
Open
fix: add diagnostics + retry logic to isEnabled and getTopLevelDomain#1543daniel-graham-amplitude wants to merge 11 commits intomainfrom
daniel-graham-amplitude wants to merge 11 commits intomainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
4bab69b to
ba83071
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checklist
Note
Medium Risk
Touches cross-window
postMessagehandling, dynamic script loading, and cookie-detection logic; bugs here could affect instrumentation startup, diagnostics noise, or cookie persistence across many browser environments.Overview
Introduces a new cross-window messaging layer in
analytics-core(BaseWindowMessenger,getOrCreateWindowMessenger, andenableBackgroundCapture) and exports shared origin/script constants, enabling autocapture and session replay to share a singleton messenger, dedupe script loads, and avoid handler race conditions.Hardens cookie-related behavior:
CookieStorage.isEnabled()now retries and caches successful results, and both cookie enablement andgetTopLevelDomain()failures can emit diagnostics events (withgetTopLevelDomain()now accepting a diagnostics client). Uncaught SDK error diagnostics now track multiple loader script URLs instead of a single URL.plugin-autocapture-browseris refactored to use the shared messenger (replacingWindowMessengerwithenableVisualTagging+ core singleton), adds background-capture actions, and updates text extraction to avoidcloneNodeside effects;session-replay-browserenables background capture when opened viawindow.opener. Includes version/CDN snippet updates across packages and minor dependency lockfile bumps.Written by Cursor Bugbot for commit ba83071. This will update automatically on new commits. Configure here.