UpdateItemEnhancedRequest for null version number with `ignoreNulls(true)` results into ConditionalCheckFailedException
- Vorherrschende Sprache
- Java
- Sterne
- 2.6k
- Forks
- 1k
- Ø Merge
- 2 T. 9 Std.
- Gemergte PRs (30 T.)
- 51
Beschreibung
## 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
Beitragsleitfaden
Rechercherichtung
Beginne bei UpdateItemEnhancedRequest und table.updateItem im DynamoDB Enhanced Client und verfolge dann, wie ein null @DynamoDbVersionAttribute mit ignoreNulls(true) behandelt wird. Reproduziere das gezeigte CustomDynamoDbBean-Beispiel auf JDK 8 mit AWS SDK 2.0; abgeschlossen ist die Aufgabe, wenn die null-Version ohne ConditionalCheckFailedException ignoriert wird und das Verhalten durch Regressionstests abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- database
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100