SuperEvilMegacorp / vainglory-assets

Community provided art, schemas, and other assets that make using the Vainglory API easier
https://developer.vainglorygame.com
MIT License
54 stars 40 forks source link

BUG: Identical Player/Team Ids #242

Closed Skillz4Killz closed 6 years ago

Skillz4Killz commented 7 years ago

PlayerId is supposed to be unique but this is causing some bugs where the playerId is returning the same id value as the team id. It becomes impossible to differentiate the players since the id is no longer unique. With both IGN's and player id no longer being unique to a player, it becomes impossible to be able to identify a player with accuracy.

cUrl: https://api.dc01.gamelockerapp.com/shards/na/matches?page[offset]=0&page[limit]=50&sort=-createdAt&filter[playerNames]=LaidToRest

{
            "type": "player",
            "id": "498d582c-f0a9-11e5-b465-06fc87f1dd11",
            "attributes": {
                "name": "LaidToRest",
                "shardId": "na",
                "stats": {
                    "elo_earned_season_4": 2405.8808509438663,
                    "elo_earned_season_5": 2386.2975294201347,
                    "elo_earned_season_6": 2624.162678557534,
                    "elo_earned_season_7": 2623.5272050435183,
                    "karmaLevel": 2,
                    "level": 30,
                    "lifetimeGold": 12943,
                    "lossStreak": 0,
                    "played": 4293,
                    "played_ranked": 2241,
                    "skillTier": 28,
                    "winStreak": 0,
                    "wins": 1577,
                    "xp": 175450
                },
                "titleId": "semc-vainglory"
            },
            "relationships": {
                "assets": {
                    "data": []
                }
            }
        }
{
            "type": "team",
            "id": "498d582c-f0a9-11e5-b465-06fc87f1dd11",
            "attributes": {
                "name": "NOVA",
                "shardId": "na",
                "stats": null,
                "titleId": ""
            },
            "relationships": {
                "assets": {
                    "data": []
                }
            }
        },
schneefux commented 7 years ago

According to the JSON API spec, this is valid.

In a single document, you can think of the type and id as a composite key that uniquely references resource objects in another part of the document.

This cannot be "fixed" without rewriting (or duplicating) either team or player objects, which breaks current and future applications that cache that data. :-1:

Skillz4Killz commented 7 years ago

@schneefux if it was a feature like that would it not be true for every account? For the majority 99% of accounts, this is not the case. However, a few seem to have a bug where their team id and player id are identical. If it was intended to be like this then it would have been true for all accounts.

For example: cUrl: https://api.dc01.gamelockerapp.com/shards/na/matches?page[offset]=0&page[limit]=50&sort=-createdAt&filter[playerNames]=Levatikyn

This will give you a player and team id that is unique. For the majority of users, the id is unique as they should be but for some rare circumstances, it's not.

svperfecta commented 7 years ago

Yeah, this is definitely weird. You're right, each object should have a globally unique guid, period. It should identify a single object and no duplication should exist across types.

We'll find out if this is a problem with the service, or the game. Strange.

@schneefux can you provide a specific matchID where this is an issue? I notice that got omitted.

FWIW - ShardID and TitleID shouldn't be blank either.

dominicgunn commented 7 years ago

I'm not sure that this is actually a bug, according to the JSON-API spec objects are uniquely identified by (id, type), id only has to be unique during creation of a type (that is, no players have the same id).

This seems like more of a failing on the developer side.