whisklabs / grpc-ts

Whisk GRPC web library
MIT License
31 stars 3 forks source link

Incompatible encode/decode for negative values in int32, int64 with protobufjs #5

Closed veksa closed 3 years ago

veksa commented 3 years ago

In official documentation (https://developers.google.com/protocol-buffers/docs/proto#scalar) types int32 and int64 has possibility to have negative numbers. But your encoding/decoding is not compatible with this types for protobufjs library.

You can check it in types.spec.ts:

int32: -16868,
int64: -2343919238923492000,

will produce an error:

-   "int32": -16868,
-   "int64": -2343919238923492000,
+   "int32": 18446744073709535000,
+   "int64": 16102824834786060000,
askuzminov commented 3 years ago

@veksa Thank you so much. The bug has been fixed.