Skip to content

Small inconcistency in optional fields #408

@llucax

Description

@llucax

What happened?

In https://github.com/frequenz-floss/frequenz-api-common/blob/v0.x.x/proto/frequenz/api/common/v1alpha8/microgrid/sensors/sensors.proto#L92-L97:

  // Optional vendor-provided diagnostic code for the error, for vendor-specific
  // insights or more granular diagnostics.
  optional string vendor_diagnostic_code = 2;

  // Optional human-readable message providing additional context.
  string message = 3;

Both fields are optional but one has the explicit optional marker and the other one doesn't.

This makes parsing inconsistent too, as one field must be checked via HasField() and the other one should be checked comparing to the empty string to know if it is set or not.

What did you expect instead?

Both fields have optional.

Affected version(s)

v0.8.0

Affected part(s)

The protocol buffer definition files (part:protobuf)

Extra information

I didn't check if we have other instances of inconsistencies like this one. Maybe it is worth checking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:❓We need to figure out how soon this should be addressedtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions