feat(luma): verify submissions against Luma guests via API (replaces CSV)#179
Merged
Conversation
Replace the CSV guest upload (hackathon programs) with a lazy, on-demand sync of an event's CHECKED-IN guests from the Luma public API into program_signups. The submission gate verifies the email against that synced set, lazily re-syncing on a cache-miss (25s floor) and distinguishing a transient Luma failure (503, retry) from a definitive not-checked-in (403). Single-flight + sanity guard (a 0-result/truncated sweep never overwrites a good cache). Manual single-email add remains as an event-day fallback. CSV path is untouched for non-hackathon programs. Server: luma.client.js, luma-sync.service.js, gate wiring, sync + manual endpoints, luma_event_id + sync-state columns. Client: LumaGuestsSection. Validated live against the Bitrefill event; 15 new tests.
…e-event dry runs Lets the gate accept approved registrants before an event starts (nobody is checked in yet) so the submit flow can be validated end-to-end. Default stays checked_in. Renames the client/sync seam to fetchEligibleGuests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…t reads as progress The submit POST triggers a server-side Luma sync on a cold cache (~3-4s for the first/just-checked-in submitter; instant once warm). Relabel the in-flight button to VERIFYING CHECK-IN and add a reassurance line so the wait doesn't read as frozen.
Resolved SubmitProjectModal conflict: re-applied the verifying-check-in button label + reassurance line onto #178's restructured submit form (main form footer, not the terms modal). Verified auto-merged api.ts, program.controller, program.routes, submission.controller + test keep BOTH the luma gate and #180's editable-scores logic. 428 server tests + client build + lint pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the CSV guest upload (hackathon programs only) with on-demand verification against the Luma public API. A program with
luma_event_idset has its eligible guests mirrored from Luma intoprogram_signups; the public submit gate verifies the email against that synced set. No attendee CSV hosted on our side.Pull model: lazy (a submission cache-miss triggers a sync) + manual "Sync now". No background timer — freshness only matters at submit time, which is exactly when the gate runs.
What changed
Server
luma.client.js— pagedget-guests(explicit User-Agent — Luma's edge 403s default UAs; 8s timeout; 1 retry on 429/5xx; max-page guard; PII-minimized to email+name).luma-sync.service.js— single-flight per program, sanity guard (a 0-result/truncated sweep never overwrites a good cache), reconciles eligible set (leaves CSV/manual rows untouched), always stamps sync state.submission.controller.js) — JIT re-sync on miss (25s floor) + transient (503 "try again") vs definitive (403 "not on list") distinction.LUMA_GATE_MODE=checked_in(default) |approved(pre-event dry runs, before anyone is checked in).POST …/signups/sync+POST …/signups(manual add), bothrequireProgramAdmin. CSV path untouched for non-hackathon programs.20260615000000_program_luma_event.sql(additive);LUMA_API_KEY+LUMA_GATE_MODEin.env.example.Client
LumaGuestsSection(hackathons) — event-id field, Sync now, synced-N-ago + status badge, manual-add fallback. CSV uploader stays for other program types.Test scenarios
Two registrant emails that are approved but not yet checked in in the live Luma event (event is in the future, so check-in can't be exercised yet —
approvedmode dry-runs the identical flow):Test report
Run against the live Luma event with in-memory repos (nothing persisted):
Plus: client library proven against the real 464-guest event (10 pages, ~3.4s sweep, 0 duplicates); 411 server tests pass (15 new: sanity guard, truncation, single-flight, error stamping, JIT transient/definitive); client build + lint clean.
UX finding / recommendation
The cold path costs ~3–4s (one Luma sweep) for the first submitter after a cold/expired cache; everyone already in the synced set is instant (0ms), and concurrent cold submitters share one sweep. So at most one person at a time eats the wait, and only when the cache is cold.
Recommend: give the submit button an explicit "Verifying your check-in…" state so a 3–4s wait doesn't read as frozen. (Optional nicety: pre-warm the cache when the submit modal opens so the sweep overlaps form-filling and submit feels instant — needs a public warm trigger, more surface; probably unnecessary at ~130 submissions.)
Rollout / safety
luma_event_idand the server hasLUMA_API_KEY.luma_api, CSVluma,manual, orSUBMIT_TEST_EMAILS. SetSUBMIT_TEST_EMAILSto organizers before flipping as a guaranteed bypass.Notes