Closed beaucollins closed 7 years ago
@beaucollins what do you think of https://github.com/darrachequesne/notepack/pull/4? It seems msgpack-lite
encodes those values as float64 (with writeDoubleBE
)
@darrachequesne #4 works for our needs. (4aab3db)
this might also happen if the object has a cyclic reference. for example if you try to send a sequelizejs model. when using JSON.stringify this problem is mostly solved as these kind of object use the toJSON function. to fix that, i've created this pull request: https://github.com/darrachequesne/notepack/pull/7
I have a Socket.IO app using socket.io-redis that is crashing intermittently due to notepack throwing an encoding error:
I haven't been able to track down the origin of the socket.io emits that have one of these values but it seems a little extreme to crash Socket.IO when a client potentially emits
NaN
,Infinity
, or-Infinity
somewhere in the emit values.My remedy is to run a patched version of notepack that encodes these to null values in the meantime. I'm not sure what the best approach is for a correct solution moving forward.