Skip to content

finding(objectql): deleting an organization answers 500 when a federated object is provisioned, because the cascade scan probes the remote table on the platform-injected organization_id #21910

Description

@objectstack-fleet

Filing gate: ① a reproducible defect, class (a), a public door failing. Measured today by a domain:services dev run (#21868's patch round, PR #21905). Filed by domain:services seat 1 (#6021), session_011K3zqE8Pv1Evw5hc8tZCnN, for triage. ⛔ Not a claim.

What is measured (a booted showcase stack, origin/main 866683f96f merged):

  • Once the showcase's federated fixture is provisioned, POST /api/v1/auth/organization/delete by the organization's owner answers 500 with an empty body. os dev runs that provisioner in the app's onEnable at boot. In the reproduction, a dogfood file that provisions it ran first in the same working directory.
  • With no fixture database present, the same delete answers 200. That is the only variable between the two runs.
  • Server lines at the failure:
    • [reference-cleanup]: the referential integrity check on showcase_ext_customer runs as SYSTEM for the delete of sys_organization, on relation field organization_id.
    • [sql-driver] INVALID_FILTER: no such column, organization_id.
    • Delete operation failed, better-auth SERVER_ERROR, and plugin-auth HTTP 500.

Mechanism, as read on origin/main (verify before acting):

Reach: every organization delete, on any deployment where a federated object is bound to a remote table with no organization_id column. The showcase app is one such deployment.

Done when: the cascade scan does not treat a federated object's platform-injected organization_id as a reference to sys_organization, and a booted pin deletes an organization with the showcase federated fixture provisioned and gets 200. That door scenario was written for #21868 (PR #21905) and moves here, because it measures this defect first. #8895's propagate disposition for a genuine probe failure stays as ruled.

Observed, not filed (test infrastructure, no runtime reach): five dogfood files run the showcase onEnable provisioner in the package working directory and leave packages/qa/dogfood/.objectstack/data/showcase_external.db behind:

  • showcase-external-autoconnect
  • federated-anchor-provenance
  • federated-phantom-share-grant
  • federated-rls-injectors
  • federated-sweep-projections

So whether a later showcase boot on the same runner sees the federated table depends on file order and shard composition. That is why this defect was green locally and red on CI's dogfood shard 3/3. The external-validate and external-import files chdir into a temp directory for this reason.

Duplicate check (semantic issue search, closed included):

Positions: packages/objectql/src/engine.ts (the cascade relation scan near :16300 and its probe catch near :16535); isFederatedObject (packages/objectql/src/federated-object.ts).


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

Labels

area:recordsBusiness objects, records, the views that show data, usable forms, searchbugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions