I ran into an with setting a field with a very large value using FSet resulting in an incorrect value set in Tile38. The issue appears to be caused by the rounding configured in the floatString function. I suspect a fix might be as simple as updating the formatFloat function to be something like this instead.
The code will result in example having a field id set to 123456789000000000 instead of the expected value 123456789012345680. However, manually setting the field in the cli does give the expected results. This can be sen in the Tile38 cli:
127.0.0.1:9851> GET test example WITHFIELDS
{"ok":true,"object":"{\"key\":\"value\"}","fields":{"id":123456789000000000},"elapsed":"19.377µs"}
127.0.0.1:9851> FSET test example id 123456789012345680
{"ok":true,"elapsed":"9.808µs"}
127.0.0.1:9851> GET test example WITHFIELDS
{"ok":true,"object":"{\"key\":\"value\"}","fields":{"id":123456789012345680},"elapsed":"20.699µs"}
I can create a PR if needed; let me know if I should do anything besides adding a test case to TestKeys.
Hello,
I ran into an with setting a field with a very large value using
FSet
resulting in an incorrect value set in Tile38. The issue appears to be caused by the rounding configured in thefloatString
function. I suspect a fix might be as simple as updating theformatFloat
function to be something like this instead.An example of a failure case:
The code will result in
example
having a fieldid
set to123456789000000000
instead of the expected value123456789012345680
. However, manually setting the field in the cli does give the expected results. This can be sen in the Tile38 cli:I can create a PR if needed; let me know if I should do anything besides adding a test case to
TestKeys
.