fix(finale): live-verification fixes — session sync on start, honest vote form, reveal panel polish
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m43s

Found by driving the full ceremony end-to-end in the browser:
- live.start + startPresentation sync LiveVotingSession (status/currentProjectId)
  — jury votes silently failed when the admin never used sendToScreens
- LiveVotingForm no longer shows 'submitted' on a failed mutation; pages
  re-key on votedAt so async vote data renders the right state after refresh
- reveal compose prefers DELIB_LOCKED deliberation results over jury score
  order (listSessions now includes results); Arm unlocks right after save
- deliberation jury page review cards re-key on revision

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-06-10 19:24:45 +02:00
parent 160333c2f9
commit 9b56eb27fb
7 changed files with 58 additions and 13 deletions

View File

@@ -320,6 +320,10 @@ export const deliberationRouter = router({
participants: {
select: { userId: true },
},
results: {
select: { projectId: true, finalRank: true, isAdminOverridden: true },
orderBy: { finalRank: 'asc' },
},
},
orderBy: { createdAt: 'desc' },
})

View File

@@ -126,6 +126,13 @@ export const liveRouter = router({
},
})
// Keep the voting session in lockstep from the very start so jury
// votes target the active project (a session may not exist yet).
await tx.liveVotingSession.updateMany({
where: { roundId: input.roundId },
data: { currentProjectId: input.projectOrder[0], status: 'IN_PROGRESS' },
})
return created
})
@@ -485,6 +492,11 @@ export const liveRouter = router({
: {}),
},
})
// Sync the voting session even when the admin skips sendToScreens
await ctx.prisma.liveVotingSession.updateMany({
where: { roundId: input.roundId },
data: { currentProjectId: cursor.activeProjectId, status: 'IN_PROGRESS' },
})
await logAudit({
prisma: ctx.prisma,
userId: ctx.user.id,