astarte-platform / astarte_vmq_plugin

Astarte VerneMQ plugin publishes incoming messages on an AMQP exchange with some additional metadata, so they can be processed by other components.
http://astarte-platform.org/
Apache License 2.0
16 stars 10 forks source link

Allow empty payload in publish #34

Closed rbino closed 4 years ago

rbino commented 4 years ago

With the old protobufs, the default value for not-set payload for nil, which was an invalid one. When converting to Protobuf 3 with 02b97b8999e28aabb8b47934fa6c11071897ccd4 the default value changed from nil to an empty string, but an empty string is effectively a valid payload (e.g. for an unset message), so we have to remove the clause marking the value as invalid.

Fixes https://github.com/astarte-platform/astarte/issues/460

Signed-off-by: Riccardo Binetti riccardo.binetti@ispirata.com

codecov[bot] commented 4 years ago

Codecov Report

Merging #34 into release-0.11 will decrease coverage by 0.32%. The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##           release-0.11      #34      +/-   ##
================================================
- Coverage         76.00%   75.67%   -0.33%     
================================================
  Files                 8        8              
  Lines               150      148       -2     
================================================
- Hits                114      112       -2     
  Misses               36       36              
Impacted Files Coverage Δ
lib/astarte_vmq_plugin/rpc/handler.ex 50.00% <ø> (-3.34%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 52d9be8...276d5d9. Read the comment docs.