I am trying to update our SFS to version 2.13 with binary protocol.
I am sending a parameter from the server as float type:
sfsobj.putFloat("temp", temp);
By chance the value of temp in some cases is 0. In that case the new JS api with binary protocol support gives an error:
Uncaught Error: Invalid value passed; type SFSDataType.FLOAT requires a number in this range: 1.401298464324817e-45 <= value <= 3.4028234663852886e+38
at SFSTypeError.SFSError (sfs2x-api-1.7.0.js:formatted:2956)
at new SFSTypeError (sfs2x-api-1.7.0.js:formatted:2984)
at Object.validate (sfs2x-api-1.7.0.js:formatted:3404)
at SFSObject.put (sfs2x-api-1.7.0.js:formatted:3583)
at SFSDataSerializer.decodeSFSObject (sfs2x-api-1.7.0.js:formatted:2468)
at SFSDataSerializer.decodeObject (sfs2x-api-1.7.0.js:formatted:2547)
at SFSDataSerializer.decodeSFSObject (sfs2x-api-1.7.0.js:formatted:2466)
at SFSDataSerializer.decodeObject (sfs2x-api-1.7.0.js:formatted:2547)
at SFSDataSerializer.decodeSFSObject (sfs2x-api-1.7.0.js:formatted:2466)
at SFSDataSerializer.binary2object (sfs2x-api-1.7.0.js:formatted:2440)
On investigating further, I saw a condition failing:
Code: Select all
typeof value === "number" && value >= 1.401298464324817e-45 && value <= 3.4028234663852886e38
Here, the second condition :
Code: Select all
value >= 1.401298464324817e-45 && value <= 3.4028234663852886e38
is false when the variable value is 0.
I want to know a few more things:
- when you will be releasing the new C# api with binary protocol support ?
- can you tell a little difference between json based protocol and binary protocol in terms of SFS(or in general), how C# is json based ?
Thank you