Skip to content

[Bug]: Autodetect NFT - Autodetect NFT doesn't trigger an API call when I switch to another account while being in the NFT tab, making no tokens detected unless I refresh #28654

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

Closed
seaona opened this issue Nov 22, 2024 · 0 comments · Fixed by #31481
Labels
regression-prod-12.6.2 Regression bug that was found in production in release 12.6.2 release-12.18.0 Issue or pull request that will be included in release 12.18.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-assets type-bug Something isn't working

Comments

@seaona
Copy link
Contributor

seaona commented Nov 22, 2024

Describe the bug

Anytime I go to the NFT tab, a request is sent to the NFT API to autodetect NFTs for that account, when that feature is enabled. However, in the case where I switch to another account while being in the NFT tab, I can see how no request is sent to the NFT API meaning, autodetect won't happen (until the user either clicks refresh, or refreshes the wallet / goes again to the NFT tab)

Expected behavior

When we switch accounts, if we are in the NFT tab, a request to the nft api should be made to autodetect tokens for that account (if the feature is enabled from settings)

Screenshots/Recordings

nft-autodetect-token.mp4

Steps to reproduce

  1. Open network tab and look for nft requests
  2. Make sure you have NFT autodetect from settings enabled
  3. With any given account, click NFT tab --> see a request is sent to the NFT API
  4. Now switch accounts
  5. See the NFT list remains empty and no request is sent to the nft API, unless you refresh it or click the Refresh button

Error messages or log output

No response

Detection stage

In production (default)

Version

12.6.2

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

@seaona seaona added type-bug Something isn't working Sev2-normal Normal severity; minor loss of service or inconvenience. team-assets labels Nov 22, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Nov 22, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Nov 22, 2024
@metamaskbot metamaskbot added the regression-prod-12.6.2 Regression bug that was found in production in release 12.6.2 label Nov 22, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 10, 2025
## **Description**

PR to trigger nft detection on account switch

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/31481?quickstart=1)

## **Related issues**

Fixes: #28654

## **Manual testing steps**

1. Click on account list menu
2. Switch to another account
3. You should see a call to detectNfts (nft-api) being triggered in
networks tab when you are on ethereum or linea

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] 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.

## **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-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Apr 10, 2025
@metamaskbot metamaskbot added the release-12.18.0 Issue or pull request that will be included in release 12.18.0 label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-prod-12.6.2 Regression bug that was found in production in release 12.6.2 release-12.18.0 Issue or pull request that will be included in release 12.18.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-assets type-bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants