Skip to content

[Bug] Protobuf Payload Converter is broken after upgrading to protobufjs 7.5.2 #1717

Open
@mjameswh

Description

@mjameswh

Describe the bug

After upgrading protobufjs to 7.5.2, our feature tests using Protobuf Payload converters have started failing with the following error message:

Feature data_converter/binary_protobuf failed with TypeError: Cannot read properties of undefined (reading '_fullyQualifiedObjects') TypeError: Cannot read properties of undefined (reading '_fullyQualifiedObjects')
    at Object.lookup (/home/runner/work/sdk-typescript/sdk-typescript/features/program-3122623612/node_modules/protobufjs/src/namespace.js:411:27)
    at Object.lookupType (/home/runner/work/sdk-typescript/sdk-typescript/features/program-3122623612/node_modules/protobufjs/src/namespace.js:491:22)
    at ProtobufBinaryPayloadConverter.validatePayload (/home/runner/work/sdk-typescript/sdk-typescript/sdk-ts/packages/common/lib/converter/protobuf-payload-converters.js:58:37)
    at ProtobufBinaryPayloadConverter.fromPayload (/home/runner/work/sdk-typescript/sdk-typescript/sdk-ts/packages/common/lib/converter/protobuf-payload-converters.js:99:44)
    at PayloadConverterWithProtobufs.fromPayload (/home/runner/work/sdk-typescript/sdk-typescript/sdk-ts/packages/common/lib/converter/payload-converter.js:113:26)
    at /home/runner/work/sdk-typescript/sdk-typescript/sdk-ts/packages/common/lib/converter/payload-converter.js:60:48
    at Array.map (<anonymous>)
    at arrayFromPayloads (/home/runner/work/sdk-typescript/sdk-typescript/sdk-ts/packages/common/lib/converter/payload-converter.js:60:21)
    at decodeArrayFromPayloads (/home/runner/work/sdk-typescript/sdk-typescript/sdk-ts/packages/common/lib/internal-non-workflow/codec-helpers.js:89:54)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Minimal Reproduction

The following feature tests demonstrate this issue:

  • data_converter/binary_protobuf
  • json_protobuf

All SDK integration tests still pass, including those testing the Protobuf Payload Converter feature. Our protobufs sample also execute without problem against 1.11.8 + protobufjs 7.5.2 (didn't test other combinations). Given that the latter are more representative of how users would normally use this feature, it seems reasonable to expect that this issue might not have any user visible impact.

Misc

  • The _fullyQualifiedObjects property was introduced in protobufjs yesterday.
  • It seems likely that this upstream change may conflict with our "Patch Protobuf Root" logic.
  • Due to technical constraints of our feature test harness, our feature tests reuse some protobuf message definitions of the SDK itself, rather than defining and compiling their own protobuf messages as one would normally do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions