Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(core): an operation: 'update' action posts only its collected params, never its patch (objectui#12941) - #12944

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-12941-update-action-params
Oct 18, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-12941-update-action-params

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #12941

Clause-②: no

An operation: 'update' action now posts only the values collected for its declared params (plus the transport keys the dispatch reads: recordId, and the _rowRecord stash it strips). It never posts its declared patch: the platform action route applies the patch itself, from the action definition it resolves by name.

Why

ActionRunner.executeUpdateOperation merged action.patch under the collected values and handed the result to the registered script dispatch as params. 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's declarativeUpdateWrite (in @objectstack/runtime, action-execution.ts) builds the write as { ...patch, ...params } with patch read 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 (the action-execution.ts diff to origin/main 53ef75243 is empty). The REST door reads recordId (path, else body) and body.params, and nothing else. It runs enforceActionParams on body.params, then executeDeclarativeUpdateAction, which writes declarativeUpdateWrite(actionDef, reqParams). The MCP run_action door calls the same executor. So the console stops sending nothing the server reads. The server has applied the patch from the declaration since @objectstack/runtime 17.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:
    • The request is { ...action, params: { ...collected } }.
    • The route's merge, { ...patch, ...collected }, is still computed, but only for the Undo snapshot. writtenFields is its keys minus _rowRecord and recordId, as before, and redoData reads from it. So Undo still covers the patch fields, which the route writes, and it never reads the request.
    • Doc comments that said a request without the merged patch makes the route write nothing are corrected: the operation field doc, the dispatch comment in execute, and the method doc. They now say why operation is still read before type: the Undo capture, the no-route refusal, and the unparsed row with no type.
  • .changeset/12941-update-action-params.md: @object-ui/core patch.

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 and skills/), 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 real ActionRunner and the real createServerActionHandler over a route stub. The stub resolves the declaration by the action name in the URL, judges the request's params with @objectstack/spec's own validateActionParams, 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 shape ObjectGrid hands a row action: definitions under actionParams, row under params._rowRecord.

  • A patch-only button (mark_done, patch: { status: 'done' }): no refusal, success, and the route writes { status: 'done' } to rec_10.
  • Control: a button that declares a param (add_note, one declared note param): the request is exactly { recordId: 'rec_10', params: { note: 'typed by the user' } }, and the route writes { status: 'done', note: 'typed by the user' }.
  • Control: the stub refuses. It is sent the old request (the patch key as a param), and refuses with 400 VALIDATION_ERROR naming status. 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, through ablation-replace.mjs. The anchor const result = await dispatch({ ...action, params: wire }, this.context); was replaced with params: { ...patch, ...wire }, which puts the patch back into the request. The tool reported the anchor going from 1 to 0 hits and the blob from acafeae2d6d8 to 2b4441518d61. 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 to acafeae2d6d8, equal to HEAD, git diff HEAD is empty, and a rerun gives 13 of 13 passed. The test imports ../ActionRunner relatively, so no dist is involved.

Pins flipped to the new request body

Pin Before Now
ActionRunner.updateOperation.test.ts, "POSTs … with the record id" params { recordId, status } { recordId }
same file, "dispatches on operation even when the action carries NO type" toMatchObject({ status }) toEqual({ recordId })
same file, the "a collected value wins" case params carried patch status only { recordId, note }; the route's merge is described in the comment
same file, the undoable capture unchanged undo/redo values adds that the request carries note alone while undo covers status
action-button-icon-inputs-11168.test.tsx, "operation: update …" (both action:button and action:icon) dispatch params carried stage from patch dispatch def carries operation and patch, and params are the supplied values only
action-button-undoable-11168.test.tsx, "on a record page" body params: { status: 'done' } params: {} (undo still status)
useConsoleActionRuntime.undoLookupId-11122.test.tsx, the route stub wrote the params it was sent writes { ...action.patch, ...params }, as the route does
undoProjectedRow-10404.test.tsx (plugin-grid), the route stub same same correction

Before 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-11122 and AppContent.undoFallbackObject-11080 stub the dispatch without reading the request, and the bulk paths in plugin-grid write through bulkActionDefs, not this runner.

Verification (head 8502b417)

  • pnpm exec vitest run --maxWorkers=2 packages/core/src/actions/: 35 files, 565 tests passed.
  • Every test file under packages/apps that authors operation: 'update' (35 files), plus packages/core/src/actions/ and packages/components/src/renderers/action/: 103 files, 1637 tests passed. This ran on the tree of dea635f7. 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/types built first.
  • pnpm check:new-line-citations 0 · pnpm check:test-path-roots 0 · pnpm check:changeset-claims 0 · node scripts/check-changeset-presence.mjs 0 · pnpm changeset:check 0 · pnpm check:action-forward-parity 0.
  • eslint --no-inline-config on the 6 changed TS files: 0 errors, and no warning added over base.
  • node scripts/check-governed-queue-guard.mjs --test on the diff: NOT GOVERNED.
  • Declared to CI: the tsconfig.test.json type-check of components, app-shell and plugin-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 declarativeUpdateWrite merges the request's params into 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 inside params. The console's shared dispatch keeps an explicit params.recordId in params as 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

…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>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 75 chunks) 3157.3 KB 3744.1 KB
Main entry chunk (gzip) 80.6 KB 350 KB
Entry file index-DbCG42t9.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 21.41KB 7.88KB
app-shell (runtime-config.js) 24.52KB 8.48KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 45.59KB 12.03KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 20.67KB 6.12KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.74KB 3.94KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.62KB 0.83KB
auth (authStyles.js) 5.27KB 1.86KB
auth (createAuthClient.js) 42.84KB 11.66KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.26KB 8.03KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (commentAuthorship.js) 1.39KB 0.78KB
collaboration (index.js) 1.93KB 0.85KB
collaboration (useCollaborationTranslation.js) 6.50KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 612.39KB 149.02KB
core (index.js) 10.18KB 4.04KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 248.83KB 69.44KB
fields (index.js) 291.72KB 74.47KB
i18n (LocalizationContext.js) 2.92KB 1.42KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.52KB 2.39KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 36.87KB 9.88KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.33KB 11.96KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 15.35KB 5.51KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.82KB 2.38KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.04KB 3.92KB
plugin-calendar (index.js) 55.04KB 16.10KB
plugin-charts (index.js) 85.06KB 23.39KB
plugin-chatbot (index.js) 210.60KB 49.94KB
plugin-dashboard (index.js) 146.43KB 39.63KB
plugin-designer (index.js) 233.95KB 50.08KB
plugin-detail (index.js) 266.04KB 70.50KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 181.16KB 46.84KB
plugin-gantt (index.js) 178.46KB 45.13KB
plugin-grid (index.js) 272.87KB 75.68KB
plugin-kanban (index.js) 63.37KB 19.51KB
plugin-list (index.js) 139.74KB 35.99KB
plugin-map (index.js) 27.17KB 9.00KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 46.66KB 13.13KB
plugin-timeline (index.js) 39.31KB 11.88KB
plugin-tree (index.js) 15.27KB 5.40KB
plugin-view (index.js) 94.68KB 24.36KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 12.07KB 3.68KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 125.37KB 41.04KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.71KB 2.11KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.07KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.81KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 23.87KB 7.83KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 5.78KB 2.70KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (node-slots.js) 7.18KB 2.34KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (product-blocks.js) 0.20KB 0.19KB
types (record-approval-decision.js) 0.20KB 0.20KB
types (record-components.js) 0.20KB 0.19KB
types (record-panels.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.26KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.48KB 3.50KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 — ACCEPT · domain:ui seat 1 · session_0188TsgPV8kQXfuRuKmkj2ks · 2026-10-18T07:47Z

Reviewed on GitHub at head 8502b417c3de85a02599f5dbae080f28e589e3ae, against claim 6246984731 on objectui#12941.

  1. Shape. The PR is a draft against main and opens with Fixes #12941, its only closing keyword. The assignee is sunhaolin. check-governed-merges --pr reads NOT governed, at +250 / −49.
  2. Premise and diff, measured.
    • executeUpdateOperation dispatches { ...action, params: wire }, where wire = { ...collected }. No patch key reaches the request.
    • The route's merge { ...patch, ...collected } survives as written, and is read only for writtenFields and redoData. So Undo still covers the patch fields.
    • Server side, read-only: objectstack declarativeUpdateWrite writes { ...action.patch, ...params }, with patch taken from the declaration it resolves by name. So what a button writes is unchanged.
    • Every non-test script dispatch on objectui main is built by createServerActionHandler: useConsoleActionRuntime.tsx:801, RecordDetailView.tsx:3500, consoleServerAction.ts:168 and flowLaunch.ts:198. So no in-repo dispatch writes params directly and loses the patch. The changeset names the one remaining reader, a custom script dispatch.
    • The dev's ablation put patch back on the wire and went red as predicted, 6 of 13. The refusal control stayed green (report on the card).
  3. Gates. There are 36 check-runs on this head: 33 success and 3 skipped. Clause-②: no, as claimed: no key moves, and the request narrows to what the server already reads. The diff touches no contract face, so this ACCEPT is the review at TIER_DEFAULT.
  4. Accepted deviations: the doc-comment corrections on ActionDef.operation/patch and execute, and the four downstream pins that read the old request body. Each pin now asserts the collected values only.
    • Changeset sentences checked against the diff:
      • "What a button writes is unchanged": true, per the server read above;
      • "Undo is unchanged": written feeds writtenFields and redoData;
      • "A custom script dispatch … params hold the collected values alone": wire.
  5. Out of scope, carried to objectstack#24268 on landing: declarativeUpdateWrite spreads the whole request params over the patch. So a key the action does not declare would reach the write until that card's refusal ships. This PR removes the console's own instance of that request.
  6. Landing. Ready and auto-merge through objectui's merge queue. On MERGED, Fixes #12941 closes the card, and the seat posts the landing note and strips pm:dispatched.

VERDICT: ACCEPT


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 18, 2026 07:48
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 18, 2026 07:48
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit fb501bc Oct 18, 2026
37 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-12941-update-action-params branch October 18, 2026 08:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants