Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: IPFS NFTs fetching #22627

Merged
merged 13 commits into from
Feb 6, 2024
Merged

fix: IPFS NFTs fetching #22627

merged 13 commits into from
Feb 6, 2024

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Jan 22, 2024

Description

Problem: With IPFS gateway=on and Display NFT media=on, manually imported IPFS NFT render blank.

Diagnosis: NftController checks isIpfsGatewayEnabled, but this value was always undefined even with the setting enabled in extension. I'm not sure why the field was present in core's preferences controller but not extension's.

Solution: Update extension to toggle isIpfsGatewayEnabled preference

Before:

Screen.Recording.2024-01-25.at.1.07.10.PM.mov

After:

Screen.Recording.2024-01-25.at.12.57.29.PM.mov

Related issues

Fixes:

Manual testing steps

  1. Set IPFS gateway=on and Display NFT media=on
  2. manually import an IPFS NFT (e.g. 0xee79a3e8aef1109a6ee82bf399ce9e1bd43cf5c4 on polygon)
  3. it should render

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@bergeron bergeron requested a review from a team as a code owner January 22, 2024 21:32
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.

@bergeron bergeron changed the title draft fix: setIsIpfsGatewayEnabled fix: IPFS NFTs fetching Jan 28, 2024
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (e98039c) 68.46% compared to head (71f3364) 68.10%.

❗ Current head 71f3364 differs from pull request most recent head 3500a28. Consider uploading reports for the commit 3500a28 to get more accurate results

Files Patch % Lines
app/scripts/controllers/preferences.js 16.67% 5 Missing ⚠️
ui/store/actions.ts 66.67% 2 Missing ⚠️
...ponents/app/nft-default-image/toggle-ipfs-modal.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22627      +/-   ##
===========================================
- Coverage    68.46%   68.10%   -0.37%     
===========================================
  Files         1088     1091       +3     
  Lines        42825    42928     +103     
  Branches     11394    11411      +17     
===========================================
- Hits         29319    29232      -87     
- Misses       13506    13696     +190     

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

@metamaskbot
Copy link
Collaborator

Builds ready [71f3364]
Page Load Metrics (782 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint94174112188
domContentLoaded95717105
load70210657828541
domInteractive95717105
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 188 Bytes (0.01%)
  • ui: 442 Bytes (0.01%)
  • common: 24 Bytes (0.00%)

davidmurdoch
davidmurdoch previously approved these changes Feb 5, 2024
Copy link
Contributor

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

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

LGTM (with one suggestion/nit)

ui/components/app/nfts-items/nfts-items.js Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [3500a28]
Page Load Metrics (803 ± 22 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint84162114188
domContentLoaded9491784
load7299208034622
domInteractive9481784
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 188 Bytes (0.01%)
  • ui: 442 Bytes (0.01%)
  • common: 24 Bytes (0.00%)

@bergeron bergeron merged commit 82e0029 into develop Feb 6, 2024
67 of 68 checks passed
@bergeron bergeron deleted the brian/ipfs-toggle branch February 6, 2024 17:00
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2024
@metamaskbot metamaskbot added the release-11.11.0 Issue or pull request that will be included in release 11.11.0 label Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.11.0 Issue or pull request that will be included in release 11.11.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants