Skip to content

feat(session): confirm attendee identity and leave stage safely - #504

Open
AnnieScigliano wants to merge 3 commits into
mainfrom
feat/stage-exit-attendee-identity
Open

feat(session): confirm attendee identity and leave stage safely#504
AnnieScigliano wants to merge 3 commits into
mainfrom
feat/stage-exit-attendee-identity

Conversation

@AnnieScigliano

@AnnieScigliano AnnieScigliano commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #496
Closes #497

Outcome

  • Adds a required attendee-visible-name confirmation boundary before LiveKit mounts. Existing browser sessions are deliberately unconfirmed by the additive migration, while new ticket/promo logins confirm the name they just entered.
  • Persists corrections server-side and atomically converges active browser sessions plus the durable SessionParticipant alias. Refresh, reconnect and a second device keep the stable event identity; names are bounded, Unicode-safe, and never required to be unique.
  • Adds an attendee-scoped, idempotent leave_stage transition. It clears the hand, revokes the durable publisher grant and enforces subscriber-only permissions without disconnecting either receiving room.
  • Separates “Leave the scene” from “Leave session”. Both are explicit and confirmed; only the latter disconnects the page and Beacon.
  • Keeps the existing privacy boundary: staff surfaces use the confirmed alias, while public naming remains limited to the canonical raised-hand consent flow.

Audio boundary

This PR touches src/app/session/[id]/page.tsx, so it intentionally carries audio-touching and requests Nico's CODEOWNER review. It does not change codecs, bitrate, sample rate, channels, gain, buffers, crossfader behavior, AudioContext, audio routing, Room creation, or audio activation. The new stage-exit E2E and unit tests assert that both receiving rooms remain mounted and are not reactivated.

Verification

  • npx tsc --noEmit — pass
  • npm run lint -- --max-warnings=0 — pass
  • npm run build — pass
  • npx prisma validate — pass
  • fixture DB + prisma migrate deploy — pass
  • clean scratch DB + full prisma migrate deploy — pass
  • focused Vitest: 108 tests across entry, identity, stage control, room, page and media continuity — pass
  • full serial Vitest after rebase, excluding only the pre-existing macOS-incompatible target monitor: 1,124 passed; 24 integration tests skipped by their normal env gates
  • Chromium E2E: pre-entry confirmation + refresh, second-device correction + staff hand queue, attendee stage return — pass
  • shared-fixture isolation: identity journey leaves zero raised hands; the following w390 cockpit returns to its canonical 390×1425 state — pass
  • responsive attendee shell at 1440/1024/768/390/320 — 5/5 pass
  • axe on the pre-LiveKit identity gate — no critical/serious violations

The normal pre-commit hook was bypassed only because local Node 26 exposes no jsdom localStorage unless --localstorage-file is supplied and livekit-target-monitor.test.ts cannot bind its loopback fixture on this macOS host. Both are reproducible on clean main; the controlled serial command with the Node option is green, and CI Node 22/Linux runs the complete unexcluded suite.

Review focus

  • additive display_name_confirmed_at migration and existing-session behavior;
  • entitlement-scoped transaction/alias convergence and privacy boundary;
  • idempotent attendee/staff demotion race and LiveKit compensation;
  • no remount/disconnect/reactivation across scene → audience;
  • canonical Linux visual baseline for the deliberately separated full-session exit control.

Rollback

Revert commits aa61836, 055d464 and 329b8a5. The nullable database column can remain safely unused; no destructive migration is required.

@AnnieScigliano

Copy link
Copy Markdown
Collaborator Author

CI run 33832188869 exposed four stale expectations in the pre-existing media-continuity helper after full-session exit gained confirmation. Fixed in 055d464 and verified locally: Chromium + Android 6/6 green against real LiveKit. The remaining w390 cockpit screenshot drift is unrelated to a direct cockpit diff and will be accepted only if the fresh canonical run reproduces it. Separately, root/analytics dependency audit gates fail before lint/build on the current dependency trees; tracked without weakening or mixing scope in #505.

@AnnieScigliano

Copy link
Copy Markdown
Collaborator Author

CI follow-up after aa61836:

  • The four media-continuity failures from the first run are resolved: the second Linux run reached 109/110 Chromium + Android tests passing.
  • The sole remaining E2E failure was reproduced twice (including Playwright retry): conductor-cockpit-w390-linux.png rendered at 390×1435 instead of 390×1425.
  • I downloaded and inspected the runner's expected/actual/diff instead of blessing the image. The extra 10 px came from the new second-device identity journey leaving Anahí 李 in the persistent hand queue (Manos 1 / Sigue: Attendee). This was test-state leakage, not an intended layout change.
  • aa61836 adds bounded fixture cleanup before and after that journey. From a clean restored fixture, both identity journeys pass, the database reports zero raised hands afterward, and the immediately following w390 cockpit returns to 390×1425 with Manos 0. No Linux baseline was changed.
  • tsc, ESLint and diff checks remain green locally. The commit hook was bypassed only for the already documented macOS/Node 26 localStorage failure; the prior CI test job passed the complete suite on Node 22/Linux.

The branch has been pushed and fresh checks are running. Dependency/analytics CI failures remain separate from #496/#497 and are tracked in #505; this PR does not weaken or bypass those gates.

@AnnieScigliano

Copy link
Copy Markdown
Collaborator Author

Final CI status for aa61836:

The #496/#497 implementation and its regression gates are green. I have not bypassed either repository gate, merged, or deployed. Re-review remains requested from @nicoechaniz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audio-touching Touches frozen audio behavior and requires Nico approval

Projects

None yet

1 participant