fix: make anonymousId cross-subdomain reconciliation the default - #1400
Merged
Merged
Conversation
…ove the opt-in flag resolveAnonymousIdConflicts shipped default-off in the last release as a cautious first step, before we'd confirmed the actual staged-rollout path (Flagon gates + version_mappings pinning in analytics.js-versions) already handles this at the infrastructure level. That makes the application-level opt-in redundant: exposure is controlled by which build a source's CDN bundle contains, not by a flag inside it. Remove the flag and make getConsistent the only anonymousId resolution path.
🦋 Changeset detectedLatest commit: a6dd87d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Please upload reports for the commit a6dd87d to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## master #1400 +/- ##
==========================================
- Coverage 91.59% 91.58% -0.01%
==========================================
Files 127 127
Lines 4163 4159 -4
Branches 1040 1038 -2
==========================================
- Hits 3813 3809 -4
Misses 350 350
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
MichaelGHSeg
approved these changes
Sep 11, 2026
abueide
added a commit
that referenced
this pull request
Sep 11, 2026
## Summary Manual version bump (the `Changeset Release Creator` bot is still broken -- see #1399 for the ongoing org-level Actions allow-list issue). Same as before: ran `yarn update-versions-and-changelogs` against the one changeset currently pending on `master`, from #1400 (removing the `resolveAnonymousIdConflicts` opt-in flag, making cross-subdomain `anonymousId` reconciliation unconditional). `@segment/analytics-next` bumps `1.84.2` -> `1.84.3`. Merging this (commit message starts with `Version Packages`) triggers `publish.yml`'s `should-release` check on push to `master`, which runs the real npm publish + CDN deploy. ## Test plan - [x] Relevant test suites pass (`src/generated`, `src/core/user`, `src/core/storage`) - [x] `tsc --noEmit` clean - [x] Verified `packages/browser/src/generated/version.ts` and `package.json` both read `1.84.3` - [x] Verified the generated `CHANGELOG.md` entry attributes #1400 correctly
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
Follow-up to #1398 (released as
1.84.2). That PR shippedresolveAnonymousIdConflictsas an opt-in, default-off flag -- a cautious first step taken before we'd confirmed how staged rollout actually works for this SDK.Since then we traced the real delivery path end-to-end (
ajs-renderer->analytics.js-versions-> Flagon gates): which build of analytics-next a given source's CDN bundle contains is already controlled per-source, viav2projectspins and theajs-renderer/v2rolloutFlagon gate. That makes an application-level opt-in redundant -- exposure to this fix is governed by which code a source receives, not by a flag inside that code. Keeping the flag just adds a second, unnecessary gate: a source could receive the fix and still see the bug because nobody flipped an option in theirload()call.This PR removes
resolveAnonymousIdConflictsand makesUniversalStorage#getConsistentthe soleanonymousIdresolution path -- no flag, no default to reason about.Behavior change: no longer opt-in. Only affects sources where the cookie and localStorage already disagree (the broken case); when they agree, behavior is unchanged. The flag only existed for one release, so there's no meaningful adoption window for anyone depending on its absence.
Test plan
Userunit tests to drop the flag parameter -- reconciliation is now the only path (packages/browser/src/core/user/__tests__/index.test.ts)packages/browser-integration-tests/src/anonymous-id-subdomain-sync.test.ts) -- verified locally against a fresh build, including a full instrumented state-trace confirming the cookie wins the disagreement and resyncs localStorage as expectedpackages/browserunit suite passes (unrelated pre-existing flake inajs-destination/Amplitude tests, confirmed by rerun)browser-integration-testse2e suite passestsc --noEmitandeslintclean on all touched files