-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: API V1 DSS electionEnd is changing instead of returning a correct time #130
Comments
I'm sorry, I don't think I quite follow what the issue is? |
Sorry I didn't describe it clearly, my bad. It's about the parameter For example, I got a |
what are the 'raw' values that are being sent when it fluctuates? the calculation to compute that field is fixed, meaning that the values we receive are most likely fluctuating |
these two json arrays are the raw body of the two arrays I gave out in the issue description//Request 1:
//date: Thu, 06 Feb 2025 17:58:53 GMT
[
{
"id32": 749875195,
"planet": {
"index": 200,
"name": "玛塔",
"sector": "Andromeda",
"biome": {
"name": "Highlands",
"description": "Rocky outcroppings punctuate fields of tall grass in a planet dominated by misty highland terrain."
},
"hazards": [
{
"name": "Rainstorms",
"description": "Torrential rainstorms reduce visibility."
}
],
"hash": 2071495162,
"position": {
"x": -0.4909794,
"y": 0.4139719
},
"waypoints": [
159,
199,
201
],
"maxHealth": 1000000,
"health": 999335,
"disabled": false,
"initialOwner": "Humans",
"currentOwner": "Automaton",
"regenPerSecond": 4.1666665,
"event": null,
"statistics": {
"missionsWon": 3997523,
"missionsLost": 441767,
"missionTime": 15187810425,
"terminidKills": 43,
"automatonKills": 1311005258,
"illuminateKills": 0,
"bulletsFired": 6344057213,
"bulletsHit": 6739893614,
"timePlayed": 15187810425,
"deaths": 35274834,
"revives": 0,
"friendlies": 3741795,
"missionSuccessRate": 90,
"accuracy": 100,
"playerCount": 17489
},
"attacking": []
},
"electionEnd": "2025-02-06T18:27:43.7410097Z",
"flags": 1
}
]
//Request 2:
//date: Thu, 06 Feb 2025 17:59:46 GMT
[
{
"id32": 749875195,
"planet": {
"index": 200,
"name": "玛塔",
"sector": "Andromeda",
"biome": {
"name": "Highlands",
"description": "Rocky outcroppings punctuate fields of tall grass in a planet dominated by misty highland terrain."
},
"hazards": [
{
"name": "Rainstorms",
"description": "Torrential rainstorms reduce visibility."
}
],
"hash": 2071495162,
"position": {
"x": -0.4909794,
"y": 0.4139719
},
"waypoints": [
159,
199,
201
],
"maxHealth": 1000000,
"health": 999334,
"disabled": false,
"initialOwner": "Humans",
"currentOwner": "Automaton",
"regenPerSecond": 4.1666665,
"event": null,
"statistics": {
"missionsWon": 3997689,
"missionsLost": 441771,
"missionTime": 15188338716,
"terminidKills": 43,
"automatonKills": 1311056464,
"illuminateKills": 0,
"bulletsFired": 6344346355,
"bulletsHit": 6740228320,
"timePlayed": 15188338716,
"deaths": 35275944,
"revives": 0,
"friendlies": 3741902,
"missionSuccessRate": 90,
"accuracy": 100,
"playerCount": 17495
},
"attacking": []
},
"electionEnd": "2025-02-06T18:27:50.3782101Z",
"flags": 1
}
] |
I'll set up a little Java application soon which can make a bunch of requests towards |
Sorry, misoperation, issue not solved. |
Source code poc: import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.time.OffsetDateTime;
import java.util.HashMap;
public class Main {
public static void main(String[] args) throws InterruptedException, IOException {
int reqNumber = 30;
HashMap<String, String> headerMap = new HashMap<>();
String apiUrl = "https://api.helldivers2.dev/api/v1/space-stations";
headerMap.put("X-Super-Client","ArisuBot-Beta");
headerMap.put("X-Super-Contact","[email protected]");
do {
reqNumber -= 1;
HttpRequest req = HttpUtil.createGet(apiUrl);
req.addHeaders(headerMap);
try (HttpResponse response = req.execute()) {
OffsetDateTime dateTime = OffsetDateTime.now();
if (!response.isOk()) {
throw new IOException("HD2API request failed: " + response.getStatus());
}
String jsonStr = response.body();
if (jsonStr == null || jsonStr.isEmpty()) {
throw new InvalidObjectException("API response empty. ");
}
// System.out.println(response.body());
String resultDate = (String) ((JSONObject) JSONUtil.parseArray(response.body()).get(0)).get("electionEnd");
String resultID = String.valueOf((int) ((JSONObject) JSONUtil.parseArray(response.body()).get(0)).get("id32"));
System.out.println(dateTime +": " + resultDate + " for " + resultID);
}
Thread.sleep(1000);
} while (reqNumber >= 0);
}
} got result:
|
Sorry, I should have been more specific; when I say 'raw' I mean the JSON payloads received from ArrowHead API's, which is where the dates are being calculated from. |
So, If I'm understanding correctly, I should give out the Sample 1: requested 2025-02-10T17:28:50.117620700+08:00
Sample 1 result:
Sample 2: 2025-02-10T17:29:52.338655100+08:00
Sample 2 result:
Sample 3: 2025-02-10T17:31:56.895798900+08:00
Result:
|
Link to faulty endpoint
/api/v1/space-stations
The name of your client/application
ArisuBot-Production, ArisuBot-ApiFox, ArisuBot-Beta (many requests missing this part because I forgot to set, my bad)
Request information
Request part:
DSSHelper.getDSSListHD2API(Language language)
:This HttpRequest is a tool class from HuTool.
Constants:
So, the final API requesting is:
https://api.helldivers2.dev/api/v1/space-stations
.Steps to reproduce
Send two request with a little gap.
What is expected?
It should be a fixed date instead of this changing date.
What is actually happening?
System Info
In this case, SpaceStation2 is defined like this:
Generated by ApiFox
The whole project is a QQ bot, using mirai framework. See here
Any additional comments?
In the example request, at least the date should be around
2025-02-06T18:26:24.000Z
. I had got even crazier data such as2025-02-06T14:47:17.408Z
. I'm confused.The text was updated successfully, but these errors were encountered: