RoyaleAPI / cr-api

Clash Royale Analytics, Profiles and Insights. We no longer publish a public API. Please use the official API from Supercell.
https://RoyaleAPI.com
167 stars 20 forks source link

Need to add "0" to clan tag (with length lower than 8) to get good results #399

Closed Momoretti closed 5 years ago

Momoretti commented 6 years ago

Issue Report:

  1. Did you encounter this recently, or has this bug always been there? I discovered this bug today, only with devapi If the clan tag length is shorter than 8 I need to add "0" at the beggining of the tag to get the good result. Without the 0 handling I get old data in JSON response. This appears with clan/TAG and clan/TAG/war requests.

  2. Expected behaviour: Expected behaviour is to get data up to date which is not the case without 0 handling on clan tag

Step 1: I tried with clan id 2P0V8GL I got old data (not up to date) Step 2: I tried with 0 handling method (clan id 02P0V8GL) and I got good results Step 3: I tried again without 0 handling and I get old data again

Request Details:

Not working requests

GET
https://devapi.royaleapi.com/clan/2P0V8GL
https://devapi.royaleapi.com/clan/2P0V8GL/war

Working requests

GET
https://devapi.royaleapi.com/clan/02P0V8GL
https://devapi.royaleapi.com/clan/02P0V8GL/war

Response Details:

Old data with https://devapi.royaleapi.com/clan/2P0V8GL

{
    "tag": "2P0V8GL",
    "name": "MTG France",
    "description": "Le clan des joueurs de cartes. Si tu ne dis pas bonjour, on te dit au revoir. www.mtgfrance.com/viewforum.php?f=106",
    "type": "invite only",
    "score": 42296,
    "memberCount": 48,
    "requiredScore": 4000,
    "donations": 2050,

Up to date data with https://devapi.royaleapi.com/clan/02P0V8GL

{
    "tag": "2P0V8GL",
    "name": "MTG France",
    "description": "Le clan des joueurs de cartes. Si tu ne dis pas bonjour, on te dit au revoir. www.mtgfrance.com/viewforum.php?f=106",
    "type": "closed",
    "score": 42032,
    "memberCount": 46,
    "requiredScore": 4000,
    "donations": 3880,

Old data with https://devapi.royaleapi.com/clan/2P0V8GL/war

{
    "state": "warDay",
    "warEndTime": 1530531493,
    "clan": {
        "tag": "2P0V8GL",
        "name": "MTG France",
        "participants": 45,
        "battlesPlayed": 44,
        "wins": 23,
        "crowns": 39,
        "warTrophies": 1466,

Up to date data with https://devapi.royaleapi.com/clan/02P0V8GL/war

{
    "state": "warDay",
    "warEndTime": 1530704354,
    "clan": {
        "tag": "2P0V8GL",
        "name": "MTG France",
        "participants": 45,
        "battlesPlayed": 7,
        "wins": 5,
        "crowns": 11,
        "warTrophies": 1469,
Momoretti commented 6 years ago

Additionnal information, I compared https://devapi.royaleapi.com/clan/02P0V8GL/war and https://api.royaleapi.com/clan/2P0V8GL/war (devapi and current api). With normal api data are more recently refreshed:

{
    "state": "warDay",
    "warEndTime": 1530704354,
    "clan": {
        "tag": "2P0V8GL",
        "name": "MTG France",
        "participants": 45,
        "battlesPlayed": 13,
        "wins": 8,
        "crowns": 16,
        "warTrophies": 1469,

The battles played is 13 instead of 7 with devapi, so it seems to have also a big delay (more than 20 minutes) with devapi.

Do you consider that it is an other issue?

Gr8z commented 6 years ago

These two seem related. There is a delay in getting the latest data in the devAPI but new data can be retrieved when we add the 0.

selfish commented 5 years ago

I think this was all related to cache issues. Is this still relevant? Please reopen if it is.