Coder Social home page Coder Social logo

Comments (5)

ocram avatar ocram commented on May 29, 2024 1

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?

See also: https://github.com/meteor/meteor/blob/b6c2991a28b2ac4e635081133360b55c1e4387f6/packages/ejson/ejson.js#L103

from android-ddp.

Liryna avatar Liryna commented on May 29, 2024

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 ?

from android-ddp.

ocram avatar ocram commented on May 29, 2024

@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.

from android-ddp.

Liryna avatar Liryna commented on May 29, 2024

@ocram I will not be able to give an example here sorry 😢
Do you want me to close the issue ?

from android-ddp.

ocram avatar ocram commented on May 29, 2024

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!

from android-ddp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.