Skip to content

finding(objectql): the #14970 pin's comment says task declares no organization_id, but the registry injects the column — the pin passes because the ROW is empty, not because the object is unscoped #15688

Description

@zhuangjianguo

Filed unassigned from the domain:engine execution seat while landing #15225 (PR #15687). Observation class — a test comment that mis-describes why its pin passes; no runtime defect, no assertion is wrong.

What the comment says

packages/objectql/src/engine-data-events.test.ts, block #14970 — a published DataEvent names the RECORD's organization, pin an object that is not tenant-scoped OMITS the key on all three actions:

task declares no organization_id, so resolveTenantFieldName finds no column and nothing is published — rather than the caller's org being used as a stand-in

What is measured

Registering an object through engine.registry.registerObject INJECTS the kernel organization_id column (registry.ts, TENANT_SCOPE_FIELD_DEF, guarded only by the injection plan's tenant flag — i.e. unless the object declares tenancy: { enabled: false }). So on the registered task, resolveTenantFieldName answers organization_id, not null. The pin still passes — correctly — because eventOrganizationId reads the ROW's column and the row carries no organization. The sentence attributes the omission to the wrong cause.

Measured while writing #15225's bulk pins: a predicate write on the registered task under an isolated wall had the batch key stamped, precisely because the object IS tenant-scoped once registered; the security plugin walls on the same injected field set (getObjectFieldNamesobjectHasOrgIdField). #15225's block therefore pins the genuinely unscoped case on a tenancy: { enabled: false } object and asserts the column was withheld before asserting omission.

Why it matters

The next author who copies this pin's reasoning builds a "not tenant-scoped" fixture out of an object that is walled — the mistake #15225 made once before measuring. The fix is a comment reword (the row carries no organization; the column exists) or switching the fixture to the declared opt-out with the measured assertion, as the sibling block now does.

Refs: #14970 (the block), #15225 / PR #15687 (where the divergence was measured). #14970 is not reopened by this; nothing here is a closing keyword.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions