Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
6.6.3
-
None
Description
Given
message proto_test
{ optional double value = 1; }If we generate the corresponding class using qt_add_protobuf() in our CMAKELists.txt,
Expected:
QProtobufSerializer serializer;
proto_test message;
message.setValue(0);
auto bytes = message.serialize(&serializer);
QCOMPARE(bytes.size(), 9);
Current behavior:
QCOMPARE(bytes.size(), 0);
Thus it is impossible for the receiver of the message to determine whether the field has been set or not. This defeats the whole purpose of having optional fields in the first place!
(Please note that I am aware that checking for "is set" is not possible with the Qt-generated classes. However, in our case the receiver is using google-generated classes).