chore(runway): cherry-pick fix: add optional abtest to more swaps and perps events#26599
Merged
joaoloureirop merged 1 commit intorelease/7.67.0from Feb 25, 2026
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.67.0) All E2E tests pre-selected. |
joaoloureirop
approved these changes
Feb 25, 2026
Collaborator
|
No release label on PR. Adding release label release-7.67.0 on PR, as PR was cherry-picked in branch 7.67.0. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Core PR related: MetaMask/core#8007
The Token Details page is running an A/B test (
tokenDetailsV2AbTest)that compares a control layout vs. a treatment layout for action buttons
(Swap, buy, sell, long, short). To make conversion measurement easier,
we need to know whether users who completed a swap or perps trade
were in the control or treatment group.
Currently on
main, only page-level view events carry theab_testsproperty. Completion events (swap confirmed, perps trade executed) do
not.
What this PR does
1. Swaps: Thread
ab_teststhroughBridgeStatusController(viapatch)
The
ab_testscontext is read from the Reduxbridgeslice inuseSubmitBridgeTxand passed through toBridgeStatusController.submitTx/submitIntent.2. Perps: Thread
ab_teststhroughOrderParams.trackingDataThe
ab_testscontext (already available inPerpsOrderViewvianavigation params) is passed through the existing
trackingDatamechanism to
TradingService.#trackOrderResult, which includes it inPERPS_TRADE_TRANSACTIONevents.Events carrying
ab_tests— before vs. afterAlready on
main(no changes needed)SWAP_PAGE_VIEWEDBridgeViewreads from ReduxabTestContextPERPS_SCREEN_VIEWEDPerpsOrderViewreads from routeNew in this PR
Unified SwapBridge SubmittedBridgeStatusController.submitTx/submitIntentUnified SwapBridge CompletedBridgeStatusControllerUnified SwapBridge FailedBridgeStatusControllerhistoryUnified SwapBridge Polling Status UpdatedBridgeStatusControllerhistory lookupPERPS_TRADE_TRANSACTION(status:executed)TradingService.#trackOrderResultPERPS_TRADE_TRANSACTION(status:failed)TradingService.#trackOrderResultChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Touches analytics plumbing across swap/bridge controller patches and perps trade tracking; risk is mainly around event schema/propagation and controller API signature changes, not core transaction execution.
Overview
Threads optional A/B test context into swap/bridge and perps completion analytics so downstream events can be attributed to token-details layout experiments.
For swaps/bridge, the PR adds Yarn patches to
@metamask/bridge-controller/@metamask/bridge-status-controllerto accept and emitab_tests, storesabTestson bridge tx history items, and resolves it for laterUnifiedSwapBridgeevents (completed/failed/polling updates). The app now readsabTestContextfrom the Reduxbridgeslice inuseSubmitBridgeTxand passes it through bothsubmitTxand intent flow (handleIntentTransaction→submitIntent).For perps,
PerpsOrderViewincludes the route’s token-details layout variant inOrderParams.trackingData.abTests,TradingServiceaddsab_teststoPERPS_TRADE_TRANSACTIONproperties when present, and perps analytics typing is widened to allowRecord<string,string>values. Separately,analytics/queuenow re-drains the queue after a processing batch to handle operations enqueued during processing.Written by Cursor Bugbot for commit f86de6f. This will update automatically on new commits. Configure here.
4135c1a