Repository navigation
feat(registrations): a tidier Registrations tab, and one registration per person - #1092
Conversation
…pty one A filter with no rows is left out, unless the URL already chose it, and the whole filter row is left out when Accepted is all that remains — the tab's own pill already carries that count. The CSV button reads "Download (CSV)" and shows under Accepted alone, since the file holds the accepted rows only. An event with no registrations at all replaces the tab with a notice that points the manager at the listing: the open items of its Recommendations panel and a link to review them, or why the listing is not checked, or that it already follows every recommendation. The report is the virtual `qualityReport` read off the draft with no `select`, and only on that branch, because it costs a full document read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d row A client registration from an address that already holds a registration for the same event now updates that row: the registrant's name, session and answers, back to `pending` with no screening verdict, so the new answers are screened and a fresh confirmation goes out. The row keeps its `id`, `createdAt`, activity log and `uuid` — the last keys the calendar entry, so the re-sent confirmation moves it rather than adding one. `mergeRepeatRegistration` runs first in `afterChange`. The create runs to completion so every public-write refusal still applies, then is folded into the existing row and deleted inside the same transaction; the response and every later hook see the surviving row. Spam-flagged and rejected rows are never merged into, and a manager's own write or an import is left alone. `gateRegistration` no longer refuses `event_full` to a registrant updating the seat they already hold. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-1092 environment in sahajcloud
1 service not affected by this PR
|
|
@sydevs-bot review |
… hook `lifecycle/repeatRegistration.ts` held one query for two callers in the same folder, so it moves into `mergeRepeatRegistration.ts`, which owns the rule, and the gate imports it from there. The hook takes the registrant's values from the create's own `data` rather than re-reading the row it just wrote, and drops the `subject`, which cannot change for the same event. The gate waives `event_full` outright for a sender updating a seat they hold, instead of re-running the whole gate with one seat fewer: it is the gate's last check, and an update never adds a seat. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The repeat-registration half is right, and its ⚠ comments earn their place: Payload cannot turn a create into an update, so folding inside its transaction is the only shape available. Unsettled: the merge is keyed on an address nobody verified, which turns a forged signup from a nuisance into an overwrite of someone else's registration. That exposure is new, and the body does not name it.
The tab half is three changes under one title. The filter and CSV tidy-up is plainly in scope. The empty-state recommendations listing is a feature of its own, and the most machinery here for the least stated need.
No contract moved, and admin-ui.md and COVERAGE.md both follow.
Findings
- blocker — a stranger can overwrite a registration, keyed on an unverified email ·
mergeRepeatRegistration.ts:56 - should-fix — a newer
failedrow withholds the full-event relief from an active registrant ·gateRegistration.ts:101 - consider — seven new pieces for a notice the Edit tab already serves ·
data.ts:253
What was checked
Read whole on the branch: the two new files, gateRegistration, data.ts, EventRegistrationsView, lifecycle/review, fields.ts, and the siblings the merge runs ahead of — guardStatusTransition, queueScreening, syncFullness, spawnSubscribeFromRegistration.
Clean: reviewMove returns none on a client req, so the nested accepted→pending write passes the status guard; queueScreening names the surviving row; update-then-delete leaves fullness right inside the transaction; userField closes only create and update, so relationId(doc.user) resolves for a client. Ladder: lifecycle/ and CenteredNotice existed already, and buildPanelModel is reused, not re-derived. uuid keys only the ICS uid — #723 removed its access branch. Preview deployed, not opened.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
| // the client `select` requirement, which is meant for the client's own reads. | ||
| const trusted = asTrustedReq(req) | ||
|
|
||
| const existing = await findRepeatRegistration({ |
There was a problem hiding this comment.
The match is an unverified email, so a stranger holds the write. Anyone with a client key — the widget ships one to every host page — can POST a registration naming another person's address and overwrite their row: answers and session replaced, status back to pending, verdict cleared, a fresh confirmation mailed to them. No versions here and no old values in the log entry, so nothing restores them. Turnstile bounds volume, not a targeted overwrite. What bounds this?
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
| eventId, | ||
| sender: { email: data.senderEmail }, | ||
| }) | ||
| if (existing && isActiveRegistration(existing)) rejection = gate(registrationCount - 1) |
There was a problem hiding this comment.
findRepeatRegistration returns the newest row among accepted, pending and failed. A failed row newer than an accepted one fails isActiveRegistration, so the relief is withheld from a registrant who does hold a seat and a full event refuses them. The helper's own doc says legacy duplicates exist, so this is live data. Filter the lookup by activeRegistrationWhere (src/lib/registrations/active.ts), or sort actives first.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
| * ⚠ **No `select`.** The report is computed from the document it is read | ||
| * with, so a narrowed read would report every unselected field as missing. | ||
| */ | ||
| async function listingRecommendations( |
There was a problem hiding this comment.
Seven new pieces serve this one notice: ListingRecommendations, this function, editUrl, recommendations, NoRegistrationsYet, a .recommendations class, and a second unselected document read — reaching into EventQualityPanel/model and lib/eventQuality from an unrelated view. The Recommendations panel already says all of it one click away, and the notice already links there. Is the listing worth the pieces, or would the notice and its button do the job?
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
Merged at
Both fixes, and the threads below, are on
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Resolves the Registrations view onto FilterTabs and QueryPager, keeping #1092's hidden empty filters and accepted-only CSV; FilterTabs renders no tab row when it is given none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What changes
Registrations tab
Repeat registrations (
mergeRepeatRegistration)pendingwith its screening verdict cleared, so the new answers are screened and a fresh confirmation is sent.id,createdAt, activity log anduuid. Theuuidkeys the registrant's calendar entry, so the new confirmation moves it rather than adding a duplicate. An activity-log entry records the update.gateRegistration, thesubmissionDataallow-list). The new row is then folded into the existing one and deleted, in the same transaction. The hook runs first inafterChange, so the response and every later hook (opt-in spawn, fullness sync, screening queue) act on the surviving row. The response keeps the client-access shape; onlyid,uuidand the timestamps are swapped.accepted,pending,failed. Never intospamorrejected. A manager's own write and an import are left alone.gateRegistrationno longer refusesevent_fullto a registrant updating the seat they already hold.No contract change for the widget: it still gets
201 { doc: { id, uuid } }, now naming the existing row.Known follow-ups (not in this PR)
SahajAtlasWeb/src/config/query-client.tscomments that a re-sent registration is a duplicate signup — no longer true.Testing
check.sh): lint, format, typecheck ×2, unit lane — passed.user-submissions-repeat-registration.int.spec.ts(6 cases), plusatlas-manager(new empty-state case),user-submissions-registration-gate,registrations-fullness,user-submissions-create— all pass locally.🤖 Generated with Claude Code