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
{{ message }}
Repository navigation
SET of several list elements past the end applies them in expression order and loses values #74
Priority: high.SET l[4] = :b, l[3] = :a on l = [x, y, z] stores [x, y, z, a]: b is appended at index 3 and then overwritten. DynamoDB stores [x, y, z, a, b]. Likewise SET l[9] = :b, l[5] = :a stores [..., b, a] where DynamoDB stores [..., a, b].
Where:crates/dynamoxy-core/src/expr/update.rs: the SET actions are assigned in expression order, and assign pushes whenever the index is at or past the length.
Why it matters beyond the in-memory backend:repository._evaluate uses the same evaluator (_core._apply_update) to compute derived attributes and to refresh instances after a transaction, so on AWS too the local instance can differ from the stored item.
DynamoDB: the update expressions guide says "If you add multiple elements in a single SET operation, the elements are sorted in order by element number."
Fix: apply the SET actions that append past the end of the same list in order of their index.
Found in a review of the library for bugs (fctl session); the fixes that fit in its ten pull requests are #61 to #65, #67 to #70 and #72.
Activity