Skip to content

Fix default-mode array PUT normalization and async dispatch #2000

Description

@kriszyp

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

P1

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions