-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
decode()
fails silently when passing in a wrong type
#695
Comments
I intentionally omitted these assertions for perf reasons because message Outer {
repeated Inner foo = 1;
}
message Inner {
} ... then you'd call Your request is a valid issue, though |
Thank you again for the quick and detailed answer
This sounds like a good solution. The issue is not blocking me in anyway. I quickly fixed my code and it's working well. It was an easy thing to miss moving from v5 to v6, since v5 used BTW, |
Should be fixed in master. |
protobuf.js version: 6.6.5
When passing in a
ByteBuffer
instead of aUint8Array
, decode fails silently and return an "empty"message
. CallingtoObject
on the message will return an empty object. The expected is to validate the input parameters and throw an exception if it's of an invalid type.As a side note. I came across this bug after switching from v5 to v6. A part of the code, where the test coverage was not ideal, was failing silently. It was only discovered at functional QA time.
The text was updated successfully, but these errors were encountered: