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

Request problem according to tag length (lower than 8) #398

Closed Momoretti closed 5 years ago

Momoretti commented 6 years ago

Hello

Issue Report:

I encountered this problem on devapi only, when the clan tag length is lower than 8, the request failed or provide a wrong result. In my case I used 2P0V8GL (length 7). I tried with 2 requests:

Expected behaviour:

Step 1: I tried with clan id 2P0V8GL I had the problem Step 2: I tried with an other clan ID with a length of 8 and it worked well (9R8G9290). Step 3: I tried to complete the shorter clan ID with "0" to have a length of 8 (2P0V8GL becomes 02P0V8GL), for both requests that solved the problem Step 4: I tried again with the shorter clan ID without "0" (2P0V8GL)

Request Details:

Requests with problem

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

Requests without problem

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

Response Details:

With /clan/2P0V8GL/war => Wrong response (endtime = yesterday)

string(5286) "{"state":"warDay","warEndTime":1530531493, ...

With /clan/02P0V8GL/war => Good response (endtime = tomorrow)

string(5263) "{"state":"warDay","warEndTime":1530704354, ...
fourjr commented 6 years ago

I'm unable to reproduce https://devapi.royaleapi.com/clan/2P0V8GL

Could you verify again in http request apps like postman? Is it an issue only occurring sometimes?

Momoretti commented 6 years ago

I'm not able to reproduced it also with : https://devapi.royaleapi.com/clan/2P0V8GL The issue was always here yesterday until I tried with https://devapi.royaleapi.com/clan/02P0V8GL and after that it never appeared again. Maybe you can close this part

But with https://devapi.royaleapi.com/clan/2P0V8GL/war the issue is still here.

fourjr commented 6 years ago

reproduce as in incorrect war end time?

Momoretti commented 6 years ago

I tried with postman: https://devapi.royaleapi.com/clan/2P0V8GL and https://devapi.royaleapi.com/clan/02P0V8GL does not return the same results. For exemple with 2P0V8GL the field "memberCount": 48 and with 02P0V8GL the field "memberCount": 46

Currently in the clan we are well 46 and not 48.

Momoretti commented 6 years ago

Yes the war end time is incorrect but more generally all data in JSON response are old with 2P0V8GL but with 02P0V8GL data are up to date. This true for both request clan/TAG and clan/TAG/war but I imagine that it is true for all requests, I will check.

fourjr commented 6 years ago

is the war end time the war start time?

Please create another issue regarding the 0 handling. one issue should be for one bug

Momoretti commented 6 years ago

The war end time does not correspond to the war start time. The war end time returned with https://devapi.royaleapi.com/clan/2P0V8GL (1530531493) almost corresponds to the war end time of last war get with https://devapi.royaleapi.com/clan/2P0V8GL/warlog (1530531495). Only 2s of difference.

I will create a dedicated issue.

selfish commented 5 years ago

Is this relevant to main API?