googleapis / googleapis/google-cloud-java

[java-firestore] `ServerSideTransaction.execute` ignores `PipelineExecuteOptions` argument

オープン
#13,094 コメント 0 件 リアクション 0 件 担当者 1 名 @MarkDuckworth が担当を希望しています GitHub で見る
api: firestore
主要言語
Java
スター
2.1k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
154

説明

**Description:**

When executing a pipeline within a transaction, the `ServerSideTransaction.execute` method that accepts a `PipelineExecuteOptions` parameter completely ignores it and instantiates an empty options object instead.

**Steps to Reproduce / Code Snippet:**
In `google-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransaction.java`:

```java
@Nonnull
@Override
public ApiFuture execute(
@Nonnull Pipeline pipeline, @Nonnull PipelineExecuteOptions options) {
try (TraceUtil.Scope ignored = transactionTraceContext.makeCurrent()) {
// BUG: ignores the 'options' parameter entirely
return pipeline.execute(new PipelineExecuteOptions(), transactionId, null);
}
}
```

Because of this, any custom options explicitly provided during `transaction.execute(pipeline, options)` get dropped before the underlying gRPC `ExecutePipelineRequest` is dispatched.

**Expected Behavior:**
The method should propagate the correctly populated `options` object provided in the method signature:

```java
@Nonnull
@Override
public ApiFuture execute(
@Nonnull Pipeline pipeline, @Nonnull PipelineExecuteOptions options) {
try (TraceUtil.Scope ignored = transactionTraceContext.makeCurrent()) {
return pipeline.execute(options, transactionId, null);
}
}
```

**Impact:**
Integration tests like `ITPipelineTest.testPipelineInTransactionsWithOptions` end up inadvertently testing with empty options because instances like `new PipelineExecuteOptions().with("foo", "bar")` are discarded silently.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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