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
I get get a buffer in the messages 4096 long full of 0s after the data. If I don't trim it the fromBuffer throws an error about trailing 0s. ,"stack":"Error: trailing data\n I can remove trailing 0s and it works, I've verified encoding and decoding in python. I'm not super happy removing trailing 0s because what if the last encoded utf8 is validly 0? Should the keySchema/valueSchema not just provide a length or something?
I feel like this isn't expected behaviour?
The text was updated successfully, but these errors were encountered:
Hi @murrayirrigation. This error is avsc protecting you from incorrect data: toBuffer expects its input buffer to contain exactly one value's encoding. If additional data is expected in the buffer, you can replace it with decode:
const{value, offset}=type.decode(buf);
value will contain the decoded value, and offset the start of the trailing data. You may for example want to check that buf only contains zero after it.
I have a simple key value schema
When I attempt to decode:
I get get a buffer in the messages 4096 long full of 0s after the data. If I don't trim it the fromBuffer throws an error about trailing 0s. ,"stack":"Error: trailing data\n I can remove trailing 0s and it works, I've verified encoding and decoding in python. I'm not super happy removing trailing 0s because what if the last encoded utf8 is validly 0? Should the keySchema/valueSchema not just provide a length or something?
I feel like this isn't expected behaviour?
The text was updated successfully, but these errors were encountered: