UpdateItemEnhancedRequest for null version number with `ignoreNulls(true)` results into ConditionalCheckFailedException
- 主要言語
- Java
- スター
- 2.6k
- フォーク
- 1k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 51
説明
## Describe the issue
When we use `ignoreNulls(true)` feature while doing `table.updateItem` understanding that it will ignore all null fields to update it in db. But it looks like it's not working as expected for dynamo db version field, when my object contain all required fields like primary hash key, and sort key and version number as null, it's throwing `ConditionalCheckFailedException`.
## Steps to Reproduce
Where version number field is declared as below.
```
@Getter(onMethod_ = {@DynamoDbVersionAttribute})
private Long version;
```
```
customDynamoDbBeanObject.version(null);
dynamoDbTable.updateItem(UpdateItemEnhancedRequest.builder(CustomDynamoDbBean.class)
.item(customDynamoDbBeanObject)
.ignoreNulls(true)
.build());
```
## Current Behavior
It's throwing `ConditionalCheckFailedException`.
## Your Environment
* AWS Java SDK version used: AwsJavaSdk-DynamoDb-Enhanced = 2.0;
* JDK version used: JDK8 = 1.0;
* Operating System and version: Linux
コントリビューションガイド
調査の方向性
DynamoDB Enhanced Client の UpdateItemEnhancedRequest と table.updateItem から開始し、ignoreNulls(true) を指定した場合に null の @DynamoDbVersionAttribute がどのように処理されるかを追跡します。JDK 8 と AWS SDK 2.0 で、示されている CustomDynamoDbBean の例を再現します。ConditionalCheckFailedException を発生させずに null のバージョンが無視され、その動作に回帰テストのカバレッジがあることを完了条件とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- database
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100