fix: revert change on extension checking single NFT ownership#8435
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 82cff0e. Configure here.
sahar-fehri
approved these changes
Apr 13, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Explanation
PR #8281 introduced a breaking change that removed checkAndUpdateSingleNftOwnershipStatus from NftController entirely, replacing it with a batch-only checkAndUpdateAllNftsOwnershipStatus flow. However, the MetaMask extension calls checkAndUpdateSingleNftOwnershipStatus directly after confirmed transactions to check ownership of a single NFT — making the removal a regression for extension consumers.
This PR restores checkAndUpdateSingleNftOwnershipStatus with an updated signature that aligns with the new architecture introduced in #8281: the batch boolean second argument is removed, the networkClientId is now the second argument (required), and the method always writes the updated NFT to state and returns it.
Additionally, a bug introduced in the restored implementation is fixed: the original draft called this.update() directly followed by this.#updateNestedNftState(), which also calls this.update() internally — causing two stateChanged events to fire for a single logical state change. The redundant this.update() call is removed so the method is consistent with every other NFT-mutating method in the controller.
References
Ticket: https://consensyssoftware.atlassian.net/browse/ASSETS-2959
Extension PR: MetaMask/metamask-extension#41689
Checklist
Note
Medium Risk
Reintroduces and changes the signature/behavior of
checkAndUpdateSingleNftOwnershipStatus, which may break existing call sites and affects how NFT ownership state is mutated.Overview
Restores
NftController.checkAndUpdateSingleNftOwnershipStatus(removed in #8281) to fix consumers that perform per-NFT ownership checks, and implements it to callisNftOwner, updateisCurrentlyOwned, persist the updated NFT back intoallNfts, and return the updated object.Updates documentation/tests: adds unit coverage for state updates and
userAddressoverrides, and updates the changelog to document the restored method plus the breaking signature change (removing thebatchboolean argument).Reviewed by Cursor Bugbot for commit 5593976. Bugbot is set up for automated code reviews on this repo. Configure here.