question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unused message properties are being defaulted

See original GitHub issue

Hello.

If 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 to simulate this issue. I included some more properties in the HelloReply message

message HelloReply {
  string message = 1;
  double number_property = 2;
  string string_property = 3;
  repeated string array_property = 4;
  message NestedMsg {
  	string property = 1;
  }
  NestedMsg nested_property = 5;
}

and I just added a small print statement to dynamic_codegen/greeter_client.js

console.log('Total message:', JSON.stringify(response));

and it prints:

Total message: {"message":"Hello world","number_property":0,"string_property":"","array_property":[],"nested_property":null}

So, all properties are being defaulted to 0/“”/[]/null. Is this the expected behaviour? I thought it could also be a protobuf.js-specific issue. In 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.

If this is the expected workflow for gRPC messages, can it be turned off?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolasnoblecommented, May 3, 2018

@respinha-ribeiro there’s an issue with node 10 (nodejs/node#20258) that prevents us from running tests with node 10 at the moment, so we can’t legitimately recommend using node 10 with gRPC just yet. This will require a new release of node 10.

1reaction
Crevilcommented, May 3, 2018

This is fixed with #307 but not released yet

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot: external messages.properties are being added ...
Although when the application is working, the values from it are not used. They are coming from default messages.properties inside my resources project ......
Read more >
TDS Format message set properties - IBM
Specify the default value of a special character or string that specifies the delimiter that is used between data elements. This property ......
Read more >
Language Guide | Protocol Buffers - Google Developers
The default value can be specified as part of the message description. For example, let's say you want to provide a default value...
Read more >
Message (Java EE 6 ) - Oracle Help Center
Properties allow an application, via message selectors, to have a JMS provider select, or filter, messages on its behalf using application-specific criteria.
Read more >
Server.properties - Minecraft Wiki - Fandom
The default server.properties file for Java Edition. ... watchdog stops the server with the message, A single server tick took 60.00 seconds (should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found