OS2iot / OS2iot-backend

This repository contains the backend to the project OS2iot.
Mozilla Public License 2.0
10 stars 7 forks source link

multiple data targets (with different decodes) manipulate timeseries. #121

Closed aNorrah closed 2 years ago

aNorrah commented 2 years ago

When you have an application where you can have multiple different data targets in this example called target A which is supposed to receive Data 1 - and target B with Data 2.

The original time-series data will be called Data 0.

  1. If you use no decoder on all these data targets, no issue. Everything works as intended. Data 1 and Data 2 are unaffected. as they are exactly the same. Both target A and target B receive them normally.
  2. If you use the same data decoder on the data targets. It seems to work normally. Data 1 and Data 2 seem to be unaffected (we currently do not have logs to ensure it, so we only have the data received by the target B which should still prove the point as it's the latter in the hierarchy)
  3. If you use different data decoders on these data targets, the time-series Data 1 that is sent to target A will be correct, but the Data sent to target B, will now be a new data package that have been sent through both decoders. The result - in our case - is a wrong Data "3" where the data have been changed from base64 twice, resulting in a non-sensical hex string.

We believe the issue - in this case - is that Data 1 is the product of decoder A manipulating data 0. We however believe that the decoder to target B is now manipulating Data 1 and not Data 0 - thus subsequently resulting in data "3".

Log example:

Screenshot 2021-10-12 at 16 40 10

note that data on line 18 was supposed to read 00BA5FDC not D34040E450C3 which is 00BA5FDC converted from base64 to HEX.

ramogens commented 2 years ago

Thank you for reporting @aNorrah. We have started looking into a fix.