gamelocker / platform

Issues that affect all titles on the platform.
0 stars 0 forks source link

Bug: Queries with a negative timespans don't fail #9

Open svperfecta opened 7 years ago

svperfecta commented 7 years ago

From @schneefux on August 20, 2017 13:19

This request has createdAt-start 2017-06-01 and createdAt-end 2017-03-31:

curl -g "https://api.dc01.gamelockerapp.com/shards/eu/matches?filter[playerNames]=shutterfly&filter[gameMode]=casual_aral,blitz_pvp_ranked&sort=createdAt&filter[createdAt-start]=2017-06-01T00:00:00.000Z&filter[createdAt-end]=2017-03-31T23:59:99.999Z" -H "Authorization: Bearer $APIKEY" -H "X-TITLE-ID: semc-vainglory" -H "Accept: application/vnd.api+json"

The date range is more than 28 days, and end < start. It should fail with an error, but instead, it returns data from 2017-06-01 onwards.

Copied from original issue: gamelocker/vainglory#250

svperfecta commented 7 years ago

Confirmed, this is a bug. Right now we check that it's < 28 days, but not also >0 days.

Low priority, but great find! This would make using the API a little confusing if someone misunderstood that startsAt should come BEFORE endsAt.