holaplex / indexer

Index Solana data using a Geyser plugin (downstream service cluster)
https://holaplex.com
GNU Affero General Public License v3.0
162 stars 38 forks source link

Wrong old collection is returned from GraphQL API #938

Closed serejke closed 1 year ago

serejke commented 1 year ago

Describe the bug NFT GynMVTTE2CwNgSFVh1KGQMLZzUtAxJQoAvzxw7ttoR6m belongs to collection CfptkovjUCQ1n4rFGDB5xnVPcndERTCA6hoXpL6R4jqm

but GraphQL API returns 9MqMpF8ghs9xfq1sknyrPSq4FFAqbGFVxQwA9NjdNrmS as the NFT's collection

I use the following request nftMintByAddress using graphql-request library.

const query = gql`
    query nftByMintAddress($address: String!) {
      nftByMintAddress(address: $address) {
        mintAddress
        owner {
          address
        }
        collection {
          nft {
            mintAddress
          }
        }
      }
    }
`

  const data = await request(
    'https://graph.holaplex.tools/v1/graphql',
    query,
    {
      address: new PublicKey('GynMVTTE2CwNgSFVh1KGQMLZzUtAxJQoAvzxw7ttoR6m'),
    }
  );

Returns:

{
  "nftByMintAddress": {
    "mintAddress": "GynMVTTE2CwNgSFVh1KGQMLZzUtAxJQoAvzxw7ttoR6m",
    "owner": {
      "address": "AVMUeN3WnbaG8r23AZPoUdGqZcQNL5Y3Nzfhr2EDCuE7"
    },
    "collection": {
      "nft": {
        "mintAddress": "9MqMpF8ghs9xfq1sknyrPSq4FFAqbGFVxQwA9NjdNrmS"
      }
    }
  }
}

9MqMpF8ghs9xfq1sknyrPSq4FFAqbGFVxQwA9NjdNrmS indeed was the NFT's collection at some point, but then the NFT was moved to another collection and its metadata was destroyed.

But the Holaplex indexer did not notice the collection's update.

serejke commented 1 year ago

In this transaction the collection was set to 9MqMpF8ghs9xfq1sknyrPSq4FFAqbGFVxQwA9NjdNrmS

In this transaction the collection was updated to CfptkovjUCQ1n4rFGDB5xnVPcndERTCA6hoXpL6R4jqm

kespinola commented 1 year ago

@imabdulbasit can you review this NFT? Review that it is a missed account index and not issue in our mcc updates?