DynamoDb no longer throwing an exception for undefined attributes on PUT (and removeUndefinedValues
being ignored)
#6433
Labels
bug
This issue is a bug.
p3
This is a minor priority issue
response-requested
Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Checkboxes for prior research
Describe the bug
In previous versions of the aws-sdk (specifically
@aws-sdk/lib-dynamodb
), the default behaviour when providingundefined
values to DynamoDbPUT
operations was to throw an exception with the messagePass options.removeUndefinedValues=true to remove undefined values from map/array/set.
. This was the equivalent behaviour of initialising the DB Client withremoveUndefinedValues: false
.Since release 3.429.0, this is no longer the case -
undefined
values provided to DynamoDb operations are instead just removed, which is the equivalent ofremoveUndefinedValues: true
. Manually settingremoveUndefinedValues: false
has no effect.I believe this has been caused by this change which was included as a bug fix for release 3.429.0.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.14.0
Reproduction Steps
Running the below code in
@aws-sdk/[email protected]
and below will fail with error messagePass options.removeUndefinedValues=true to remove undefined values from map/array/set.
.Running the below code in
@aws-sdk/[email protected]
and above will succeed, removing the undefined attributes.Observed Behavior
In
@aws-sdk/[email protected]
and below, this operation would throw an exception with the error messagePass options.removeUndefinedValues=true to remove undefined values from map/array/set.
, unlessremoveUndefinedValues: true
is set in the DynamoDb instance config.In
@aws-sdk/[email protected]
and above, the operation will succeed, and will have removed the undefined values from the record altogether - regardless of theremoveUndefinedValues
setting.Expected Behavior
I would expect the behaviour to be consistent - that the operation would throw an exception with the error message
Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.
, unlessremoveUndefinedValues: true
is set in the DynamoDb instance config.Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: