ApiV2-GraphQL-Docs icon indicating copy to clipboard operation
ApiV2-GraphQL-Docs copied to clipboard

Duplicate voiceActor entries can be added into CharacterEdge.voiceActors

Open shirakaba opened this issue 3 years ago • 0 comments

This is an issue for the database rather than the docs themselves, but I can't see where else to post it.

On Feb 28th, 22:32 GMT, I ran this query to get the names of all the voice actors for the characters in the Japanese dub of Yakusoku no Neverland 2 (id 108725):

{
  Media (id: 108725) {
    characters(page: 1) {
      edges {
        role
        voiceActors (language: JAPANESE) {
          id
          name {
            first
            last
          }
        }
        node {
          id
        }
      }
    }
  }
}

This gave me a response which included many characters whose voiceActors field bore duplicate entries (the voiceActor id was identical in each element):

// ... truncated...
{
  role: 'SUPPORTING',
  voiceActors: [
    {
      id: 107039,
      name: { first: 'Hidenori', last: 'Takahashi' }
    },
    {
      id: 107039,
      name: { first: 'Hidenori', last: 'Takahashi' }
    }
  ],
  node: { id: 192865 }
},
// ... truncated...

A user on #programming (Italy's "Blessing") showed that the API was faithfully returning the underlying data, and so it was the underlying data that had the duplication issue.

unknown-2

Italy's "Blessing" then cleaned up the data for that series, but there may well be more such cases.

For future cases, this scenario could be guarded against by introducing an assertion to the database such that a voiceActor with the same id couldn't be added twice into the CharacterEdge.voiceActors array.

Repairing existing data may be harder, however; is this likely to happen?

shirakaba avatar Mar 01 '21 13:03 shirakaba