-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update msgpack library to avoid UInt64 errors #105
Conversation
Besides, msgpack5 seems to be the recommended implementation for nodejs (http://msgpack.org/). Could you squash it to one commit please? |
It's embarrassing but I am a beginner on github! |
You should see:
which should be replaced with:
Not tested, but that should do the trick 😄 |
Corrected dependencies: msgpack5 instead og msgpack-js Update index.js Corrected dependencies: msgpack5 instead og msgpack-js
1fc467a
to
11513e2
Compare
Eureka! |
I still have a concern about perf. According to this https://github.com/kawanet/msgpack-lite#benchmarks, msgpack5 might be slower than other implementations. (the number of different implementations for msgpack is just crazy...) |
It's true. There are many implementations and each claims to be somehow more powerful. |
Either https://github.com/coinative/notepack or https://github.com/kawanet/msgpack-lite could bring some improvements. |
Just ran msgpack-lite's benchmark on my MacBook. Node v7.2.0 Sorted by
Quite different than the results listed on their readme. |
Using https://github.com/endel/msgpack-benchmark sample-datatypes.json:
sample-small.json:
sample-medium.json:
sample-large.json:
Since it passes all tests, how about using |
Ironic lol. I used the same buffer to test |
@CarsonF how can I reproduce? Are you trying to decode a buffer encoded by another implementation? |
Using a PHP implementation https://github.com/rybakit/msgpack.php I could try to condense the code that creates the socket.io packet that's published to Redis into a snippet if it would help. But since it doesn't get past decoding on node's side I don't think it matters |
If you don't want to try to figure out the php stuff here's this: $packed = (new MessagePack\Packer())->pack(['foo' => 'bar']);
$packed = base64_encode($packed);
echo $packed; // gaNmb2+jYmFy That should be able to be base64 decoded and then decoded from msgpack to give |
@darrachequesne Any luck? |
Closed by #156. |
Emitting messages with external processes trigger errors on msgpack decoding of UInt64.
Detailed description can be found at creationix/msgpack-js#16
The solution is very quick... change msgpack library which socket.io-redis is based on.