Skip to content

int32 negative value turn into highest value int32 = 4294967295 #31

Closed
@u007

Description

@u007

Version: google-protobuf: "3.12.2"

Generated on Environment for client for nodejs
OS name, version and architecture: Windows 10
Node version v12.17.0
Node installation method nvm
Package name and version grpc 1.24.2

Dart Server:
Dart VM version: 2.8.2 (stable)
compiled via dart2native on Ubuntu 20.04 LTS
Package: GRPC 2.0.3

What did you do?
Steps to reproduce the behavior:

  1. Generate dart server proto files
  2. Generate nodejs client proto files
npx grpc_tools_node_protoc --js_out=import_style=commonjs,binary:js/generated/project --grpc_out=js/generated/project-Iprotos --proto_path=std_protos protos/inventory.proto 
  1. run dart server and test via dart client, works fine with negative int32

  2. run the nodejs client to connect to dart server

What did you expect to see

expected int32 field value to be negative as sent from server

What did you see instead?

accumulation of value from 4294967295

No exceptions, just value problem

sample proto file (only happen to int32, double works fine)

message Inventory {
  string name = 1;
  string code= 2;
  int32 availableQuantity = 3;
  double stockQuantity = 4

  google.protobuf.Timestamp createdDatetime = 5;
}

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