This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(core): an operation: 'update' action posts only its collected params, never its patch (objectui#12941) - #12944
Merged
objectstack-fleet[bot] merged 2 commits intoOct 18, 2026
Conversation
…arams, never its `patch` (objectui#12941) The platform action route applies the declared `patch` from the action definition it resolves by name (`declarativeUpdateWrite`), so the request carries only the values collected for the declared `params` plus the record id. Posting the patch keys made every declarative-update button a request with undeclared params, which the runtime's ADR-0104 D2 refusal (objectstack#24268) answers with a 400. The Undo snapshot still covers every field the route writes: it reads the route's merge (`patch` under the collected params), never the request. Pinned against a route stub that judges the real request with `@objectstack/spec`'s `validateActionParams`, with a control for an action that declares a param and a control that the stub refuses an undeclared one. Four downstream pins that asserted the old request body, or whose route stub wrote what it was sent, now model the route as it reads the request. Claude-Session: https://claude.ai/code/session_0188TsgPV8kQXfuRuKmkj2ks Co-authored-by: Claude <noreply@anthropic.com>
…d helper (objectui#12941) Drops the two `as any` casts the new pin added, so the file carries no more lint warnings than its base. Claude-Session: https://claude.ai/code/session_0188TsgPV8kQXfuRuKmkj2ks Co-authored-by: Claude <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contributor
Author
席位核对 — ACCEPT ·
|
objectstack-fleet
Bot
deleted the
claude/issue-12941-update-action-params
branch
October 18, 2026 08:03
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12941
Clause-②: no
An
operation: 'update'action now posts only the values collected for its declaredparams(plus the transport keys the dispatch reads:recordId, and the_rowRecordstash it strips). It never posts its declaredpatch: the platform action route applies the patch itself, from the action definition it resolves by name.Why
ActionRunner.executeUpdateOperationmergedaction.patchunder the collected values and handed the result to the registeredscriptdispatch asparams. So every declarative-update button sent field values its action never declares as params (the card measured{"recordId":…,"params":{"status":"completed"}}). The route wrote the same values either way, because objectstack'sdeclarativeUpdateWrite(in@objectstack/runtime,action-execution.ts) builds the write as{ ...patch, ...params }withpatchread off the resolved declaration, never off the wire. But the runtime half, objectstack-ai/objectstack#24268 (ADR-0104 D2: refuse a param the action does not declare), would answer every such button with a 400. That half waits on this change.Server read, done read-only at objectstack
fb6fb24e2(theaction-execution.tsdiff toorigin/main53ef75243is empty). The REST door readsrecordId(path, else body) andbody.params, and nothing else. It runsenforceActionParamsonbody.params, thenexecuteDeclarativeUpdateAction, which writesdeclarativeUpdateWrite(actionDef, reqParams). The MCPrun_actiondoor calls the same executor. So the console stops sending nothing the server reads. The server has applied the patch from the declaration since@objectstack/runtime17.4.0, the release that first executed this action at all (its CHANGELOG entry for objectstack#14092).What changed
packages/core/src/actions/ActionRunner.ts,executeUpdateOperation:{ ...action, params: { ...collected } }.{ ...patch, ...collected }, is still computed, but only for the Undo snapshot.writtenFieldsis its keys minus_rowRecordandrecordId, as before, andredoDatareads from it. So Undo still covers the patch fields, which the route writes, and it never reads the request.operationfield doc, the dispatch comment inexecute, and the method doc. They now say whyoperationis still read beforetype: the Undo capture, the no-route refusal, and the unparsed row with notype..changeset/12941-update-action-params.md:@object-ui/corepatch.No key, export or type moves. Only what the runner sends changes. No docs page describes this request body (searched
content/docs, the package READMEs andskills/), so no docs change.The pin: a route that refuses undeclared params
New describe block in
ActionRunner.updateOperation.test.ts, "against a route that refuses undeclared params". It runs the realActionRunnerand the realcreateServerActionHandlerover a route stub. The stub resolves the declaration by the action name in the URL, judges the request'sparamswith@objectstack/spec's ownvalidateActionParams, and otherwise writes{ ...declaration.patch, ...params }. Unlike today's runtime, it judges even an action with no declared params, which is the #24268 behaviour. The action is dispatched in the shapeObjectGridhands a row action: definitions underactionParams, row underparams._rowRecord.mark_done,patch: { status: 'done' }): no refusal, success, and the route writes{ status: 'done' }torec_10.add_note, one declarednoteparam): the request is exactly{ recordId: 'rec_10', params: { note: 'typed by the user' } }, and the route writes{ status: 'done', note: 'typed by the user' }.VALIDATION_ERRORnamingstatus. The runner reports failure with an error toast, and nothing is written. This keeps the two greens above from being vacuous.Ablation, run once on committed head
dea635f7, throughablation-replace.mjs. The anchorconst result = await dispatch({ ...action, params: wire }, this.context);was replaced withparams: { ...patch, ...wire }, which puts the patch back into the request. The tool reported the anchor going from 1 to 0 hits and the blob fromacafeae2d6d8to2b4441518d61. Expected direction: red. Observed: red. 6 of 13 tests failed, including "a patch-only button writes its patch" (the route's refusals read[{ action: 'mark_done', code: 'VALIDATION_ERROR', params: ['status'], status: 400 }]) and the declared-param control. The refusal control stayed green. Restore: the blob is back toacafeae2d6d8, equal to HEAD,git diff HEADis empty, and a rerun gives 13 of 13 passed. The test imports../ActionRunnerrelatively, so nodistis involved.Pins flipped to the new request body
ActionRunner.updateOperation.test.ts, "POSTs … with the record id"{ recordId, status }{ recordId }operationeven when the action carries NOtype"toMatchObject({ status })toEqual({ recordId })status{ recordId, note }; the route's merge is described in the commentnotealone while undo coversstatusaction-button-icon-inputs-11168.test.tsx, "operation: update…" (bothaction:buttonandaction:icon)stagefrom patchoperationandpatch, and params are the supplied values onlyaction-button-undoable-11168.test.tsx, "on a record page"params: { status: 'done' }params: {}(undo stillstatus)useConsoleActionRuntime.undoLookupId-11122.test.tsx, the route stub{ ...action.patch, ...params }, as the route doesundoProjectedRow-10404.test.tsx(plugin-grid), the route stubBefore the flips, those last four files failed 6 tests against the fix, which is how they were found. The other suites that author
operation: 'update'did not need changes:RecordDetailView.undoLookupId-11122andAppContent.undoFallbackObject-11080stub the dispatch without reading the request, and the bulk paths in plugin-grid write throughbulkActionDefs, not this runner.Verification (head
8502b417)pnpm exec vitest run --maxWorkers=2 packages/core/src/actions/: 35 files, 565 tests passed.packages/appsthat authorsoperation: 'update'(35 files), pluspackages/core/src/actions/andpackages/components/src/renderers/action/: 103 files, 1637 tests passed. This ran on the tree ofdea635f7. The one later commit only swaps two casts in the core pin for a typed helper, and the core suite above was rerun after it.pnpm --filter @object-ui/core type-check(both programs, the test program lists the pin file): exit 0. It needed@object-ui/typesbuilt first.pnpm check:new-line-citations0 ·pnpm check:test-path-roots0 ·pnpm check:changeset-claims0 ·node scripts/check-changeset-presence.mjs0 ·pnpm changeset:check0 ·pnpm check:action-forward-parity0.eslint --no-inline-configon the 6 changed TS files: 0 errors, and no warning added over base.node scripts/check-governed-queue-guard.mjs --teston the diff: NOT GOVERNED.tsconfig.test.jsontype-check ofcomponents,app-shellandplugin-grid, whose test files changed. Their dependency closures were not built locally. The full farm is CI's.Acceptance notes
Read-only observation, not measured at a door and not filed. objectstack's
declarativeUpdateWritemerges the request'sparamsinto the write whole, so a built-in key the ADR-0104 contract admits (recordId,objectName,_selectedIds) would land in the data-plane write bag when a client sends it insideparams. The console's shared dispatch keeps an explicitparams.recordIdinparamsas well as at the top level, and it did so before this change too. This change neither adds nor removes that key. What the data plane does with it was not measured. The open question goes to the seat, with the objectstack half (#24268) in view.Adds no product-specific widget, dialog, hook or string (see AGENTS.md › Product-neutral renderer)
Generated by Claude Code