-
Notifications
You must be signed in to change notification settings - Fork 0
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
decoding of values with prefix '\u001b' does not work #13
Comments
hi |
however it does send a valid json and can be normally decoded. |
Hi, @rinick , thanks for the correction! |
@jdsdc @SDC-Automation |
@rinick , i have tested 1.0.6 and it seems to work fine now. What i could see from the code you convert |
Decoding Infinity or NaN values from Niagara via dgApi does not work over websocket communication. When decoding fails the websocket connection is closed.
When subscribing to values from dgApi the communication fails due to the above error, which
closes the subscribing clients websocket communication.
The serverlog in DGLux shows the following error:
In the above log the value is '\u001bInfinity' which cannot be decoded. I made a change in node.dart that stripped away u001b but that doesn't seem to be the correct solution. Since the prefixed value is handled in for example
JsonWriter.class
in dslink-v2-api. So it seems like this should be handled correctly by dgApi.The error seems to occur in websocket_conn.dart:
Log from dgApi when receiving values from Niagara:
Is there something wrong with how the decoding is done?
I have tested changing in dgApi, removing \u001b from the beginning of the value and then it worked. But of course it should be possible to pass on the escape character too.
JSON Decoding seems to be the culprit. JSon with 'u001b' cannot be decoded. But i don't know if it can be stripped away safely. Since it is used in dslink-java-v2 to indicate Nan and Infinite values.
Where i think the actual error occurs,
codec.dart
Simple test with esapce character that fails:
The text was updated successfully, but these errors were encountered: