Skip to content
TORNLIFE More

API: Missing single attack for chain report

Started by bbeebs [2313341] on in Bugs & Issues.

13 replies · 192 views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 14 / 14 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
14
Discussion span
→
People posting
4
Likes on archived posts
7
Posts by staff, officers and moderators
7
Authority score
60 / 100
Historical score
37 / 100
Story score
44 / 100
Engagement score
58 / 100

Most-liked replies

bbeebs [2313341]
I wrote a script in a google sheet to generate a chain report. It does that by fetching all of the attacks using the /attacks API endpoint in a loop.
I noticed one of my chains was missing an attack. It was a 2.5k chain, but the attack count my script gathered was 2499.

So I did some digging and figured out exactly which attack was missing - who the attacker was and even the attack number in the chain - it's #1112.

I then did some experimenting with different from time when calling the API, but there seems to be no way to get that missing attack. I was able to get that person's previous and next attacks in the same response from the API, but hit #1112 is still missing.

Am I doing something wrong or is there some other possible explanation? I can provide more details upon request.

PS: I also posted this in API Development, so the thread there can be removed.
CloudJumper [1636201]Staff
Just to confirm, you are saying that the API system doesn't show one of the attacks which was counted in the chain and is present in your faction log?

Can you please paste the faction news log here? We need the timestamp and the initiator of the attack for the logs that are missing in the API.

Thanks..!!
bbeebs [2313341]
Yes, that is indeed what seems to be the problem. That chain is from February though, so I can no longer see the log entry.

This is the closest I can point you to:
- chain ID: 9540799
- chain hit # (the number that is returned as "chain" in /attacks): 1112
- attacker ID: 2403739
- timestamp should be between 1581706638 and 1581706861 (these are timestamps of that attacker's previous and next attack)

I have determined the attacker by comparing my report to torn's war report - and that person showed one attack less in my report. I hope that helps.
Chedburn [1] Admin Developer
I'm not sure what to suggest, the attack definitely exists. The timestamp is 1581706083, which is out of range of what you're searching for?
bbeebs [2313341]
That timestamp is attack #1012 from the same chain. The one I am missing is #1112. But same attacker, yes.
Chedburn [1] Admin Developer
The attack you're looking for (#1112) should appear at...
2020-02-14 18:57:18
1581706638
I can't find any reason why this would not appear currently
bbeebs [2313341]
I attempted fetching API data with: https://api.torn.com/faction/?selections=attacks&from=1581706638&key={MY API KEY}

Attack #1112 is not returned.The closest one (and the only one matching that timestamp) is attack #1110 by the same attacker - https://prnt.sc/uvgd9i

I can provide you with my API key to help you reproduce the problem.
Chedburn [1] Admin Developer
Please give my test account API privileges and I'll take a look. Thanks.

Sec.. Need to remove recuirt status.
Chedburn [1] Admin Developer
Looks like a racing condition caused it, a single attack triggered two chain hits.

Attack 95762420 counted for chain 1110 and 1112.

I'll take another look tomorrow thanks.
Chedburn [1] Admin Developer
Oh I've just realised the date, Valentine's Day, when we were having all the issues. I think that makes perfect sense now.

I think we can close this and we can be pretty sure it won't happen again.

Thanks.