Skip to content

chore(runway): cherry-pick fix: add optional abtest to more swaps and perps events#26599

Merged
joaoloureirop merged 1 commit intorelease/7.67.0from
cherry-pick-7-67-0-4135c1a
Feb 25, 2026
Merged

chore(runway): cherry-pick fix: add optional abtest to more swaps and perps events#26599
joaoloureirop merged 1 commit intorelease/7.67.0from
cherry-pick-7-67-0-4135c1a

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Feb 25, 2026

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 the ab_tests
property. Completion events (swap confirmed, perps trade executed) do
not.

What this PR does

1. Swaps: Thread ab_tests through BridgeStatusController (via
patch)

The ab_tests context is read from the Redux bridge slice in
useSubmitBridgeTx and passed through to
BridgeStatusController.submitTx / submitIntent.

2. Perps: Thread ab_tests through OrderParams.trackingData

The ab_tests context (already available in PerpsOrderView via
navigation params) is passed through the existing trackingData
mechanism to TradingService.#trackOrderResult, which includes it in
PERPS_TRADE_TRANSACTION events.

Events carrying ab_tests — before vs. after

Already on main (no changes needed)

Event Flow Where
SWAP_PAGE_VIEWED Swaps BridgeView reads from Redux
abTestContext
PERPS_SCREEN_VIEWED Perps PerpsOrderView reads from route
params

New in this PR

Event Flow Where added
Unified SwapBridge Submitted Swaps
BridgeStatusController.submitTx / submitIntent
Unified SwapBridge Completed Swaps BridgeStatusController
history lookup
Unified SwapBridge Failed Swaps BridgeStatusController history
lookup
Unified SwapBridge Polling Status Updated Swaps
BridgeStatusController history lookup
PERPS_TRADE_TRANSACTION (status: executed) Perps
TradingService.#trackOrderResult
PERPS_TRADE_TRANSACTION (status: failed) Perps
TradingService.#trackOrderResult

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    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-controller to accept and emit ab_tests, stores abTests on bridge tx history items, and resolves it for later UnifiedSwapBridge events (completed/failed/polling updates). The app now reads abTestContext from the Redux bridge slice in useSubmitBridgeTx and passes it through both submitTx and intent flow (handleIntentTransactionsubmitIntent).

For perps, PerpsOrderView includes the route’s token-details layout variant in OrderParams.trackingData.abTests, TradingService adds ab_tests to PERPS_TRADE_TRANSACTION properties when present, and perps analytics typing is widened to allow Record<string,string> values. Separately, analytics/queue now 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

@runway-github runway-github bot requested review from a team as code owners February 25, 2026 20:59
@github-actions
Copy link
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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Feb 25, 2026
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - base branch is not main (base: release/7.67.0)

All E2E tests pre-selected.

View GitHub Actions results

@joaoloureirop joaoloureirop added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Feb 25, 2026
@joaoloureirop joaoloureirop enabled auto-merge (squash) February 25, 2026 23:15
@joaoloureirop joaoloureirop merged commit f365105 into release/7.67.0 Feb 25, 2026
184 of 199 checks passed
@joaoloureirop joaoloureirop deleted the cherry-pick-7-67-0-4135c1a branch February 25, 2026 23:15
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2026
@metamaskbot metamaskbot added the release-7.67.0 Issue or pull request that will be included in release 7.67.0 label Feb 26, 2026
@metamaskbot
Copy link
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.67.0 Issue or pull request that will be included in release 7.67.0 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants