Skip to content

fix(showcase): stop passing a non-existent org column when seeding the phone demo user - #3408

Merged
os-zhuang merged 1 commit into
mainfrom
fix/showcase-phone-demo-user
Jul 22, 2026
Merged

fix(showcase): stop passing a non-existent org column when seeding the phone demo user#3408
os-zhuang merged 1 commit into
mainfrom
fix/showcase-phone-demo-user

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

The bug

ensurePhoneDemoUser (from #3364) inserted sys_user with an organization_id key. sys_user has no such field — not in the object definition (25 fields, none org/tenant), and not physically (26 columns, no organization_id). Org membership lives on sys_member.

The key is not silently dropped on the way down — it reaches SQL as a real column:

ERROR Insert operation failed {"object":"sys_user", …
table sys_user has no column named organization_id}

Because the insert sits in a best-effort try/catch, this only ever showed up as a warn line plus an ERROR in the boot log. The consequence was invisible but total: the phone demo user was never provisioned on any boot, so #3358 §6 "Phone sign-in surfaces" (All Users list, record detail) had nothing to show.

The fix

  • Drop the organization_id key from the sys_user insert (and the now-unused param).
  • Drop the dead admin.organization_id read in run — the same missing field made it permanently undefined, so only the sys_member fallback ever ran. Resolve from sys_member directly, and fix the comment that claimed the column existed but was null.

Verified

On a wiped dev DB:

  • boot log: 1 ERROR → 0
  • sys_user now holds usr_showcase_phone_demo · Mei Phone (demo) · +8613800138000
  • approval fixtures unaffected: 2 pending requests + 3 admin positions (finance/legal/manager), all stamped with the org
  • tsc --noEmit

Follow-up to #3364. Found while collecting per-item evidence for #3358 §1. @objectstack/example-showcase is private → no changeset.

🤖 Generated with Claude Code

…e phone demo user
The approval demo's `ensurePhoneDemoUser` inserted `sys_user` with an
`organization_id` key. `sys_user` has no such field — not in the object
definition (25 fields, none org/tenant) and not physically (26 columns, no
`organization_id`); org membership lives on `sys_member`. The key is not
dropped on the way down: it reaches SQL as a real column and the insert dies
with `table sys_user has no column named organization_id`.
The insert is wrapped in a best-effort try/catch, so this surfaced only as a
warn line and an ERROR in the boot log — and the demo user was **never**
provisioned on any boot, leaving the phone surfaces (#3358 §6 "Phone sign-in
surfaces": All Users list, record detail) empty with nothing to look at.
Also drop the dead `admin.organization_id` read in `run`: the same missing
field made it permanently `undefined`, so only the `sys_member` fallback ever
ran. Resolve from `sys_member` directly and correct the comment, which claimed
the column existed but was null.
Verified on a wiped dev DB: boot log goes from 1 ERROR to 0, and
`sys_user` now holds `usr_showcase_phone_demo` / `Mei Phone (demo)` /
`+8613800138000`. Approval fixtures unaffected (2 pending requests + 3 admin
positions still stamped with the org). `tsc --noEmit` passes.
Follow-up to #3364; found while collecting evidence for #3358 §1.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuangos-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jul 22, 2026
@vercel

vercelBot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJul 22, 2026 2:14pm

Request Review

@os-zhuang
os-zhuang merged commit f8c9594 into mainJul 22, 2026
17 of 18 checks passed
@os-zhuang
os-zhuang deleted the fix/showcase-phone-demo-user branch July 22, 2026 14:17
baozhoutao pushed a commit that referenced this pull request Aug 7, 2026
platform-core: /ready probe, authored-nav-vs-served diff, new
seed-integrity item (authored row baselines, verbatim value spot-diff,
upsert idempotence — the #3408/#3415 silent-seed class as first-class
FAILs), metadata registry serving + draft→publish round-trip with deny
gates. approvals: per-group signoff now pins the exact seed wiring
(seed-approval-demo.ts distinct holders, run resume down the approve
edge, actor derived from session #3800), quorum keeps its fixture
blocker plus a runnable clamp-contrast clause.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YD9f6FYyMraUWYeJf53V43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang