Skip to content

mitchjust-canva/dynamodb-local-attribute-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DynamoDB Local Attribute Update Bug

This project reproduces a bug in DynamoDB Local starting from version 3.0.0 where UpdateItem operations using the attributeUpdates parameter silently drop attributes when AttributeValueUpdate does not include an explicit AttributeAction.

The Issue

According to the DynamoDB API documentation, when action is omitted from an AttributeValueUpdate, it should default to PUT. DynamoDB Local versions 3.0.0+ ignore these updates entirely, creating items with only the key attributes instead of persisting the specified attributes.

  • Expected behavior: Attributes without explicit actions are treated as PUT operations (works in real DynamoDB and DynamoDB Local v1.x-2.x)
  • Actual behavior: Attributes are silently dropped (broken in DynamoDB Local v3.0.0+)
  • Workaround: Explicitly set AttributeAction.PUT on each update

Test Results

 % ./gradlew test
> Task :app:test

DynamoDBLocalAttributeUpdateBugTest > [3] dynamodbLocalVersion = "3.0.0" > attributeUpdatesWithoutExplicitActionShouldPersist() FAILED
    org.opentest4j.AssertionFailedError at DynamoDBLocalAttributeUpdateBugTest.java:143

DynamoDBLocalAttributeUpdateBugTest > [4] dynamodbLocalVersion = "3.1.0" > attributeUpdatesWithoutExplicitActionShouldPersist() FAILED
    org.opentest4j.AssertionFailedError at DynamoDBLocalAttributeUpdateBugTest.java:143

DynamoDBLocalAttributeUpdateBugTest > [5] dynamodbLocalVersion = "3.2.0" > attributeUpdatesWithoutExplicitActionShouldPersist() FAILED
    org.opentest4j.AssertionFailedError at DynamoDBLocalAttributeUpdateBugTest.java:143

DynamoDBLocalAttributeUpdateBugTest > [6] dynamodbLocalVersion = "3.3.0" > attributeUpdatesWithoutExplicitActionShouldPersist() FAILED
    org.opentest4j.AssertionFailedError at DynamoDBLocalAttributeUpdateBugTest.java:143

12 tests completed, 4 failed

> Task :app:test FAILED

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages