Closed Liryna closed 7 years ago
Thanks a lot!
EJSON, Meteor's JSON extension, uses
{ "$InfNaN": 0 }
for NaN
{ "$InfNaN": 1 }
for Inf
{ "$InfNaN": -1 }
for -Inf
because these don't have corresponding representations in vanilla JSON.
But I don't really see why this should be happening for null
, as opposed to NaN
. Could you share an exemplary endpoint at a public URL so that we can re-produce this? Anyway, most likely, your Meteor server is already outputting that "wrong" JSON since this library on Android does not use the EJSON expression in any place. So the question is: Why is your server returning NaN
when it should return null
? Can you check your code?
Hi @ocram ,
Thanks for the quick reply, I don't currently have a public URL to give you 😢 I will try to create one next week with a sample project if I can.
Otherwise, I am pretty sure I return correctly the json with null 😢 Do you have an idea what can make meteor change it ?
@Liryna That sounds good!
In order to debug this, you could (temporarily) just return { "key": null }
or even null
directly. If you had a method that just returned that, without any further code, it would be easier to debug.
I can definitely confirm that I've seen several implementations where null
is correctly returned as null
.
@ocram I will not be able to give an example here sorry 😢 Do you want me to close the issue ?
Oh, that's unfortunate. You know, the problem is that we really can't re-produce this, and null
has always worked fine without being converted to those strings you mentioned. I'm afraid closing is the only thing we can do for now, yes. Sorry!
Hi,
When calling myMethod, the string result onSuccess seems to replace all
null
value by{"$InfNaN":0}
Meteor function output just before return:
{ "key": null }
Android-DDP result string onSuccess{ "key":{"$InfNaN":0} }
I don't know if this is normal or should I probably convert it in a way to get my null value ?Thanks again for the work :heart: