Skip to content

Console field designer still offers an "Indexed" toggle for a key FieldSchema rejects by name #1122

Description

@yinlianghui

Found while measuring the Field indexing claim on reference/performance-and-limits.mdx (#1119, PR #1121). Filed unassigned as an observation — nothing in HotCRM hits it today, because this repo authors every field in src/objects/*.object.ts and never through the designer.

The measurement

@objectstack/console 17.0.0-rc.6 renders a field-designer toggle labelled Indexed (designer.field.indexed, translated in the shipped locale bundles) whose commit handler writes { indexed: value || undefined } onto the field:

(0,Y.jsx)(q,{label:s(`designer.field.indexed`),value:!!g.indexed,
  onCommit:e=>b({indexed:e||void 0}),disabled:a})

FieldSchema in @objectstack/spec 17 rejects that key by name:

FieldSchema.safeParse({ name:'foo', label:'Foo', type:'text', indexed:true })
→ unrecognized_keys: "Unrecognized key(s) on this field: `indexed`.
     • never a FieldSchema key; a field-level index flag built no index (#2377).
       Declare the index in the object's `indexes[]`. Until #4001 closed this shape
       these were dropped silently — the field was still created, minus whatever the
       key was meant to constrain, protect or compute."

So the designer offers a control whose value cannot survive a parse. FieldSchema has no index / indexed key at all; the real surface is the object-level indexes: [{ name, fields, unique }] block, materialised by SqlDriver.syncDeclaredIndexes.

Why it is worth recording

This is the #2377 / #4001 family seen from the other side. The spec closed the silent-drop hole and now refuses the key loudly — but the UI that produces it was not retired with it, so an admin who ticks Indexed in Studio either gets a save rejected for a key they did not know was retired, or (if some path still strips unknown keys before parsing) a toggle that stays ticked and builds no index. Either way the control promises an index nobody creates, which is exactly what #2377 removed the field-level flag for.

Where it lives

Platform-side, in @objectstack/console — not something HotCRM can fix in src/. Recording it here because HotCRM is where it was measured and HotCRM admins are who would meet it; it wants forwarding to the platform repo rather than a change in this one.

Refs #1119 · PR #1121 · #2377 · #4001 · #5248 (the sibling removals of indexes[].type / indexes[].partial)


Generated by Claude Code

Activity

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

    findingupstream:objectstackBlocked on / caused by the ObjectStack platform — tracked upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions