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]>
91 lines
5.3 KiB
Markdown
91 lines
5.3 KiB
Markdown
# 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_email` and `_map_ticket_type`, not the new functions.
|
|
|
|
## Activation Scope
|
|
|
|
The feature release was committed and pushed as `6bad96c`, then deployed to
|
|
production on 2026-10-15 together with manual feedback AI summaries. Only
|
|
`20261011163332` and `20261015164546` were applied and recorded. No reset, seed,
|
|
unrelated migration, real email or LLM request was performed.
|
|
|
|
Production backup: `/home/APPE/convivo-backups/feedback-leaderboard-20261015T170447Z`
|
|
contains the private database dump, original source and container metadata.
|
|
Rollback image tags are `convivo-admin:rollback-feedback-leaderboard` and
|
|
`convivo-sidecar:rollback-feedback-leaderboard`.
|
|
|
|
Admin and sidecar were rebuilt from their deployed source baseline with only
|
|
the requested changes. The attendee bundle remains `index-DbYmWAlL.js`; the new
|
|
Admin bundle is `index-CHumeZkf.js`. Existing production connection scoring
|
|
remains five points per acceptance. Its older RPC has no shared-talk bonus;
|
|
the deployment-only SQL expectations were adapted to that existing contract.
|
|
|
|
Production verification passed all eight AI and 46 leaderboard SQL assertions
|
|
before and after installation, plus ticket-merge and Sessionize date-guard
|
|
rollback regressions. Twelve AI tests passed against the isolated built sidecar
|
|
image. A merge test initially lacked its caller transaction wrapper; its six
|
|
synthetic contacts and two test events were removed, and the wrapped rerun
|
|
passed. No fixture contacts or Auth users remain.
|
|
|
|
A real public Auth/Realtime smoke test received the updated leaderboard score,
|
|
confirmed authenticated rankings, zero staff/Admin balances and no excluded
|
|
award logs, and checked that AI settings redact the stored key. All disposable
|
|
accounts were deleted. The final database audit found zero excluded nonzero
|
|
balances, excluded/orphan ranking rows or mirror mismatches. Eligible balances,
|
|
registration details, contacts, sessions, Auth user IDs and prior audit entries
|
|
were preserved by migration assertions. Existing excluded balances were cleared.
|
|
|
|
PostgREST had connection-pool timeouts logged before migration installation.
|
|
Restarting only the same REST container restored internal/public HTTP 200;
|
|
its image/configuration were unchanged. Auth, PostgreSQL, Realtime and attendee
|
|
containers were not restarted. The first Realtime smoke timed out during tenant
|
|
startup; a subsequent real subscription/update passed without restarting it.
|
|
|
|
The public AI settings route returns HTTP 401 and `Cache-Control: no-store`
|
|
without authentication. All 54 public browser regressions passed against the
|
|
final bundles, including eight AI Admin tests for saved summaries, provider
|
|
failures, pagination and mobile controls, plus 39 attendee entry/agenda/clock/
|
|
profile, four ticket-merge and three Sessionize-source tests. The real public
|
|
Realtime smoke passed twice after tenant startup. An LLM endpoint/model must still be configured manually
|
|
in Admin Settings before generation; no provider was configured or called.
|
|
|
|
Local attendee app: `http://127.0.0.1:3000`.
|
|
|
|
See [RPC rules](../backend/rpcs.md#points-rules) and
|
|
[test commands](../backend/tests.md#leaderboard-regression). |