You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using reusable encoders/decoders, decoding fails when using the reused decode() function in the custom decoding function.
The following example works if USE_REUSABLE_CODING is set to false, meaning the whole logic uses the global encode/decode function exported by msgpack, but when set to true, encode and decode are reusable instances of Encode/Decore correspondibly. It fails with RangeError: Extra 18 of 21 byte(s) found at buffer[3].
Does reusable encoders/decoders not work with custom codecs?
Just to be clear, the following is the same code without global encode/decode usage (USE_REUSABLE_CODING being false). This code should work, and could be a regression unit test ☺️:
When using reusable encoders/decoders, decoding fails when using the reused
decode()
function in the custom decoding function.The following example works if
USE_REUSABLE_CODING
is set tofalse
, meaning the whole logic uses the globalencode
/decode
function exported by msgpack, but when set totrue
,encode
anddecode
are reusable instances ofEncode
/Decore
correspondibly. It fails withRangeError: Extra 18 of 21 byte(s) found at buffer[3]
.Does reusable encoders/decoders not work with custom codecs?
Example:
Just to be clear, the following is the same code without global☺️ :
encode
/decode
usage (USE_REUSABLE_CODING
beingfalse
). This code should work, and could be a regression unit testThe text was updated successfully, but these errors were encountered: