Skip to content
TORNLIFE More

Inconsistent behavior when using timestamps

Started by AquaRegia [1551111] on in API Development.

3 replies · 103 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 4 / 4 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
4
Discussion span
→
People posting
3
Likes on archived posts
1
Posts by staff, officers and moderators
1
Authority score
70 / 100
Historical score
16 / 100
Story score
24 / 100
Engagement score
43 / 100
AquaRegia [1551111]
[image: i.imgur.com]

First I request all attacks after a certain timestamp, this yields 1 result. A few seconds later I do another request with a timestamp set far in the future, this should obviously yield 0 results, yet it gives a result identical to the previous request. If I wait for 30 seconds or so, and run the exact same request again, I get the expected results.

Surely this can't be intentional?
DeKleineKobini [2114440] Committee Committee
This is because of the cache (29s). I do understand that it might be confusing, but anything else is open to abuse (just move the from or to parameter 1 second).
AquaRegia [1551111]
How is it open to abuse when you're still limited to 100 requests per minute? And it should also return a throttle message or something, if subsequent requests aren't identical it can't just return invalid data.
Kivou [2000607]
There is a timestamp field to check the server response date.
You can use it to check if it's cache or not.

And except the API key (since recently), get parameters are not accounted for to distinguish 2 requests.