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]>
2.8 KiB
Leaderboard Validation
Findings and Fixes
The old implementation hid staff from rankings but still awarded them points. A rollback regression reproduced a staff check-in award of ten points. The internal security-definer award helper was also executable by API roles, and the local leaderboard was absent from the Realtime publication.
Migration 20261015164546_leaderboard_staff_admin_exclusion enforces zero points
for staff and Admin contacts (is_admin or @appe.at) at award and registration
write boundaries. Excluded awards create no points-log entries. Session feedback
reports zero earned for excluded users; their attendance/feedback still works.
Role changes clear excluded balances and remove leaderboard entries immediately.
Historical audit entries are preserved. Ordinary participants, including
non-Admin speakers, remain eligible.
Rankings mirror registration totals, refresh on name changes and registration deletion, exclude missing registrations and use deterministic tie ordering. The migration adds leaderboard Realtime publication membership and revokes direct client execution of internal scoring/synchronization helpers.
Verification
- 46 rollback SQL assertions passed against the installed local migration.
- A real local browser test passed using disposable Auth/registration fixtures: the leaderboard received a WebSocket change, updated the winning score and moved the signed-in participant from rank #1 to #2 without reload. Staff/Admin adjustments left balances at zero, with no ranking rows or new award logs. Fixture contacts and Auth users were deleted afterward.
- Neighboring service-staff, GridSmart, speaker-portal, ticket-merge and Sessionize date-guard SQL suites passed. The last two required their pending prerequisite migrations within rollback transactions; no broad migration or database reset was run. Their former staff-balance assertions now expect zero.
- Attendee production build and browser-test TypeScript validation passed.
- The final combined browser run passed all 40 tests: the real leaderboard test plus 39 existing attendee entry, service agenda, clock and profile regressions.
- Supabase security advisors reported only existing mutable-search-path warnings
for
current_emailand_map_ticket_type, not the new functions.
Activation Scope
Only this migration was applied and recorded locally. No production deployment, commit or push was performed for this task. Production cannot be confirmed to enforce these new rules until the migration is deployed there. Existing excluded balances are cleared when applied; historical audit rows remain unchanged.
Local attendee app: http://127.0.0.1:3000.
See RPC rules and test commands.