feat: add active_ab_tests to swap events#8152
Merged
Conversation
…ts-to-swap-bridge # Conflicts: # packages/bridge-status-controller/src/bridge-status-controller.ts
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Contributor
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
micaelae
reviewed
Mar 10, 2026
| isStxEnabled?: BridgeHistoryItem['isStxEnabled']; | ||
| location?: BridgeHistoryItem['location']; | ||
| // Legacy field for `ab_tests` metrics payload. | ||
| abTests?: BridgeHistoryItem['abTests']; |
Member
There was a problem hiding this comment.
Will clients be using this field after they update to this controller version?
Contributor
Author
There was a problem hiding this comment.
Yes, assets team is still using this field for active tests. Will be deprecated as soon as those tests are complete.
micaelae
previously approved these changes
Mar 10, 2026
micaelae
approved these changes
Mar 10, 2026
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.
Explanation
This PR updates Unified SwapBridge metrics migration support so legacy and new A/B test payloads can coexist without conflation.
Current state:
ab_tests.active_ab_testsneeded to be supported in parallel during migration.What changed:
active_ab_testssupport to bridge-controller metrics event context/payload types.activeAbTestscontext input/storage alongside legacyabTests.ab_testsandactive_ab_testsare handled independently.Why another package was updated:
active_ab_teststo keep typing aligned.References
Checklist
Note
Medium Risk
Changes metrics context propagation and event payload construction for Unified SwapBridge events, which could affect analytics schemas and downstream consumers if mis-keyed or emitted unexpectedly. No transaction execution logic is changed, but tracking behavior and stored history metadata are modified.
Overview
Adds parallel support for the new
active_ab_testsmetrics field across Unified SwapBridge tracking while keeping legacyab_testsintact for migration.bridge-controllerexpands metrics context/payload types to accept optionalactive_ab_tests.bridge-status-controllernow accepts/storesactiveAbTestsin tx history, threads it throughsubmitTx/submitIntentand pre-confirmation metrics building, and updates event tracking to resolve/emitab_testsandactive_ab_testsindependently (no fallback/conflation). Tests and changelogs are updated accordingly.Written by Cursor Bugbot for commit 11de6f2. This will update automatically on new commits. Configure here.