Files
floci/src/main/java/io/github
TATSUNO “Taz” Yasuhiro 6d43e16d0e fix(dynamodb): match AWS on UpdateItem results and request limits (#3447)
* fix(dynamodb): match AWS UpdateItem response and validation gaps

UPDATED_NEW on a nested SET returned the whole parent map. It now returns
only the changed fragment, and the diff recurses into maps.

A REMOVE with UPDATED_NEW returned an empty Attributes. AWS omits the
field, since nothing was set to a new value.

An invalid ReturnValues also reports one error rather than aggregating
with ReturnConsumedCapacity, which is what AWS answers.

Closes 2 TIER 1 and 1 TIER 3 cases in the dynamodb-conformance suite.

* fix(dynamodb): reject an empty binary value on a secondary index key

An empty binary index key value was stored. AWS rejects it the same way
as an empty string, with the put wording that names the index and key,
and the shorter update wording for UpdateItem.

Closes 3 TIER 3 cases in the dynamodb-conformance suite.

* fix(dynamodb): reject expressions over 4096 bytes

AWS caps every expression parameter at 4096 bytes and checks the raw
text before the table lookup and before syntax. Floci accepted any size.

The wording follows what eu-west-2 and us-east-1 return. Write APIs wrap
the error in the validation envelope, read APIs do not, and only the
Scan FilterExpression reports the measured size.

Closes 5 TIER 3 cases in the dynamodb-conformance suite.

* fix(dynamodb): reject arithmetic results outside the number range

SET with + or - and ADD stored any result. AWS rejects a result it
cannot store with "Number overflow. Attempting to store a number with
magnitude larger than supported range", and uses that one wording for a
magnitude that is too small or too many significant digits as well.

Closes 1 TIER 3 case in the dynamodb-conformance suite.

* fix(dynamodb): reject attribute values nested deeper than 32 levels

AWS counts a top-level attribute as level 1 and rejects an item or an
ExpressionAttributeValues entry whose leaf sits below level 32, before
the table lookup. Floci stored any depth. The check now runs on the
PutItem item and on ExpressionAttributeValues for PutItem, DeleteItem,
UpdateItem, Query and Scan.

Closes 2 TIER 3 cases in the dynamodb-conformance suite.

* fix(dynamodb): apply the size and nesting limits to batch and transact writes

BatchWriteItem and TransactWriteItems now reject a Put item nested deeper
than 32 levels, and TransactWriteItems rejects an oversized UpdateExpression
or ConditionExpression, all before the table lookup.

AWS reports these without the validation envelope, and the transact
ConditionExpression carries the measured size like the Scan filter does.
A too deep ExpressionAttributeValues entry in a transact Update is a
cancellation on AWS, not a top-level error, and is left as is.

* fix(dynamodb): cancel a transaction on a too deep Update value

AWS checks the depth of a transact Update's ExpressionAttributeValues as
part of that member. A leaf below level 32 cancels the transaction with a
ValidationError reason and the message "Nesting Levels have exceeded
supported limits". A ConditionCheck value is not checked, so its condition
simply runs.

A cancellation reason can now carry its own message. Reasons without one
keep "The conditional request failed".

* fix(dynamodb): validate request numbers before the table lookup like AWS

* fix(dynamodb): check nesting depth in legacy value containers like AWS

* fix(dynamodb): return UPDATED_NEW and UPDATED_OLD by touched path like AWS

* fix(dynamodb): check the TransactGetItems projection size before the table lookup

* fix(dynamodb): reject and cancel on a too deep PartiQL parameter like AWS
2026-09-11 23:27:54 -04:00
..