aws / aws/aws-sdk-java-v2

UpdateItemEnhancedRequest for null version number with `ignoreNulls(true)` results into ConditionalCheckFailedException

Open
#1,985 5 comments 0 reactions 0 assignees View on GitHub
documentation p3
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.