Skip to content
TORNLIFE More

[API] missing faction attacks

Started by Kivou [2000607] on in Bugs & Issues.

4 replies · 84 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 5 / 5 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
5
Discussion span
→
People posting
3
Likes on archived posts
2
Posts by staff, officers and moderators
3
Authority score
58 / 100
Historical score
30 / 100
Story score
35 / 100
Engagement score
44 / 100

Most-liked replies

Kivou [2000607]
Hey,
I'm missing a couple of attacks when I pull from the faction section. For example with this call:

https://api.torn.com/faction/25001?selections=attacks&key=***&from=1642192434&to=1642221195&comment=-

I'm missing attacks for chain=1488 and chain=1489

However from the player selection I can get the attack chain=1489 and I couldn't find anything specific about it. It just doesn't appear in the faction section.

It's not the only occurrence. I'm always missing a couple of hits here and there unfortunately. And couldn't spot any pattern.

As it is not my data I can give more details in PM if needed.

Cheers :)
Chedburn [1] Admin Developer
I can see the attacks do exist in the chain hits table with IDs 113757718 & 113757774. Their attack IDs are 179290527 & 179290667. The chain ID is 21061394. Nothing looks abnormal.

Would you mind PMing me the exact API URL with your key please so I can run it myself exactly as you have please?
Kivou [2000607]
I'm truly sorry I filed this report too soon. I believed that attacks were sorted by timestamp_ended but they seem to be sorted by timestamp_started where the filter used for `from` is based on timestamp_ended. So when you chain API calls with `from` being equal to the timestamp_ended of the last attack, on some rare occasions you can miss one that started after the last attack but ended before.

Anyway, now that it's clear to me I modified my code in order to chain the calls with the timestamp_started of the last attack of the previous call. It's a bit less efficient as, because the sorting is based on timestamp_started and the filter based on timestamp_ended, you call a couple of attacks twice between two calls but that's not that bad.

So yeah, no worries, just me learning the basics!

Again, sorry for the trouble.