You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the document client and setting ReturnValuesOnConditionCheckFailure: 'ALL_OLD', item attributes returned with ConditionalCheckFailedException are not unmarshalled
Regression Issue
Select this option if this issue appears to be a regression.
The SDK's behavior here is working as intended. The ReturnValuesOnConditionCheckFailure feature was specifically designed to return the raw item state at the time of failure - there's no automatic unmarshalling happening here, nor should there be.
The whole point of this feature is to avoid an extra GetItem call when a condition check fails - it's giving you the raw state so you can figure out why the condition failed. If you need the data unmarshalled, you'll have to handle that yourself by using the unmarshall functionality from import { unmarshall } from "@aws-sdk/util-dynamodb";
I don't think there's a need for an extra GetItem call to get the item unmarshalled? I'd suppose the document client can catch the error, introspect it and if the Item key exists, unmarshall it.
Checkboxes for prior research
Describe the bug
When using the document client and setting
ReturnValuesOnConditionCheckFailure: 'ALL_OLD'
, item attributes returned withConditionalCheckFailedException
are not unmarshalledRegression Issue
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v22.3.0
Reproduction Steps
Run the snippet below against a record that violates the condition expression, using your own values and attribute names if needed.
Observed Behavior
The record item returned along with the error is not unmarshalled
Expected Behavior
The record item returned along with the error should be unmarshalled
Possible Solution
Catch the error, unmarshall the item and rethrow
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: