Files
floci/src/main/java/io
Tyler Webb ad57ac837f fix(dynamodb): compare numeric key attributes by value in UpdateItem (#5837)
* fix(dynamodb): compare numeric key attributes by value in UpdateItem

UpdateItem and the TransactWriteItems Update path rejected a request
whose key carried an equivalent but differently written number, such as
a sort key of {"N":"1700000000.0"} against a stored {"N":"1700000000"},
with "Cannot update attribute timestamp. This attribute is part of the
key". Stored numbers are normalized on write, and the key-modification
check compared AttributeValue JSON nodes structurally.

The check now uses attributeValuesEqual, which requires matching types
and compares N by numeric value, as DynamoDB does. The item lookup
already treated these keys as the same item.

* fix(dynamodb): reject key attribute values with more than one type member in UpdateItem

Comparing key attributes with attributeValuesEqual matches on the first
type member the two values share, so an UpdateExpression that set a key
attribute to a value carrying an extra type member passed the key check
and the malformed key was stored. The request key is already validated
for shape and schema type when the item key is built, so checking that
the updated value has exactly one type member is enough for the
comparison to imply a matching schema type.
2026-10-16 19:46:44 -04:00
..