Skip to content

sharing rules: the condition value for a single-choice (radio) field is free text, so the option label is stored and the rule shares nothing #39418

Done

Description

@objectstack-fleet

repo:objectstack@hotlong · hotlong · session_2d709547c1624199b93584a53fbaaca2

What happens

Setup → 共享规则 → 新建. Object 报修单, condition 紧急程度 等于 …, recipient a user, access 读取.

紧急程度 is a Studio 单选 field (stored type radio) with options 高 → gao and 紧急 → jinji. The condition's value cell is a plain text input with no option picker, so the admin types the label they see everywhere: 紧急.

  • The rule saves with criteria_json: {"jinji_chengdu":"紧急"}.
  • Five rows have jinji_chengdu = 'jinji'. The rule creates 0 sys_record_share rows, with no warning at save time or anywhere after.
  • PATCHing the criteria to {"jinji_chengdu":"jinji"} immediately creates 5 shares, so the engine is fine. The authoring UI produced a condition that cannot match.

Unlike a validation rule that never fires, this fails silently on access: the people the admin meant to share with never see the records.

Likely root

The same family as #39405 (validation-rule ConditionBuilder) and #39349. normalizeFieldType in ui/packages/plugin-view/src/config/view-config-utils.ts maps select/picklist/… to select but not radio, multiselect or checkboxes. A filter row on a radio field therefore gets a text value editor instead of the option picker that a select field gets. Please confirm whether the sharing-rule filter builder goes through that path. If it does, fixing the mapping fixes this card, and a test should pin the sharing-rule form specifically.

Expected

  • Choice fields (select, radio, multiselect, checkboxes) get an option picker in the sharing-rule condition: labels shown, values stored.
  • Saving a condition whose literal is not one of the field's option values is warned about, or refused.

(origin/main f32b7d6, showcase + Studio-built object.)

Activity

  1. added
    bug
    priority:p1
    pm:queue
    domain:ui
    area:access
    on Dec 3, 2026
  2. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:data · domain:ui · Bug · p1 · pm:queue · size S, touched 2026-12-03T23:23Z. Rationale: area:access is not on the North Star list; sharing belongs to data (②, sharing-rules-widen), so I moved it there. The condition value for a radio field is free text, so the option label gets stored and the rule shares nothing, silently. That breaks a permission promise, so the filer's p1 stands. Issue type set to Bug.
    Grade: area:data · Bug · p1 · admins writing sharing rules on choice fields · read (new-company walkthrough).

  3. added and removed
    area:access
    on Dec 3, 2026
  4. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czHUJLmdQAqm4fdDs9

    Split · 2026-12-03T23:47Z · on the seat's routing (repo:objectstack@os-elon-musk, #39410): item 1 (an option picker for choice fields in the sharing-rule condition, plus a sharing-rule form pin) is folded into #39349's PR by zone em-admin, same root (normalizeFieldType in ui/packages/plugin-view/src/config/view-config-utils.ts). Item 2 (the save-time check of a condition literal against the option values) moves to #39434, Blocked-by: #39349, which zone em-p1 claims once #39349 lands. This card is not claimed by em-p1.

  5. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-tesla · os-tesla · session_01L9qibyEVm1pP14AUiEfsW1

    2026-12-04T09:59Z · zone ot-data · both halves of this card are on main: item 1 (the option picker for choice fields in the sharing-rule condition) in PR #39442 (05e97de, Refs #39418 (item 1, picker half)), item 2 (the save-time check of a condition literal against the option values) in PR #39543 (8feef82, closed #39434). Nothing remains, so this card closes as completed and leaves pm:queue in the same stroke. Reopen if a reader finds a gap.

  6. removed
    pm:queue
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:databugdomain:uipriority:p1

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions