Skip to content

feat: pass getUseAssetsControllerForRates to bridge controller#30308

Merged
bergarces merged 2 commits into
mainfrom
bridge-controller-assets-controller-init
May 21, 2026
Merged

feat: pass getUseAssetsControllerForRates to bridge controller#30308
bergarces merged 2 commits into
mainfrom
bridge-controller-assets-controller-init

Conversation

@bergarces

@bergarces bergarces commented May 18, 2026

Copy link
Copy Markdown
Contributor

Description

Pass the hook to BridgeController so it acts based on the feature flag.

No behaviour changes with the flag off.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3198

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

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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
Moderate risk because it changes BridgeController initialization behavior by consulting remote feature flags and wiring new messenger permissions; could affect bridge rate sourcing when the flag is enabled or if flag state retrieval fails.

Overview
Adds a getUseAssetsControllerForRates hook to BridgeController initialization that checks the assetsUnifyState remote feature flag (v1) via RemoteFeatureFlagController:getState, defaulting to false on missing/invalid state or errors.

Updates the bridge init messenger types/delegation to allow calling RemoteFeatureFlagController:getState, and extends unit tests to cover enabled/disabled/absent/exception cases for the new hook.

Reviewed by Cursor Bugbot for commit 26c05d6. Bugbot is set up for automated code reviews on this repo. Configure here.

@bergarces bergarces requested review from a team as code owners May 18, 2026 12:33
@github-actions

Copy link
Copy Markdown
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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.03%. Comparing base (5624ab0) to head (f44fb67).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...ollers/bridge-controller/bridge-controller-init.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30308      +/-   ##
==========================================
+ Coverage   81.98%   82.03%   +0.05%     
==========================================
  Files        5447     5443       -4     
  Lines      145537   145287     -250     
  Branches    33248    33211      -37     
==========================================
- Hits       119312   119185     -127     
+ Misses      18094    17979     -115     
+ Partials     8131     8123       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeSwap, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes introduce a new getUseAssetsControllerForRates callback in the BridgeController initialization that reads the assetsUnifyState remote feature flag to determine whether to use the AssetsController for token rates during bridge/swap flows. The messenger is extended to allow the BridgeController to call RemoteFeatureFlagController:getState.

Why SmokeSwap: The BridgeController directly powers bridge and swap functionality. The new callback changes how token rates are sourced when the assetsUnifyState feature flag is enabled, which could affect quote accuracy and swap/bridge flow behavior.

Why SmokeConfirmations: Per SmokeSwap tag description, when selecting SmokeSwap, also select SmokeConfirmations since transaction confirmations are part of the swap/bridge flow.

Risk assessment (medium):

  • Changes are in the core Engine initialization path (critical area)
  • However, the change is feature-flag gated with a safe false fallback on any error
  • The messenger change is purely additive (adds one new action delegation)
  • Comprehensive unit tests cover all edge cases (enabled, disabled, absent flag, thrown error)
  • No breaking changes to existing BridgeController behavior when flag is off

No performance tests: The changes are in controller initialization logic (not UI rendering, list components, or startup critical path). The feature flag check is a simple synchronous call with error handling, not a performance-sensitive operation.

Performance Test Selection:
The changes are in bridge controller initialization logic - adding a feature flag callback that makes a synchronous messenger call. This does not affect UI rendering performance, list rendering, app startup time, or any other performance-sensitive paths. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@bergarces bergarces enabled auto-merge May 18, 2026 13:48
@bergarces bergarces added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 942b65b May 21, 2026
269 of 282 checks passed
@bergarces bergarces deleted the bridge-controller-assets-controller-init branch May 21, 2026 14:58
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants