release(runway): cherry-pick fix: swaps stale dest exchange rates - #45011
Merged
Merged
Conversation
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> Removes condition that prevents fetching token prices when cached values exist in the asset controller states. Token prices will now be fetched on each quote fetch to prevent displaying stale fiat amounts <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: chore: bump bridge controllers to fix stale dest exchange rates Fixes https://consensyssoftware.atlassian.net/browse/SWAPS-4851 ```gherkin Feature: swap destination amount price Scenario: user requests a USDC->ETH quote Given they get a quote When user switches the assets (note the dest fiat amount) Then the src fiat amount matches the previous dest amount When user switches the assets again (note the dest fiat amount) Then the src fiat amount matches the previous dest amount ``` <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <!-- [screenshots/recordings] --> <!-- [screenshots/recordings] --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes swap/bridge pricing behavior and controller messenger permissions; impact is localized to bridge UI and exchange-rate fetching, but incorrect rates would mislead users on fiat amounts. > > **Overview** > Fixes **stale destination fiat amounts** when swapping by always refreshing source-token exchange rates instead of reusing cached market data. > > **`useBridgeExchangeRates`** now dispatches `setSrcTokenExchangeRates` whenever a source token is selected, removing the guard that skipped the fetch when `exchangeRateFromMarketData` already had a value. > > **Bridge controller packages** are bumped (`@metamask/bridge-controller` **78.0.1**, `@metamask/bridge-status-controller` **74.6.0**), with related transitive updates (`keyring-api`, `keyring-utils`). The bridge controller messenger **stops delegating** `TokenRatesController:getState` and `MultichainAssetsRatesController:getState`, aligning with the updated controllers’ use of **`AssetsController:getExchangeRatesForBridge`**. > > LavaMoat webpack policies are updated for the **`@metamask/keyring-api>@metamask/keyring-utils`** dependency path. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3df4a4d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
sleepytanya
previously approved these changes
Jul 29, 2026
sleepytanya
enabled auto-merge (squash)
July 29, 2026 23:52
|
Contributor
Builds ready [31a60bd]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 5 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
sleepytanya
approved these changes
Jul 30, 2026
Contributor
|
No release label on PR. Adding release label release-13.42.0 on PR, as PR was cherry-picked in branch 13.42.0. |
This branch was previously deployed
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
Removes condition that prevents fetching token prices when cached values
exist in the asset controller states. Token prices will now be fetched
on each quote fetch to prevent displaying stale fiat amounts
Changelog
CHANGELOG entry: chore: bump bridge controllers to fix stale dest
exchange rates
Related issues
Fixes https://consensyssoftware.atlassian.net/browse/SWAPS-4851
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask
Extension 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
Changes swap/bridge pricing behavior and controller messenger
permissions; impact is localized to bridge UI and exchange-rate
fetching, but incorrect rates would mislead users on fiat amounts.
Overview
Fixes stale destination fiat amounts when swapping by always
refreshing source-token exchange rates instead of reusing cached market
data.
useBridgeExchangeRatesnow dispatchessetSrcTokenExchangeRateswhenever a source token is selected, removing the guard that skipped the
fetch when
exchangeRateFromMarketDataalready had a value.Bridge controller packages are bumped
(
@metamask/bridge-controller78.0.1,@metamask/bridge-status-controller74.6.0), with relatedtransitive updates (
keyring-api,keyring-utils). The bridgecontroller messenger stops delegating
TokenRatesController:getStateandMultichainAssetsRatesController:getState, aligning with the updatedcontrollers’ use of
AssetsController:getExchangeRatesForBridge.LavaMoat webpack policies are updated for the
@metamask/keyring-api>@metamask/keyring-utilsdependency path.Reviewed by Cursor Bugbot for commit
3df4a4d. Bugbot is set up for automated
code reviews on this repo. Configure
here.
Co-authored-by: MetaMask Bot metamaskbot@users.noreply.github.com c1a5d29