Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ProtobufJsonPayloadConverter does not work correctly with shaded artifact

オープン
#2,792 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java
領域
backend

調査の方向性

issue で説明されている MessageOrBuilder チェックの箇所にある temporal-sdk/src/main/java/io/temporal/common/converter/ProtobufJsonPayloadConverter.java から始めます。StringValue.of("hello") を使用して shaded-artifact の再現を実行し、converter の payload 結果を確認します。クライアントコードの protobuf 値が認識され、再現で shaded-artifact に payload が存在すると報告されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Expected Behavior

The ProtobufJsonPayloadConverter does not work correctly when using the shaded Temporal artifact, which is sometimes necessary to avoid gRPC version conflicts.

The problem is: https://github.com/temporalio/sdk-java/blob/81f3cc33be8c4d6dbda48321cbb0b7aee3915e31/temporal-sdk/src/main/java/io/temporal/common/converter/ProtobufJsonPayloadConverter.java#L51-L53

Here, MessageOrBuilder is rewritten in the byte-code to be io.temporal.shaded.com.google.protobuf.MessageOrBuilder, and so passing in a non-shaded value (as certainly client code will be using) fails, and the converter fails to convert the value.

The converter, whether it is shaded or not, should correctly recognize protobuf values coming from client code.

Actual Behavior

Protobuf values coming from client code are ignored, and serialization fails.

Steps to Reproduce the Problem

Using the shaded temporal artifact, run this code:

import com.google.protobuf.StringValue;
import io.temporal.common.converter.ProtobufJsonPayloadConverter;

class Test {
    public static void main(String[] args) {
        var converter = new ProtobufJsonPayloadConverter();
        var msg = StringValue.of("hello");
        var payloadOpt = converter.toData(msg);
        System.out.println(payloadOpt.isPresent());
    }
}

We can see that the payload is not present.

Specifications

  • Version: 1.32.1
  • Platform: N/A
主要言語
Java
スター
434
フォーク
252
平均マージ
2日 19時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

temporalio/sdk-java のほかの issue

temporalio/sdk-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。