Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134898

QProtobufSerializer Deserializing oneof fields fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 6.8.2
    • Protocol Buffers
    • None
    • iOS/tvOS/watchOS, macOS

      Whenever I use a protobuf message with `oneof`, and serialize it with QProtobufSerializer, the binary raw data seems fine.

       

      However, when deserializing, an assert fails if you don't have all oneof fields set. This is against the core purpose of the oneof field. To avoid failure, I have to set every single oneof field; and this would result in the `hasX` for every oneof field to return true, which defeats the purpose.

       

      If anything, this shouldn't crash the program (assert), but gracefully handle it. Best case is that it handles oneof properly.

       

      I tried looking at the source code, but quickly realized I should perhaps use official protobufs for this use case.

       

      Hope this helps!

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            dennisoberst Dennis Oberst
            arjun Arjun Patel
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes