Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
16 KiB
Staff Auto-Connect, Points Hygiene, Leaderboard Privacy (2026-10-20)
Three user-requested changes, two migrations:
20261020120000_staff_auto_connections.sql and
20261020130000_event_feedback_points.sql — applied to the local stack and
deployed to production 2026-10-20 (evidence at the bottom).
1. Staff are automatically connected to everyone — never for points
Every staff member now appears in every other participant's "My connections"
list for the same event, from the moment either registration exists — no
request, no accept step. Connecting with staff never grants points (the
explicit requirement): the rows are inserted directly as accepted and never
pass through accept_connection/_award_points.
- "Staff" is exactly the points-exempt set (
_points_eligible): registration typestaff, Admin contact, or an@appe.ataddress. Everyone else is a "person". Only staff × person pairs are created — never staff × staff, never person × person. - Trigger
registrations_autoconnect_stafffires on registration INSERT and on type changes (both directions: a late attendee pairs with existing staff, a newly registered staff member pairs with everyone)._autoconnect_staff_event(event)is the idempotent full pass, run once per event as the backfill. - The unique pair index makes every pass conflict-free: an existing pair — including a manually rejected one — is never touched.
- New column
connections.auto(defaultfalse) marks these rows. Attendees see them normally; the admin console (Dashboard activity feed, Activity connections table) filters them out so counts stay honest. - Scanning a staff lanyard is already-connected behaviour:
create_connection_requestreturns the existingacceptedrow and the app toasts "You're connected!".
Points logic, as reviewed on 2026-10-20
Every award goes through _award_points(event, email, delta, category), which
clamps at 0 (greatest(0, points + delta)), logs to points_log, and no-ops
without a registration unless _points_eligible holds — i.e. there is a
registration in that event with type ≠ staff, the contact is not
is_admin, and the email is not on @appe.at.
| Event | Who earns | Δ | category | Where |
|---|---|---|---|---|
| Welcome (front-desk) check-in | attendee | +10 | checkin |
welcome_checkin / set_registration_checked_in (un-toggling removes exactly what it added, as admin) |
| Session check-in | attendee | +10 | checkin |
checkin_attendee (once per session; service sessions excluded) |
| Connection accepted | both people | +5 each | connection |
accept_connection |
| Talk networking bonus | both people | +events.talk_networking_bonus each |
talk_networking |
accept_connection, only if both attended the same session |
| Session feedback | attendee | +5 rating only, +10 rating + comment | feedback |
submit_feedback (first submission only) |
| Event feedback | attendee | +5 | feedback |
submit_event_feedback — first submission only, added by 20261020130000_event_feedback_points.sql |
| Admin adjustment | any eligible attendee | ±n | admin |
adjust_points (admin-only; always the active event) |
| Staff connection (auto) | nobody | 0 | — | trigger insert, never accept_connection |
2. Admin console: points belong to the pass, not the contact
- Contacts: the Points button + modal removed — a contact without a pass cannot earn anything, so editing points there could silently do nothing.
- Registrations: eligible rows of the active event get a Points
button → the adjustment modal. On non-active events the button is disabled
with a tooltip because
adjust_pointsalways targets the active event's pass. The save patches the row in place (no reload, no reorder) and the silent refresher settles the truth — the same self-healing pattern as the check-in toggle. - Dashboard "Top points": email addresses removed — name only.
- Dashboard feed + Activity hide
autoconnections.
3. Leaderboard names are masked
Leaderboard.tsx now renders first name + last-name initial + dot
("Max Muster" → "Max M.") on the podium and in the ranked rows (the podium
previously showed the bare first name; rows leaked the full surname). The
(you) marker still matches on the email, which never leaves the client.
Verification
supabase/tests/staff_auto_connections_tests.sql— 14 assertions green (pair creation both directions, staff×staff/people×people never paired, zero points_log rows and unchanged points, late arrivals, rejected-pair protection, idempotent re-run, type flip, helper revokes).- Live local stack after the backfill: 678 auto rows, 6 staff in the active
event, 0 new
points_logrows. npm run buildgreen for both apps.- e2e:
leaderboard-live.spec.tsnow asserts the masked names (and that full names do not appear).connections.spec.tsCONV-CONN-007 rewritten — its old premise (manual staff networking, staff declining a request) is obsolete by design: the feature pre-accepts those pairs. The rewrite asserts pre-connected lists both ways, the instant-connect toast,status|auto = accepted|truein the DB, and unchanged points for both parties. Like the rest of that file it still rides the known seed drift (see ../backend/tests.md); the backend guarantee is what the SQL suite covers. Runbook: ../backend/tests.md.
Deployment
Deployed to production 2026-10-20 (attendee app + admin console + both
migrations), from commit 35b88d5 (= main).
- Baseline guard first: all eight frontend files being shipped were
md5-identical between the VM source and
origin/main, so whole-file copies were safe; the prod stack was exactly at the 2026-10-19 deploy (bundlesindex-D4o4lQL7.js/index-CvbBKcXb.js,welcome_checkinawarding +10). One drift found and left in place: the VM'ssupabase/tests/rpc_tests.sqldiffers frommain(edited on the VM); it ships in no image — flagged, not overwritten. - Backup
/home/APPE/convivo-backups/staffpts-20261020T201609Z(0700): fullpostgres.dump(custom format), before/after count files, md5 manifest of replaced sources. Rollback tagsconvivo-{app,admin}:rollback-staffpts-20261020T201609Z. - Migrations applied each in one
psql -1 -v ON_ERROR_STOP=1transaction (supabase/migrationscopies kept on the VM). No ledger table exists in this stack — this record is the ledger. - Backfill result:
connections= 654 auto / 0 manual, exactly 6 staff × 109 eligible participants of the active event.contacts120,registrations115,points_log0 — the backfill paid nobody, which is the point of the feature. - Live RPC smoke on prod, inside a rolled-back transaction (probe contacts
via
request.jwt.claims): firstsubmit_event_feedback→earned=5, points 0→5, onepoints_logrow; re-submit edit →earned=0, points stay 5; astaffregistration →earned=0, points 0. AfterROLLBACK: zero smoke rows left incontacts/points_log/connections. - Images: only
convivo-app+convivo-adminrebuilt/recreated; sidecar, Supabase core and every other container untouched (sidecar uptime unbroken). New bundlesindex-CI1zhQx2.js(attendee, contains theThanks! +N ptstoast) andindex-Bvxa-AGu.js(admin, contains theautofilters and the Registrations Points action); both HTTP 200 and healthy. - Gateway check:
POST /rest/v1/rpc/submit_event_feedbackwith the anon key and no JWT →P0001 "not authenticated"— route, grant and auth gate all live through Kong exactly as before.
Follow-up: session language tag deployed (2026-10-21)
What
Sabrina's backlog feature — a per-session language tag imported from
Sessionize (via a session category titled "Language") or the Excel import —
shipped to production from commit 6ed249f (branch cline/11b6c). Design,
organizer precondition and test detail: ../next-steps.md
("Session language tag — ✅ complete").
Deployment
Deployed to production 2026-10-21 00:12 CEST (migration + sidecar + both frontends).
- Baseline guard: all eight shipped runtime files md5-identical between the
VM and the pre-change commit; the three functions the migration replaces
(
get_agenda,sync_sessionize_event,sync_sessionize_excel) were dumped from the live prod DB and diffed against the migration's expectations — the only difference after applying is the language handling (and after the apply, prod function definitions are byte-identical to the local tested ones). - Backup
/home/APPE/convivo-backups/szlang-20261020T211211Z(0700): fullpostgres.dump, before/after counts, md5 manifests, migration output, function ACLs. Rollback tagsconvivo-{app,admin,sidecar}:rollback-szlang-20261020T211211Z. - Migration
20261021090000_session_language.sqlapplied withpsql -1 -v ON_ERROR_STOP=1; PostgREST schema cache reloaded. Counts unchanged before/after (120/115/32/654/0). - Images:
convivo-app,convivo-admin,convivo-sidecarrebuilt (new bundlesindex-BeolCmUg.jsattendee — contains "All languages" + the 🌐 pill — andindex-H78RjZbM.jsadmin); all three healthy; every other container untouched. - Live smokes:
get_agendathrough Kong returnslanguageon all 32 rows (all null — the organizer has not defined the category yet, exactly the designed idle state). A realPOST /runagainst the active event exercised the NEW sidecar transform end-to-end on the gridsmart source:status=success, 30 sessions updated, 0 errors, andlevel=22 area=22counts preserved via the coalesce upsert — the no-erase rule proven on prod data.https://convivo.appe.at+https://admin.appe.at→ 200.
Notes
- The active event's sessionize endpoint is currently a GridSmart feed, not Sessionize. The language column therefore stays null until either (a) the organizer enables a "Language" category on a Sessionize endpoint, or (b) an Excel with a Language column is imported. Both paths are live.
supabase/seed.sqland the new test files were not copied to the VM (repo-only, consistent with prior deploys).
Follow-up 3: material downloads unlock at the session end (deployed 2026-10-21 17:05 UTC / 19:05 CEST)
Product rule: attendees must always see that a speaker uploaded material, but
the download is locked until the session's scheduled end (no mid-session slide
distraction); afterwards everyone can download — purely time-based,
attendance not required. Commit d4e4637. Full design in
../next-steps.md ("Material downloads unlock at the
session end"). Migration + both frontend images (no sidecar change).
- Baseline guard: all seven runtime files md5-identical between the VM and
a2b8760before transfer; pushed files md5-verified on the VM. - Backup
/home/APPE/convivo-backups/matlock-20261021T165913Z(0700):postgres.dump, before/after counts, source md5, migration output, build log, policy def, container status. Rollback tagsconvivo-{app,admin}:rollback-matlock-20261021T165913Z. - Migration
20261021180000_material_time_lock.sqlappliedpsql -1 -v ON_ERROR_STOP=1; storage container restarted for bucket-cache safety; PostgREST reloaded. Count diff: onlymaterials_public true→false— every data count identical (32/120/115/1). - Images:
convivo-app(new bundleindex-BQpxRhdq.js) andconvivo-admin(index-B-Aa8hmK.js) rebuilt; healthy; nothing else touched. - Live verification on the REAL prod deck
(
sessions/eee91262…/1789055525728-Harder_Better_Faster_Stronger_-_ShiftEnter_2026.pptx, session of the Oct 23–24 event, so locked):/storage/v1/object/public/...→ HTTP 400 (public access dead).- Random authenticated attendee (JWT impersonation in-DB) → 0 rows visible.
- Admin contact → 1 row visible (bypass works).
session_material_unlocked(deck-session)→false(event hasn't run yet); time-based unlock, speaker bypass and anon exclusion are covered by the 12-assertionmaterial_time_lock_tests.sqlsuite (12/12, run post-reset).- Sites
convivo/admin→ 200; sidecar/health→ 200.
- Note: the prod deck's session currently has no
session_speakersrows (material was attached without an assignment), so its speakers see nothing until the end like everyone else — admins can always retrieve. Speakers listed via the portal (assignment + registration) always bypass.
Follow-up 2: service sessions forced to English (deployed 2026-10-21 23:45 CEST)
Product rule: sessions in service_session slots are always delivered in
English. Commit 1f4b9d2 — database-only change, no image rebuilds.
- Migration
20261021103000_service_language_english.sql: both sync functions forcelanguage = 'English'foris_service_sessionitems (single injection point after the language parse — byte-identical bodies otherwise, proven by dumping the live prod definitions post-apply and diffing against the local tested ones: identical) + backfill of existing service rows. Appliedpsql -1 -v ON_ERROR_STOP=1→UPDATE 10(all 10 prod service sessions), every other count unchanged (32/120/115/654/0). - Backup
/home/APPE/convivo-backups/szeng-20261020T214520Z: pg_dump, before/after counts, source md5, function defs before/after, migration output. No rollback tags needed (DB-only; the dump is the rollback). - Live verification: real
POST /runon the active event → success, and afterwards service sessions are 10/10 English.get_agendathrough Kong: 32 rows,languagepresent on all, service rows allEnglish, overall distributionDeutsch/English— the GridSmart feed turned out to carry real per-session language values overnight (12 English + 10 Deutsch regular talks), so the feature is live on real data. Both sites → 200. - Test suites (fresh
supabase db reset):session_language_tests.sqlnow 11/11 incl. three service cases. Full battery revealed pre-existing stale suites unrelated to language (present since the 2026-10-20 features or earlier, not re-run at the time):leaderboard_tests.sql(partially fixed here: event-feedback +5 expectation + auto-connect pair collision; one stale auto-connect points expectation remains),assigned_speaker_role(missing service_role JWT setup),delete_event_scheduleandregistration_ticket_merge(fixtures collide with seeded data),speaker_portal(stale talk-set expectation). All others green.
Follow-up 4: admin session material management (deployed 2026-10-21 19:18 UTC)
What
The admin session editor (Schedule view) got full material management so staff can act on behalf of a speaker at any time:
- See — the attached file shows its clean name (timestamp prefix stripped) plus when attendees unlock it (slot date + end time).
- Open (signed URL preview) and Download (authenticated blob saved under the original filename) — previously only "View current".
- Delete — confirm dialog; the storage object removal error now surfaces instead of silently nulling the path.
- Upload / replace — replacing deletes the previous object (no orphans);
a failed
material_pathupdate rolls the fresh upload back.
No migration: can_write_session_material and can_read_session_material
have allowed is_admin() from the start — verified end-to-end as an
impersonated admin against the real policies (insert → read → update →
delete via the storage-api delete path). material_time_lock_tests.sql
re-ran green 12/12. Fixed the stale e2e expectation in
speaker-portal.spec.ts that the download was an <a href> (it became an
authenticated blob button in Follow-up 3).
Deployment
Attendee app, DB and sidecar untouched — only the 4 changed source/doc files
were transferred (md5 guard 4/4) and convivo-admin rebuilt (rollback tag
convivo-admin:rollback-matui-20261021T191725Z). Live check: admin.appe.at
serves index-D_-ugNPZ.js containing the new UI strings; both sites → 200;
convivo-admin healthy, RestartCount 0.