Skip to content

fix: MUSD-1175 MetaMask Card "Avail. balance" incorrectly changes based on preferred fiat currency cp-8.3.0#33293

Merged
Matt561 merged 1 commit into
mainfrom
fix/musd-1175-card-balance-incorrect-when-user-has-non-usd-currency-selected
Jul 15, 2026
Merged

fix: MUSD-1175 MetaMask Card "Avail. balance" incorrectly changes based on preferred fiat currency cp-8.3.0#33293
Matt561 merged 1 commit into
mainfrom
fix/musd-1175-card-balance-incorrect-when-user-has-non-usd-currency-selected

Conversation

@Matt561

@Matt561 Matt561 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed bug where the Money Home Card "Avail. balance" was being converted incorrectly using the user's selected fiat currency. This fix removes the USD conversion of the Card balance when the primaryToken is the Money account/vmUSD token.

Changelog

CHANGELOG entry: fixed Card balance on Money Home to be in USD

Related issues

Fixes: MUSD-1175: MetaMask Card "Avail. balance" incorrectly changes based on preferred fiat currency

Manual testing steps

Feature: Money Home Card available balance

  Scenario: user views Card balance with a non-USD preferred currency
    Given the user has a Card balance and a non-USD preferred fiat currency
    When the user opens the Money Home screen
    Then the Card available balance is displayed in USD

Screenshots/Recordings

Before

Card balance isn't pinned to USD.

musd-1175-card-balance-on-money-home-not-pinned-to-usd-before.mov

After

Card balance is pinned to USD regardless of user's preferred currency.

musd-1175-card-balance-on-money-home-not-pinned-to-usd.mov

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.

@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.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR changes are confined to MoneyHomeView.tsx and its test file. The functional change is a bug fix in the cardBalanceUsd useMemo: previously it always converted the raw fiat number from the user's selected currency to USD via convertSelectedFiatToUsd; now it checks cardPrimaryToken?.isMoneyAccountEntry — if true, the raw fiat value is already in USD and is used directly (pass-through), otherwise the currency conversion is applied. This is a correctness fix for the MetaMask Card balance display on the Money home screen. The test file adds a new test case for Money Account entries and updates an existing test that previously expected $0.00 (fallback when rates unavailable) to now expect $90.00 (pass-through for Money Account entries). This change is entirely within the SmokeMoney domain (MetaMask Card home screen, balance display). No swap confirmations, network management, account management, browser, snaps, or onboarding flows are affected. SmokeMoney is the appropriate and sufficient tag. Per SmokeMoney tag description, SmokeSwap and SmokeConfirmations are only needed when the Card Add Funds or similar flows execute swaps — this change is only about balance display logic, not transaction execution.

Performance Test Selection:
The change is a conditional check in a useMemo hook that avoids an unnecessary currency conversion for Money Account entries. This is a minor computational optimization (skipping one function call) with no meaningful performance impact on rendering times, asset loading, or any other performance-sensitive flow. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Matt561 Matt561 marked this pull request as ready for review July 14, 2026 21:55
@Matt561 Matt561 requested a review from a team as a code owner July 14, 2026 21:55
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 14, 2026
@Matt561 Matt561 enabled auto-merge July 14, 2026 22:12
@Matt561 Matt561 added this pull request to the merge queue Jul 15, 2026
Merged via the queue into main with commit d95691f Jul 15, 2026
211 of 232 checks passed
@Matt561 Matt561 deleted the fix/musd-1175-card-balance-incorrect-when-user-has-non-usd-currency-selected branch July 15, 2026 15:03
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 15, 2026
@metamask-ci metamask-ci Bot added the release-8.4.0 Issue or pull request that will be included in release 8.4.0 label Jul 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.4.0 Issue or pull request that will be included in release 8.4.0 risk:low AI analysis: low risk size-S team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants