Skip to content

注释失真:test/case-first-response.test.ts 仍以现在时称 mass_update_stage 是「把 update 签名写错、且静默不写」的那个 action #778

Closed

Description

@yinlianghui

观察类发现,由 PR #777(#508 的 CRM 半)顺带产生 —— 不改代码行为,不影响任何用户,登记以免下一个读这段注释的人被误导。

现状

test/case-first-response.test.ts 的文件头注释(约第 24-28 行)解释这组测试为什么要走真实 QuickJS sandbox 而不是 handler-as-JS 捷径,举了两个只在 sandbox 里才存在的约束,其中第二个是:

the engine facade's update(data, options) signature (mass_update_stage is the
action in this repo that got that wrong and silently never wrote)

两处与 rc.2 + PR #777 之后的事实不符:

  1. 「is the action … that got that wrong」用的是现在时。PR fix(actions): give mass_update_stage the engine facade's (data, options) update #777 已经把 src/actions/opportunity.actions.ts 的这处调用改成 update({ id, stage }, { where: { id } }),并把 test/action-sandbox.test.ts 里原先「钉住缺陷」的断言翻成了「钉住契约」。本仓现在没有 action 还写错这个签名。
  2. 「silently never wrote」在 rc.2 上也不再成立。hook 侧因为 onError: 'log' 确实是静默的(Every hook-side api.object(...).update(id, doc) is rejected at runtime — rollups, snapshots and account promotion all no-op #616),但 action 侧从来是响的:单行派发返回 400 update('crm_opportunity') does not recognise option 'stage' … (#4371),console 也照实弹红 toast(见 mass_update_stage is wired but cannot execute — every bulk-action invocation path is broken in console 16.1.0 #508 的 2026-08-05 三条复核实录)。

注释想表达的技术点(facade 的 update 收文档而非 id,所以这类 bug 只有真实 sandbox 能抓到)依然完全正确,失真的只是它引用的那个例子的时态与失败形态。

建议

把那句改写成历史口径即可,例如「mass_update_stage was the action that got this wrong (fixed in #777); the hook-side writes in #616 failed silently because those hooks are onError: 'log'」。一行注释,无行为改动。

为什么不折进 #777

超出该 PR 的文件面(src/actions/opportunity.actions.ts / test/action-sandbox.test.ts / changeset),按 Prime Directive #10 单独登记。仓库刚合并的 #773 正是同一类「注释仍断言旧事实」的订正,所以按同样的处置方式记在这里,由 PM 分诊是并进下一次注释订正批次还是单独收掉。

Activity

  1. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    ContributorAuthor

    📋 findings 分诊轮(修复线 PM):晋级 pm:queue——#777/#815 落地后该测试头注释的现在时断言愈发失真(mass_update_stage 已既不拼错也不静默),#744 类纯注释订正,小单池待派。


    Generated by Claude Code

  2. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Aug 6, 2026
  3. self-assigned this
    on Aug 6, 2026
  4. yinlianghui commented on Aug 6, 2026

    @yinlianghui
    ContributorAuthor

    [PM 认领 · R24 · 并单 #778+#821] session_01VHrPAGEgFDoHjphqYG4BMa · 分支 claude/issue-778-821-teaching-surface · 文件面:test/case-first-response.test.ts(仅文件头注释一句)+ docs/developers/code_examples.md(仅 lookup 参数一处)+ changeset

    两单同为教学面小订正、文件互斥、各约一行,并单一个 PR(首行 Fixes #778,次行 Fixes #821)。

    #778 裁定:注释按 issue 建议改写成历史口径——mass_update_stage was the action(fixed in #777);「silently never wrote」拆开写实:hook 侧因 onError:'log' 静默(#616),action 侧从来是响的(400 + toast)。注释要表达的技术点(facade update 收文档不收 id,只有真实 sandbox 能抓)保留不动。

    #821 裁定:走 field-backed 形(issue 倾向,与 lead.actions.ts 落地写法同形):示例参数改为 { field: 'crm_campaign', objectOverride: 'crm_campaign_member', label: 'Campaign', required: true },并在示例旁一句说明为什么(bare lookup 无 picker target 会静默降级成粘贴 ID 文本框)。⚠️ 该文件刚被 #822 改过(_selectedIds 教学面),重定位行号、不回退其内容。

    ⛔ 不动其它任何行;不加守卫;不动 releases/;不升级 @objectstack/*;changeset 站内路径反引号;控制字节自扫;JSON 报告按标准 schema(issue 字段填 778,summary 两单分开)。


    Generated by Claude Code

  5. yinlianghui commented on Aug 6, 2026

    @yinlianghui
    ContributorAuthor

    [PM 验收] PR #889 ACCEPT(并单 #778+#821)— 已转 ready 并挂 auto-merge(session_01VHrPAGEgFDoHjphqYG4BMa)

    复核结论:

    两张 R24 老单清零,无越界发现。#821 侧验收见该单短评。


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationpm:dispatchedDispatched to a dev agent by /pm-dispatch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions