Skip to content
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

Binaryblob and datetime properties sent as incorrect types upon reconnection. #935

Open
sorru94 opened this issue May 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working user experience This issue is about user experience

Comments

@sorru94
Copy link
Contributor

sorru94 commented May 6, 2024

Upon reconnection, Astarte transmits incorrect BSON types for some server-owned properties.

This issue can be observed when setting a server property of the following types: datetime, datetimearray, binaryblob, binaryblobarray.

Assuming to set a property while the device is connected, the BSON data is correctly transmitted to the device.
For example, assuming a datetime endpoint is used to set a property to the value 2024-03-11T09:34:36.000Z, the following BSON object is received by the device:

10 00 00 00 09 76 00 e0 2b dd 2c 8e 01 00 00 00 

Which in human readable form is:

{ "v": "2024-03-11T09:34:36.000Z" }

However, if the device is power cycled Astarte will transmit the following value for the same property to the device.

10 00 00 00 12 76 00 e0  2b dd 2c 8e 01 00 00 00

Which in human readable form is:

{ "v": 1710149676000 }

The difference being that upon reconnection the BSON contains a integer 64 instead of a datetime.
This is similar for binary blobs which receive strings instead of binaries.

@Annopaolo Annopaolo added bug Something isn't working user experience This issue is about user experience labels May 6, 2024
@Annopaolo Annopaolo added this to Astarte May 6, 2024
@shinnokdisengir shinnokdisengir self-assigned this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user experience This issue is about user experience
Projects
Status: No status
Development

No branches or pull requests

3 participants