Skip to content

fix(companies): a person with no name shows as blank in look text #583

Closed

Description

@allisonmahmood

Found while testing #569 (PR #582) in the dev loop. Dev personas created through /dev/sign-in have an empty name, and a person who signs up in production without one would behave the same.

What happens. patchy look prints By on 2026-10-07: … and Only an admin changes it: ., and a member's refusal reads Only an admin can change Acme Co's look. Ask . The admins and author fields on the wire carry name: "".

Where the fix belongs. In Users, not in the look code: wherever a person's display name is read for output, fall back to the email's local part (or the email) when the name is empty, so every surface that names people (look text, the member directory, patch owners) agrees.

Filed by Claude Fable 5.1 (orchestrator) in Claude Code, running in T3 Code, for Allison.

Activity

  1. added
    needs-triage
    area:cli
    on Oct 7, 2026
  2. allisonmahmood commented on Oct 10, 2026

    @allisonmahmood
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: A user's stored name is never blank: someone without one is named by their email's local part.

    Current behavior:
    Clerk's name session claim is the account's full name, which is null for email-only accounts; session decoding deliberately turns that into "". Company creation, invitation acceptance and the per-request claim refresh (Users.refreshClaims) store it as users.name verbatim, and the dev loop's sign-in-as-any-email path does the same. Every surface that names a person then shows a blank, because most read users.name through direct joins rather than through Users: patchy look prints By on … and Only an admin changes it: ., a member's look refusal reads Ask ., whoami prints User: (email), the app header shows · Acme Co, patch owners and actors are blank on cards, off-address notices and not_owner hints, the member directory returns name: "" (sorted first), and Join suggests the company name 's company.

    Desired behavior:

    • users.name is never blank. A name is blank when it is empty after JavaScript trim(). A blank name is stored as the local part of the (lowercased) email, or the whole email if the local part is empty. A non-blank name is stored exactly as given.
    • When a real name later arrives, it replaces the fallback on the person's next signed-in browser request; clearing it brings the fallback back; an email change while nameless moves the fallback with it. Unchanged claims still write nothing and wake no directory subscriptions.
    • Existing blank names, for active and deactivated users, are backfilled with the same rule.
    • Join's suggested company name for a nameless person uses the same rule.
    • No wire shape changes anywhere; the member directory stays { id, name, email, admin, active }.

    Key interfaces:

    • One display-name rule owned by Companies beside Users, taking { name, email } and returning the name to store.
    • Applied wherever claims become or update a user row: company creation and invitation acceptance (they share one user insert), and Users.refreshClaims before its change check.
    • A new Companies migration (the next free id in landing order) that rewrites blank names with the same rule; its notion of blank must at least cover empty and whitespace-only names. Let the directory-revision trigger fire as it does for any rename.
    • Join's default company name, which is computed before any user row exists.

    Acceptance criteria:

    • Creating a company with an empty or whitespace-only name stores the email's local part; so does accepting an invitation (tested separately).
    • An email whose local part is empty falls back to the whole email.
    • refreshClaims with a blank name stores the local part, and repeating it (including with different whitespace or different email case) performs no update; a later real name replaces it; clearing a real name restores the fallback; an email change while nameless updates the fallback.
    • The migration rewrites blank names for active and deactivated users and leaves named users byte-for-byte unchanged.
    • Join suggests <local part>'s company to a nameless person.
    • Dev loop: in pnpm dev up team, Ada invites a fresh email as an admin from /company; that email signs in through /dev/sign-in and accepts on /join. pnpm patchy look (the environment CLI, as Ada) then lists the new admin by their local part in Only an admin changes it: …, and pnpm dev shot <email> /company shows the local part in the header and the user list.
    • The Companies glossary's User entry and the patchy-members project skill say a user's name is never blank and falls back to the email's local part.

    Out of scope:

    • Fallbacks at read time, in TypeScript or SQL.
    • A database constraint on users.name.
    • Changing session-claim decoding, which keeps the provider's raw name.
    • Requiring a name at Clerk sign-up, or letting people edit their name in Patchy.
    • Two-phase rollout: a name an old host re-blanks during a rolling deploy heals on that person's next browser request.
    • Already-generated patchy/_generated files; they refresh on the next patchy dev or patchy refresh.
  3. added
    bug
    ready-for-agent
    area:server
    area:docs
    and removed
    needs-triage
    area:cli
    on Oct 10, 2026
  4. added a commit that references this issue on Oct 15, 2026
    22b8814
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

    area:docsarea:serverbugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions