Inconsistent API response

Angel Systat6 years ago

When I hit traccar's API with the following request:
`http://mytraccar.host/api/reports/trips?deviceId=1&from=2019-10-16T21:24:00Z&to=2019-10-17T13:16:00Z``
please notice the date params

It will return the trips between that date. But please check the following trip:
{
...
"startTime": "2019-10-16T23:08:19.000+0000",
"endTime": "2019-10-16T23:41:28.000+0000",
"distance": 29302.16000000015,
...
}

Now if I slightly change the request's date param for this:
http://mytraccar.host/api/reports/trips?deviceId=1&from=2019-10-14T21:24:00Z&to=2019-10-17T13:16:00Z
So, just changing the from parameter, it will change the distance of the same trip!!

{
...
"startTime": "2019-10-16T23:08:19.000+0000",
"endTime": "2019-10-16T23:41:28.000+0000",
"distance": 10193.770000000484,
...
}

So, why is traccar changing the trip information depending on the "from" - "to" parameters?? the trip should remain the same!
Please your help with this

Anton Tananaev6 years ago

It shouldn't happen. I guess someone needs to debug the code to see why it happens.

Angel Systat6 years ago

Agree. I'll try to find an answer and come back to this thread. If someone has the same issue or a solution please let me know!