astarte-platform / astarte-dashboard

Astarte dashboard
http://astarte-platform.org
Apache License 2.0
17 stars 16 forks source link

Fix data parsing on datastream object interfaces with parametric endpoints #403

Closed davidebriani closed 7 months ago

davidebriani commented 7 months ago

The parsing logic didn't properly support the shape of data the are returned when querying datastream object interfaces that have parametric endpoints. This is because when the endpoints are parametric, instead of accessing the history of published objects for each endpoint, each endpoint key in the resulting data correspond to a single object, which is the latest snapshot of the values for that endpoint object.

The issue is solved by recognizing both arrays and single instances of object values, which are the objects in the resulting data that contain a timestamp key besides the other value keys.

With this change, we also make sure that the timestamps returned by Appengine are indeed of type string as expected: the 'keep_milliseconds' query option is thus removed from API calls to Appengine.

Closes #376