{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-node/issues/189","repository_url":"https://api.github.com/repos/grpc/grpc-node","labels_url":"https://api.github.com/repos/grpc/grpc-node/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-node/issues/189/comments","events_url":"https://api.github.com/repos/grpc/grpc-node/issues/189/events","html_url":"https://github.com/grpc/grpc-node/issues/189","id":298918480,"number":189,"title":"Unused message properties are being defaulted","user":{"login":"respinha-ribeiro","id":30845991,"avatar_url":"https://avatars3.githubusercontent.com/u/30845991?v=4","gravatar_id":"","url":"https://api.github.com/users/respinha-ribeiro","html_url":"https://github.com/respinha-ribeiro","followers_url":"https://api.github.com/users/respinha-ribeiro/followers","following_url":"https://api.github.com/users/respinha-ribeiro/following{/other_user}","gists_url":"https://api.github.com/users/respinha-ribeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/respinha-ribeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/respinha-ribeiro/subscriptions","organizations_url":"https://api.github.com/users/respinha-ribeiro/orgs","repos_url":"https://api.github.com/users/respinha-ribeiro/repos","events_url":"https://api.github.com/users/respinha-ribeiro/events{/privacy}","received_events_url":"https://api.github.com/users/respinha-ribeiro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-21T10:38:43Z","updated_at":"2018-02-22T08:12:18Z","closed_at":null,"author_association":"NONE","body":"Hello.\r\n\r\nIf I send a message via gRPC which doesn't have all of its properties set, they are being defaulted to a null/empty value. I've modified the officially provided [example](https://github.com/grpc/grpc/tree/master/examples/node) to simulate this issue. \r\nI included some more properties in the `HelloReply` message\r\n\r\n```\r\nmessage HelloReply {\r\n  string message = 1;\r\n  double number_property = 2;\r\n  string string_property = 3;\r\n  repeated string array_property = 4;\r\n  message NestedMsg {\r\n  \tstring property = 1;\r\n  }\r\n  NestedMsg nested_property = 5;\r\n}\r\n```\r\n\r\nand I just added a small print statement to `dynamic_codegen/greeter_client.js`\r\n\r\n```\r\nconsole.log('Total message:', JSON.stringify(response));\r\n```\r\n\r\nand it prints:\r\n\r\n```\r\nTotal message: {\"message\":\"Hello world\",\"number_property\":0,\"string_property\":\"\",\"array_property\":[],\"nested_property\":null}\r\n```\r\n\r\nSo, all properties are being defaulted to 0/\"\"/[]/null. Is this the expected behaviour? I thought it could also be a protobuf.js-specific issue.\r\nIn my case, this behaviour is not desirable as in some cases I override existing data in my system with data from protobuf messages and if those properties are defaulted I might even override valid data with a null or empty value. \r\n\r\nIf this is the expected workflow for gRPC messages, can it be turned off?"},"comment":{"url":"https://api.github.com/repos/grpc/grpc-node/issues/comments/367599549","html_url":"https://github.com/grpc/grpc-node/issues/189#issuecomment-367599549","issue_url":"https://api.github.com/repos/grpc/grpc-node/issues/189","id":367599549,"user":{"login":"respinha-ribeiro","id":30845991,"avatar_url":"https://avatars3.githubusercontent.com/u/30845991?v=4","gravatar_id":"","url":"https://api.github.com/users/respinha-ribeiro","html_url":"https://github.com/respinha-ribeiro","followers_url":"https://api.github.com/users/respinha-ribeiro/followers","following_url":"https://api.github.com/users/respinha-ribeiro/following{/other_user}","gists_url":"https://api.github.com/users/respinha-ribeiro/gists{/gist_id}","starred_url":"https://api.github.com/users/respinha-ribeiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/respinha-ribeiro/subscriptions","organizations_url":"https://api.github.com/users/respinha-ribeiro/orgs","repos_url":"https://api.github.com/users/respinha-ribeiro/repos","events_url":"https://api.github.com/users/respinha-ribeiro/events{/privacy}","received_events_url":"https://api.github.com/users/respinha-ribeiro/received_events","type":"User","site_admin":false},"created_at":"2018-02-22T08:12:18Z","updated_at":"2018-02-22T08:12:18Z","author_association":"NONE","body":"I didn't notice it in the documentation, thanks, @murgatroid99. I'll wait for the new package then.  "}}
{"actor":{"display_login":"respinha-ribeiro"}}