Description
Default/instance-mode array PUT has two latent argument-normalization defects:
Class.put(batch, context) can lose the inferred collection target when transactional() creates its RequestTarget. The batch is then dispatched as one record update and can fail with Invalid primary key of null instead of writing each element.
- When
getResource() resolves asynchronously during per-element dispatch, the async branch passes the request/context object where the normalized query target is expected. Context fields can consequently be treated as record data.
Both defects reproduce on main. The intermediate e0bb9f6d version of #1842 contained a ready-made fix and regression tests, but that work was deliberately removed when #1842 was rescoped to authorization behavior.
Expected behavior
Default-mode array PUT should preserve collection semantics and dispatch every element consistently whether getResource() resolves synchronously or asynchronously. The request context must never be staged as record data.
References
Description
Default/instance-mode array PUT has two latent argument-normalization defects:
Class.put(batch, context)can lose the inferred collection target whentransactional()creates itsRequestTarget. The batch is then dispatched as one record update and can fail withInvalid primary key of nullinstead of writing each element.getResource()resolves asynchronously during per-element dispatch, the async branch passes the request/context object where the normalized query target is expected. Context fields can consequently be treated as record data.Both defects reproduce on
main. The intermediatee0bb9f6dversion of #1842 contained a ready-made fix and regression tests, but that work was deliberately removed when #1842 was rescoped to authorization behavior.Expected behavior
Default-mode array PUT should preserve collection semantics and dispatch every element consistently whether
getResource()resolves synchronously or asynchronously. The request context must never be staged as record data.References
e0bb9f6ddb4972ba0e482a8f0c521ac9323cad08