Repository navigation
Conversation
A single-record action triggered on several ids ran on the first record only and answered success, since ActionContextSingle reads records[0]. An API client or an approval request could send such a selection, and every record past the first was silently skipped. The route now answers 422 for a single-record action whose selection names more than one id or is a select-all, before any authorization check: no approval request is created for it, approving a stored one runs nothing, and the form hooks refuse it too. Refs: PRD-1704 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
hercemer42
left a comment
There was a problem hiding this comment.
Spec (PRD-1704): conforms.
…route handlers The new cases called the private handlers, so the approval case never ran the signed-request middleware a real approval passes through. They now go through the handlers setupRoutes registers, with a signed approval request naming the two ids. Refs: PRD-1704 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route refused a single action on several ids or a select-all but let an empty selection through, which the MCP server sends when recordIds is omitted: the action then ran on nothing and answered success, or failed with a raw error from getRecordId. A single action now runs only on exactly one id, as the Python agent does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Scra3
left a comment
There was a problem hiding this comment.
Approved after /validator run 2028-20261022165445-Scra3: nothing blocking posted, 0 preferential or code style, 0 suppressed below all.
## @forestadmin/agent [1.110.5](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.110.4...@forestadmin/agent@1.110.5) (2026-10-23) ### Bug Fixes * **agent:** refuse a single-record action given several records ([#2028](#2028)) ([2c2d8b0](2c2d8b0)) ### Dependencies * **@forestadmin/workflow-executor:** upgraded to 1.35.1

A single-record action triggered on several record ids now answers 422 ("This action can only be triggered on one record at a time.") instead of running on the first record and answering success.
Refs: PRD-1704
What changes
/hooks/load,/hooks/change,/hooks/search). Before: the form loaded against the first record. After: 422.A single-record action on exactly one id and a bulk action on several ids behave as before. The test asserting that audited ids are narrowed to the caller's authorized subset sent two ids to a single-record action, which is now refused, so it moved to the bulk-action block it actually describes.
Definition of Done
General
Security
Squash message
🤖 Generated with Claude Code
Note
Reject multi-record selections for single-record actions in
ActionRouteSingle-scope actions now return an
UnprocessableErrorwhen the selection is select-all, uses excluded records, or contains more than one ID. The check runs in the action-filter builder in action.ts before the selection filter is applied, covering direct requests, approval flows, and form-load hooks.getFormis calledChanges since #2028 opened
ActionRouteclass to reject 'Single' scope actions when the selection is either excluded or does not contain exactly one record identifier [a3a5ec7]Macroscope summarized 2054676.