Open peeyushsrj opened 7 years ago
Can you please provide some cases to reproduce? Thanks!
You can check over here https://backbench.github.io/repl/. This works fine in chrome <= 59! This is repl for https://bblang.org
I can see that. However all the unit test suite is passing locally on Chrome 60 with msgpack v3.5.0.
@mcollina I did changed to version 3.5.0 in console, still the same error. You can check yourself over https://backbench.github.io/repl/
Can you reproduce without all of that?
I will try to.
Same bug, reproduced here in Chrome 60, Firefox 55 and Edge 40 : https://jsfiddle.net/antlafarge/wrjzt1zy/
The method BufferList.readUInt8(offset)
returns always the first value of the internal buffer.
https://github.com/mcollina/msgpack5/blob/5fd4ef72603d99ab139fd570e841dc72c8b274a2/lib/decoder.js#L119
So, is this a bug on bl?
I'm a bit lost, as the browser tests are passing.
Maybe, I'm not sure. But I'm sure the lib is actually broken on most of the recent browsers.
@antlafarge how are you including the library?
In my projects with <script src="./libs/msgpack5.js"></script>
In jsfiddle I did an "ugly" copy paste to avoid file hosting ^^
Have you built that bundle yourself, or is it the one from this repo?
From this repo :)
I just pushed an updated version of that bundle. Please check. Il giorno mar 29 ago 2017 alle 19:32 antlafarge notifications@github.com ha scritto:
From this repo :)
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/mcollina/msgpack5/issues/57#issuecomment-325649310, or mute the thread https://github.com/notifications/unsubscribe-auth/AADL4xhFA1iNpzuDVN_wpTh3ZmGHCCvJks5sdATygaJpZM4O8-T9 .
msgpack5.js and msgpack5.min.js in the dist directory are unchanged. And I have the same problem.
it's now pushed, please check.
@mcollina please do a release for current updates in msgpack5. As I am using cdn in production.
v3.5.1 is published. Let me know how it goes.
Okay we get further. But there is a problem by decoding with a js array as parameter.
msgpack5().decode([146, 13, 37]);
should result to [13, 37]
, but results to 49
.
Here is the call stack :
> BufferList.prototype._appendBuffer( Uint8Array(3) [ 49, 52, 54 ] )
BufferList.prototype.append( 146 )
BufferList.prototype.append( [146, 13, 37] )
msgpack5.decode( [146, 13, 37] )
Here the strange Buffer I got :
So my question : Is the js array as input always supported?
Edit : By using an array as input, I expect the BufferList uses the function fromArrayLike
internally.
By using an Uint8Array as input, the IncompleteBufferError is gone and the result is correct.
It's working fine for chrome versions, before 60. Also not working on latest firefox! Please do review
decode()
function.