Skip to content

Silent failures When Using 'Class.verify' #685

@tomergg

Description

@tomergg

protobuf.js version: 6.6.3

I'm working on upgrading our pbjs from 5.x to 6.x.
The code is a lot easier to use and I was able to remove quite a bit of custom wrapper code.
So far I ran into 2 issues:

  1. verify works sometimes. It seems to fail silently, even if I pass "junk" in
const rootNamespace = protobuf.Root.fromJSON(pbJson);
const pbDef = rootNamespace.looup('Pb.MyDef');
const verifyResult = pbDef[pbClassName].verify(123);
if (verifyResult) {
  throw new Error(verifyResult);
}
  1. When decoding, I can specify { enums: String } which is great, but when encoding enums can be specified only by integer. Is there a plan to re-introduce support for encoding enum strings?

Thank you @dcodeIO for all the great work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions