Skip to content

feat(luma): verify submissions against Luma guests via API (replaces CSV)#179

Merged
sacha-l merged 4 commits into
developfrom
feat/luma-api-guest-verification
Jun 15, 2026
Merged

feat(luma): verify submissions against Luma guests via API (replaces CSV)#179
sacha-l merged 4 commits into
developfrom
feat/luma-api-guest-verification

Conversation

@sacha-l

@sacha-l sacha-l commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the CSV guest upload (hackathon programs only) with on-demand verification against the Luma public API. A program with luma_event_id set has its eligible guests mirrored from Luma into program_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 — paged get-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.
  • Submit gate (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).
  • Endpoints: POST …/signups/sync + POST …/signups (manual add), both requireProgramAdmin. CSV path untouched for non-hackathon programs.
  • Migration 20260615000000_program_luma_event.sql (additive); LUMA_API_KEY + LUMA_GATE_MODE in .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 — approved mode dry-runs the identical flow):

  1. Each email submits one by one → both allowed.
  2. Both submit at the same time → both allowed; measure latency + concurrency limits; decide if UX needs a loading affordance.
  3. A non-registered email → rejected.

Test report

Run against the live Luma event with in-memory repos (nothing persisted):

Scenario Result
One-by-one 1st (cold JIT sync): ~4.2s, allowed ✅ · 2nd (warm cache): 0ms, allowed ✅
Simultaneous both allowed in ~3.1s total — single-flight collapses to one shared Luma sweep, not 2× ✅
Non-registered rejected ✅
Eligible set synced 158 approved guests

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

  • Config-gated: dormant until a program has luma_event_id and the server has LUMA_API_KEY.
  • Kill switch: clear the event id → gate instantly reverts to prior CSV/test-email behavior. No redeploy.
  • Additive: gate allows an email from any source — luma_api, CSV luma, manual, or SUBMIT_TEST_EMAILS. Set SUBMIT_TEST_EMAILS to organizers before flipping as a guaranteed bypass.
  • The real checked-in → allowed path can't be exercised until the event; validate on event day by checking in one test guest.

Notes

  • UI is visually reviewable on the branch preview (mock mode: Sync/manual-add return canned data; real Luma needs a deployed env with the key).

sacha-l added 2 commits June 15, 2026 16:54
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.
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
stadium Ready Ready Preview, Comment Jun 15, 2026 11:15pm

…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.
@sacha-l sacha-l marked this pull request as ready for review June 15, 2026 23:18
@sacha-l sacha-l merged commit f59d0f7 into develop Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant