Skip to content

fix: nft images not loading (flaky) cp-7.64.0#25705

Merged
juanmigdr merged 5 commits intomainfrom
fix/nft-images-flakiness
Feb 6, 2026
Merged

fix: nft images not loading (flaky) cp-7.64.0#25705
juanmigdr merged 5 commits intomainfrom
fix/nft-images-flakiness

Conversation

@juanmigdr
Copy link
Copy Markdown
Member

@juanmigdr juanmigdr commented Feb 5, 2026

Description

Seeing a bug with NFT import on mobile for a custom network. On extension, the image for this NFT shows up just fine after import. On mobile, the image is blank. Multiple users have reported this.

Mobile:
image

Extension:
image

Solution:
@sahar-fehri spotted that the difference between Extension and Mobile was the IPFS gateway, following that piece of information we identified where to change the ipfs url so that we only had to modify the cleint (mobile) and not core.

Furthermore, after fixing that issue, we spotted some kind of flakiness where images were sometimes displayed and other times werent. This was due to the image being null while decoding the IPFS url which triggered expo-image calling onError and therefore not loading the image

Finally, I also found an existing bug on @MetaMask/confirmations where IPFS images are not resolved

Changelog

CHANGELOG entry: nft images not loading for ApexYugalabs + flakiness

Related issues

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

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

Screen.Recording.2026-02-05.at.16.37.35.mov

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
Changes NFT/IPFS image resolution and controller init parameters; while localized, it affects how NFT media URLs are derived and rendered across key user flows.

Overview
Fixes flaky/blank NFT images by avoiding rendering expo-image with an empty URI while an ipfs:// URL is still resolving: RemoteImage now returns null during the initial IPFS resolution state, with a new unit test covering the loading case and updated snapshots where the image subtree is absent until resolved.

Adds IPFS resolution to confirmations’ useEVMNfts transformation: image selection now asynchronously converts ipfs:// candidates via getFormattedIpfsUrl using the app’s configured gateway, falling back to the next URL when resolution returns ''/null or throws (with logging). Tests were updated/added to cover these fallback cases and to de-flake the send amount NFT image assertion by waiting for resolution.

Initializes NftController with an explicit ipfsGateway: 'dweb.link' and updates the init test accordingly, and fixes ERC1155 NFT list rendering to show (0) when balance is missing.

Written by Cursor Bugbot for commit a3c533b. This will update automatically on new commits. Configure here.

@juanmigdr juanmigdr changed the title fix: nft images not loading (flaky) 7.64.0 fix: nft images not loading (flaky) cp-7.64.0 Feb 5, 2026
@github-actions github-actions bot added size-S and removed size-XS labels Feb 5, 2026
sahar-fehri
sahar-fehri previously approved these changes Feb 5, 2026
@juanmigdr juanmigdr requested a review from a team as a code owner February 5, 2026 14:58
@juanmigdr juanmigdr enabled auto-merge February 5, 2026 14:58
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@github-actions github-actions bot added size-M and removed size-S labels Feb 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 5, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: 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 in this PR focus on NFT image handling and IPFS URL resolution:

  1. NftController Initialization: Added ipfsGateway: 'dweb.link' configuration - this is a Phase 4 controller (Assets & Tokens) change that affects NFT image resolution.

  2. RemoteImage Component: Modified to return null during IPFS URL resolution instead of rendering with an invalid URI. This is a widely-used component but the change is defensive (better loading state handling).

  3. NFT Component in Confirmations: Added fallback for ERC1155 balance display (balance || 0) - prevents undefined values from being displayed.

  4. useNfts Hook: Major change adding async IPFS URL resolution for NFT images in the send flow. This hook is used in the confirmations/send flow for displaying NFTs.

The primary impact is on NFT sending confirmations where users select and send NFTs. The changes improve IPFS image resolution and handle edge cases better. The RemoteImage component is used broadly, but the change is a defensive improvement that prevents rendering with invalid URIs.

Why SmokeConfirmations: The NFT component changes, useNfts hook, and related test files are all in the confirmations directory and directly affect the NFT sending flow which is part of transaction confirmations. The changes to how NFT images are resolved and displayed during the send confirmation process require validation.

Why not other tags:

  • The changes don't affect account management (SmokeAccounts)
  • No network/chain selection changes (SmokeNetworkAbstractions)
  • No trading/swap functionality (SmokeTrade)
  • No Snaps functionality (FlaskBuildTests)
  • The RemoteImage changes are defensive and don't fundamentally change behavior for non-NFT use cases

Performance Test Selection:
The changes are focused on NFT image resolution and display logic. While RemoteImage is used broadly, the changes are defensive (better loading state handling) and don't introduce new rendering patterns or data loading that would significantly impact performance. The IPFS URL resolution is already async and the changes just improve how the loading state is handled. No changes to account lists, login flows, app launch, or other performance-critical paths.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Feb 5, 2026

@juanmigdr juanmigdr added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit 71d7c3f Feb 6, 2026
93 checks passed
@juanmigdr juanmigdr deleted the fix/nft-images-flakiness branch February 6, 2026 09:54
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
@metamaskbot metamaskbot added the release-7.66.0 Issue or pull request that will be included in release 7.66.0 label Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.66.0 Issue or pull request that will be included in release 7.66.0 size-M team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants