astarte-platform / astarte

Core Astarte Repository
https://docs.astarte-platform.org/
Apache License 2.0
240 stars 50 forks source link

Server datastreams with explicit timestamp transmitted with no timestamp #938

Open sorru94 opened 7 months ago

sorru94 commented 7 months ago

Server-owned datastreams are transmitted to devices with no timestamp in the BSON file even when the explicit_timestamp is set in the interface definition.

Replicate transmitting a boolean type using CURL:

        curl -v -X PUT -H "Accept: application/json" -H "Content-Type: application/json" \
        -H "Authorization: Bearer $APPENGINE_TOKEN" \
        https://$APPENGINE_URL/v1/$REALM/devices/$DEVICE_ID/interfaces/$INTERFACE/boolean_endpoint \
        --data '{"data" :true}'

The received BSON is the following:

09 00 00 00 08 76 00 00 00

Which in human readable form is:

{ "v": false }

Interface definition to use to replicate this issue: datastream_individual_interface.json

Tested with Astarte v1.1.1.

Annopaolo commented 6 months ago

See also #785 (TL;DR: does explicit_timestamp make sense on server-owned interfaces, as AppEngine API do not provide a way to set it?)