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-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jul 22, 2026
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 22, 2026 2:14pm

Request Review

@os-zhuang
os-zhuang merged commit f8c9594 into main Jul 22, 2026
17 of 18 checks passed
@os-zhuang
os-zhuang deleted the fix/showcase-phone-demo-user branch July 22, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR 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