Skip to content

Keep each sign-up's own name when one email signs up under several - #1092

Open
richshaw wants to merge 1 commit into
mainfrom
claude/issue-847-name-per-signup
Open

richshaw wants to merge 1 commit into
mainfrom
claude/issue-847-name-per-signup

Conversation

@richshaw

Copy link
Copy Markdown
Owner

Fixes #847.

The problem

A participant is one row per signup and email, with one name. When someone signed up for a second slot with the same email and a different name (a parent signing up two children), commitParticipantToSlot overwrote that name. After that, every earlier sign-up showed the new name: on the Responses tab, in the CSV, on its edit page, and in its reminder and moved-slot emails. The first name wasn't stored anywhere.

The fix

  • Migration 0016_commitment_name adds a nullable commitments.name. There's no backfill.
  • commitParticipantToSlot writes the name typed for each sign-up in the insert it already does, so the sign-up request sends no extra statement. On a move, the new commitment takes the name the move sends. If the move sends none, it keeps the old commitment's name (keptName, read in the cancel's RETURNING).
  • An edit link's name change sets that commitment's name. participants.name is still updated to the latest name typed, as before.
  • Reads go through one expression, commitmentName (src/lib/commitment-name.ts), which is coalesce(commitments.name, participants.name). It's used by listCommitmentsForSignup (the Responses tab and the CSV), getOwnCommitment (the edit page) and loadCommitmentRow (the confirmation, reminder and slot-change emails). Sign-ups made before this change have no name of their own, so they show what they show today.
  • name stays off the public commitment fields. Participants already get the name as participantName, so the API's shape doesn't change.
  • Privacy page: "Display name" now says the name is kept with each slot. "Last updated" is now 21 November 2026.
  • CHANGELOG has an entry under Fixed.

Decision the issue didn't cover: drizzle-kit generate also wanted to drop the nine columns taken out of the schema in #1003, #1013 and #1085. Those drops are meant to wait for a later release. To leave them out, I put those columns back in the schema for the generate step only, then removed them again. The new migration is a single ADD COLUMN. Its snapshot is the 0015 snapshot plus commitments.name, so the later drop migration will still pick up those columns.

The issue's outline also named an MCP read of commitments. No MCP tool reads commitments today, so there was nothing to change there.

Tests

  • commitments.db.test.ts has a new group, "one email signing up under two names". In it, Alex signs up for slot A and Sam for slot B with one email. The tests check:
    • listCommitmentsForSignup, responsesCsv and getOwnCommitment each show the right name on each row.
    • Changing the name through one edit link renames only that sign-up.
    • A move with no new name keeps the old name, and a move with a new name takes it.
  • reminders.db.test.ts: the reminder for the first slot greets the first name. Without the fix this test fails (checked).
  • The existing tests "keeps the name of someone refused for signing up twice" and "renames the participant when a move also changes the name" pass unchanged.
  • public-commitment.test.ts lists name as a server-only column.
  • Run and passed: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test (3776 passed), and pnpm test:db (905 passed, query budget included).

Session: https://claude.ai/code/session_016YZ9SW4BpjDT3i5gNqu4jM


Generated by Claude Code

A second sign-up with the same email and a different name renamed the
participant, so every earlier sign-up showed the new name on the
Responses tab, in the CSV, on its edit page and in its reminder and
moved-slot emails. Commitments now keep the name typed for them
(migration 0016 adds a nullable commitments.name), and every place
that shows a sign-up's name reads it, falling back to the participant's
name on sign-ups made before the column existed. A move keeps the old
commitment's name unless it sends a new one, and an edit link's name
change renames only that sign-up.

Fixes #847.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SW4BpjDT3i5gNqu4jM
@richshaw richshaw added pipeline:ux Changes what a person using OpenSignup sees or does pipeline:working A session is working on it right now labels Nov 21, 2026 — with Claude
@richshaw
richshaw requested a balanced review from Copilot November 21, 2026 05:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@richshaw richshaw added pipeline:tophat pipeline:working A session is working on it right now and removed pipeline:working A session is working on it right now labels Nov 21, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

Ran 2efe578 locally with pnpm dev and the worker, Postgres 16, Chromium at 1280×900 and 390×844, with made-up data only. Each test signup had two dated slots, "Fruit and water" (today) and "Orange slices" (next week). One email, pat.parent@example.com, signed up as Alex Example for the first slot and Sam Example for the second. I ran the same steps on the base, fe9257d, first.

Check Result What I saw
Before (base fe9257d): Responses tab, CSV, Alex's edit link ✅ reproduced Both rows read "Sam Example" on the Responses tab and in the CSV. Alex's edit page says "You're editing this as Sam Example" (1092-before-responses, 1092-before-edit-alex)
After: both sign-ups through the public page, on a phone ✅ The second dialog pre-fills "Alex Example" from the returning-participant cookie. I typed "Sam Example" and confirmed. Responses and the CSV now show Alex on Fruit and water and Sam on Orange slices (1092-after-responses, 1092-after-phone-responses)
After: edit links ✅ Alex's link says "editing this as Alex Example", with Alex in the name box. Sam's link shows Sam (1092-after-phone-edit-alex)
After: rename through Sam's edit link to "Sam R. Example" ✅ Only Sam's sign-up changed. Alex's still reads Alex. participants.name became the latest name typed, as the PR says (1092-after-phone-renamed-sam)
After: move through the edit-link API ✅ A move with no name kept "Alex Example" on the new commitment. A move that sent "Alexis Example" took it. Moving onto Sam's slot was refused with the existing conflict ("you already committed to this slot"), as before. The PATCH response has no name field (1092-after-responses-moved)
After: reminder email (worker, pnpm reminders:due --dispatch, with sign-up times moved back 2h in SQL so the reminder was due) ✅ The reminder for Alex's slot opens "Hi Alex Example". The moved-slot email reads names through the same loadCommitmentRow, so I didn't wait out its 10-minute settle
After: sign-ups made on the base (no name of their own) ✅ Still show "Sam Example" on both rows, in the CSV, and in that signup's reminder, the same as today. That's the expected fallback
After: privacy page ✅ "Display name, kept with each slot you sign up for, so several people signed up with one email address each keep their own." "Last updated: 21 November 2026" (1092-after-privacy)
vitest -c vitest.db.config.ts on commitments.db.test.ts and reminders.db.test.ts ✅ 163 passed
Browser console, server and worker logs ✅ No console errors and no server errors. Only Node's MaxListenersExceededWarning from the dev logger, which main prints too

For the owner (UX): when one email signs up more than once under different names (a parent signing up two children), each sign-up now keeps the name typed for it. Before, the latest name overwrote all of them. This shows on the Responses tab, in the CSV, on each edit link's page, and in that sign-up's confirmation, reminder and moved-slot emails. Renaming through one edit link renames only that sign-up. Sign-ups made before this change still show the email's latest name. The privacy page's "Display name" line now says the name is kept with each slot. Compare 1092-before-responses with 1092-after-responses, and 1092-before-edit-alex with 1092-after-phone-edit-alex.

Screenshots are in https://claude.ai/code/session_016YZ9SV5XQwymu5dEGyVa11.


Generated by Claude Code

@richshaw richshaw added pipeline:review pipeline:working A session is working on it right now and removed pipeline:tophat pipeline:working A session is working on it right now labels Nov 21, 2026 — with Claude

@richshaw richshaw left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: passed (round 1)

This PR adds a nullable commitments.name. commitParticipantToSlot writes it in the commitment insert it already does, so the sign-up request sends no extra statement. A move keeps the old commitment's name (read in the cancel's RETURNING) unless it sends a new one, and an edit link's rename sets that commitment's name only. Every place that shows a sign-up's name now reads it through one expression, commitmentName (coalesce(commitments.name, participants.name)): the Responses tab and CSV, the edit page, and the confirmation, reminder and slot-change emails. I checked the claims one by one:

  • A grep for participants.name / participant.name finds no reader outside commitmentName.
  • No MCP tool reads commitments, so there's no MCP read to change.
  • The 0016 snapshot is the 0015 snapshot plus commitments.name and nothing else, so the columns waiting to be dropped stay in it.
  • The migration is a single ADD COLUMN, safe on a populated table and fine for the old build still serving during a deploy.
  • Every "Done when" item has a test. The reminder test greets the first name, and the existing "refused" and "move renames" tests pass unchanged.

Blocking (0): none.
Optional (1):

  • src/services/commitments.ts:863 checks data.name ? where the participant write just above uses !== undefined. With the name schema refusing an empty string, the two agree today.

Earlier threads: none. Copilot couldn't review this PR because the review quota had run out.
Checks: CI is green on 2efe578: lint-type-test, e2e and CodeQL. Locally I read the diff, compared the migration snapshots and grepped for the remaining name reads; I didn't need to run anything else. The tophat passed on this same SHA, with no runtime change since.

For the owner (UX): each sign-up now keeps the name typed for it, so a parent signing up two children with one email sees both names. Before, the latest name overwrote all of them. This shows on the Responses tab, in the CSV, on each edit page and in that sign-up's emails. The privacy page's "Display name" line changes too, and its "Last updated" date is bumped. Compare the tophat's 1092-before-responses with 1092-after-responses, and 1092-before-edit-alex with 1092-after-phone-edit-alex.

https://claude.ai/code/session_016YZ9STWK7w2mdP5AWU63DZ


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline:owner Passed; waits for the owner (UX or high-risk) pipeline:ux Changes what a person using OpenSignup sees or does

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signing up for a second slot with the same email and a new name renames the earlier sign-up too

3 participants