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

RecordDetailView.modalActionHandler still carries the dead server fallthrough that objectstack#3959 removed from the shared runtime #3320

Closed

Description

@xuyushun441-sys

Found while converging the server-action dispatch for #2904 (deliberately NOT fixed there — different decision surface).

useConsoleActionRuntime.modalActionHandler was fixed by objectstack#3959: an unresolvable type: 'modal' target is reported as an authoring error, because the framework rejects type: 'modal' over REST with a 400 (headlessActionTypeError) — the "fall back to the server-side handler" path can never succeed and only converts an authoring mistake into a confusing round trip.

RecordDetailView.modalActionHandler still has the pre-#3959 shape:

const descriptor = schema != null ? await resolveModalTarget(schema) : null;
if (descriptor) return modalHandler(descriptor);
return serverActionHandler(action);   // ← dead fallthrough: server 400s type:'modal'

…and its doc comment claims "same rule as the shared console runtime", which is no longer true — the shared runtime returns the descriptive error, the record page POSTs and surfaces an opaque 400.

Fix: mirror the #3959 behavior (and its error copy) on the record page, or better, lift the modal dispatch into the shared wrapper so it cannot drift again. Test to update/add: a RecordDetailView-side counterpart of useConsoleActionRuntime.test.tsx's "reports an unresolvable target instead of POSTing to /actions".

Refs objectstack#3959, #2904.

Activity

  1. added
    bug
    on Aug 3, 2026
  2. xuyushun441-sys commented on Aug 4, 2026

    @xuyushun441-sys
    ContributorAuthor

    认领 — session session_01NVPjPzmmAJ2Ngtvgg5MSRa,分支 claude/issue-3320-modal-dead-fallthrough。

    PM 裁决:采最小修法(issue 中的方案 a)——在 RecordDetailView.modalActionHandler 镜像 objectstack#3959 的行为与错误文案:不可解析的 type:'modal' 目标报 authoring error,删除死路 serverActionHandler(action) 回退;docblock 里「same rule as the shared console runtime」那句随之重新为真。补 useConsoleActionRuntime.test.tsx 那条 "reports an unresolvable target instead of POSTing to /actions" 的 RecordDetailView 侧对应测试。

    方案 b(把 modal 分派上提进共享包装)仅当净改动 ≤30 行且不新增公共表面时允许替代,须在 PR 里写明取舍;否则不做,防止在刚合并的 #2904 表面上引入二次扰动。

    Scope fence:RecordDetailView.tsx + 其测试文件。注意与 #3321(popup 文案 i18n,已预裁、排队在本单合并后)在同一文件邻域——不要顺手改文案,那是它的地盘。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions