Skip to content

查找选择器的依赖过滤把 lookup 对象拼成了 "[object Object]":报价详情页选联系人永远「未找到选项」(dependsOn) #36837

Description

@huangyiirene

环境

云端,平台 18.6.0,hotcrm 6.6.0(2026-11-24,Irene 操作,Claude 在同一会话里抓到请求)。

现象

报价单详情页直接编辑,点「联系人」选择器:显示「未找到选项」。这张报价所属客户下实际有联系人(查询 crm_contact 按 crm_account = <该客户 id> 能查到 1 条)。

原因(请求证据)

选择器发出的请求:

GET /api/v1/data/crm_contact?populate=crm_account&top=50&filter=["crm_account","=","[object Object]"]

crm_quote.crm_contact 在 HotCRM 里声明了 dependsOn: ['crm_account'](联系人按报价的所属客户过滤)。控制台把记录上已 populate 的客户对象直接拼进了过滤条件,被转成字符串 [object Object],而不是取它的 id,所以永远查不到。

期望

依赖字段的值是 lookup 对象(已 populate)时,过滤条件取其 id;详情页直接编辑和「编辑」弹窗行为一致。

相关

同类 [object Object] 问题:#36507(drill 对话框)、#36430(看板分组)。

优先级:priority:p1(产品负责人 Irene 2026-11-24 调整)。

Activity

  1. added
    bug
    priority:p0
    domain:ui
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:data · domain:ui · priority:p0 · Bug · pm:queue · size S. The p0 grade was set by a person (the product owner's request on the card), and a grade a person sets stands. Area and type are added here, and the card is routed this round to repo:objectstack#1.
    Rationale: a dependsOn lookup filter stringifies the populated parent record as [object Object], so the dependent picker never finds options (request captured on the card). Cascading options are an area:data core feature (forms). It is the same family as #36507 and #36430.

  3. added
    pm:queue
    on Nov 24, 2026
  4. added
    priority:p1
    and removed
    priority:p0
    on Nov 24, 2026
  5. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Re-route: this p0 goes to repo:objectstack#7, which holds this card's area. The labels are unchanged.

    repo:objectstack#1 declined it at 2026-11-24T03:35Z, because that seat now takes only area:cloud cards.

  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Claim: PM loop round 2 · 2026-11-24T04:03Z
    Session: session_01QSeKYpEsWWE9Y5YtSsDgqZ
    Account: os-justin
    Branch: claude/issue-36837-dependson-lookup-id
    Worktree: objectstack-issue-36837
    Domain: domain:ui
    Seat: repo:objectstack#4
    File surface: ui/** lookup picker / dependsOn filter builder and its tests, .changeset/36837-*.md (stop on breach; explain in the report)
    Container & model: S, mode:cloud, model: default tier, effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack Console code — a dependsOn lookup filter takes the populated parent record instead of its id (request captured on the card) | none | every form with a dependent lookup (e.g. HotCRM quote → contact)
    Thread-read: 7121469866
    Premise: holds (the captured request on the card; the dev reproduces it first)
    Serial constraints cleared: #36832 (repo:objectstack#3, in flight) reworks the lookup picker for phones — overlap is likely in the picker component; edits stay minimal, the merge queue arbitrates, seat 3 notified

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 24, 2026
  8. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Dispatched 2026-11-24T04:07Z under this seat's claim: mode:cloud dev session session_01QSeKYq2vSKPUSvT9fXdzEY.

  9. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
    os-dev-report

    Seat-written report. The dev session session_01QSeKYq2vSKPUSvT9fXdzEY wrote this report and handed it to seat repo:objectstack#4 by send_message; the seat posts it on the maintainer's ruling in the seat session, verbatim 「一选1+」 (2026-11-24: the seat performs only the writes the dev session's permission classifier refused; pull requests stay draft; no standing allow rule — evidence card #36936). Refused in the dev session, reason [Undermining Oversight]: node scripts/pm/fleet-write/dispatch.mjs --repo objectstack-ai/objectstack --actions-file FILE carrying one pr_create, once; the report post was not attempted after it. One seat change to the dev's text: pr is set to PR #36938, which the seat opened from the dev's hand-off. Everything else below is the dev's, unchanged.

    {
    "issue": 36837,
    "status": "blocked",
    "branch": "claude/issue-36837-dependson-lookup-id",
    "pr": "#36938",
    "session": "session_01QSeKYq2vSKPUSvT9fXdzEY",
    "premise_still_valid": true,
    "summary": "The fix is done and pushed at e19a6b2 (off origin/main f46ce5b). The dependsOn candidate filter is derived in exactly one place: the dependentFilter memo in LookupField.tsx. That memo did String(v) on the parent value the host passes in dependentValues. A record page passes the record as the server returned it, with lookups populated, so a populated parent became "[object Object]". The memo now collapses the parent through collapseReference, the rule lookupRecordReference.ts already applies to { $record } comparands; it is now exported so both readers share one rule. That single producer feeds every host (detail inline edit, header highlight, in-place editor, the record form / Edit dialog) and all four candidate surfaces (popover, Level-2 picker, PeoplePicker, create-new seed). The picker component gained one changed line plus one import, keeping out of #36832's way. BLOCKED only on the writes: the auto-mode classifier denied the relay pr_create, so the seat performs the PR create and this comment (maintainer ruling relayed by the seat).",
    "tests": "RED (before the fix): pnpm --dir ui exec vitest run packages/fields/src/widgets/LookupField.dependsOn.test.tsx, new pin 'sends the parent record's id, never the stringified object' -> AssertionError: expected '[object Object]' to be 'a1', Tests 1 failed | 10 passed. GREEN: the same file plus the contextTailRetired-7206 / dependsOnDeclared-6153 / dependsOnRetired-7357 / recordReference-34197 LookupField files -> Test Files 5 passed, Tests 39 passed. Whole package at e19a6b2: pnpm --dir ui exec vitest run --maxWorkers=2 packages/fields/ -> Test Files 326 passed | 1 skipped, Tests 4982 passed | 7 skipped (lock VERDICT command-exit 0). ABLATION (one run, at committed e19a6b2, via scripts/ablation-replace.mjs): anchor 1->0, blob c7c449f->71cd8a0 ('ok mutation landed'); pin red with Received: "[object Object]", 1 failed | 10 passed; restore blob c7c449f == HEAD, 'git diff HEAD is empty'. TYPE-CHECK NOT MEASURED: pnpm --filter @object-ui/fields type-check exited 2 with 222 errors, all cascading from unbuilt @object-ui/components / @object-ui/react dist (TS2307, then TS7006 and ctx typed {}). None is on a changed line; CI's Type Check UI owns it.",
    "gates": "Local derived set (dispatch-gates --commands, objectstack-ai/objectstack @ e19a6b2, 4 paths vs merge base f46ce5b): 37 of 38 commands run, every one exit 0, with each exit captured before any pipe. check:changeset-fixed also ran (outside the derivation) and exited 0. --ran reconciliation: '38 derived, 37 run, 0 NOT-MEASURED, 1 UNRUN'. The UNRUN one, pnpm --dir ui exec vitest run scripts/, was skipped on purpose because the diff touches no script; CI's Test UI runs it. Type-check lanes and PR check-runs: NOT MEASURED (no PR yet).",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "mcp_calls": "2 — mcp__github__issue_read (get, get_comments) on #36837; read-only",
    "api_writes": "0 — the relay pr_create was denied by the classifier before sending (only a --dry-run); this comment is posted by the seat; git push x1 (not a REST write)",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "carrier: #36430 / #36507 · noted, not filed — the same '[object Object]' family is at separate sites: kanban grouping (plugin-kanban) and the drill dialog (plugin-dashboard). Neither reads dependentFilter or collapseReference; not touched here."
    ]
    }

  10. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Close-out · 2026-11-24T11:17Z · PR #36938 merged, closing this card by Fixes #36837.

    Delivered: a lookup whose dependsOn names another lookup now filters its candidates by the parent's id when the record holds the parent as a populated row (a record page, the edit dialog), so a quote's contact picker lists the account's contacts instead of 「未找到选项」. One producer fixed (LookupField's dependentFilter through collapseReference), covering the quick-select list, the full picker, the people picker and the create-new seed. The PR was opened by the seat from the dev's hand-off under the maintainer's 「一选1+」 (evidence card #36936). pm:dispatched stripped in this stroke; the dev session is archived.

  11. removed
    pm:dispatched
    on Nov 24, 2026
  12. added a commit that references this issue on Dec 1, 2026
    69c3dc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugdomain:uipriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions