fix: resolve schedule data staleness in production builds
- Replace window.location.reload() with router.refresh() in ScheduleGenerator, MatchEditor, RecalculateEloButton for proper Next.js cache invalidation - Add revalidatePath() call after schedule generation in POST handler - Add ownerId to tournament creation in cucumber tests for proper permission checks - Assign tournament_admin role via Prisma after user creation in cucumber tests - Fix TypeScript type annotations in hooks.ts (tournament id map) - Update page reload to use networkidle in common-steps.ts - Clear .next/ cache before cucumber tests in justfile - Add .turbo to clean target - Add comprehensive debug logging to schedule API route - Document findings in docs/TROUBLESHOOTING_SCHEDULE_GENERATION.md
This commit is contained in:
@@ -23,6 +23,7 @@ export default async function TournamentSchedulePage({ params }: PageProps) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
console.log(`[Schedule Page] Fetching tournament ${tournamentId}`);
|
||||
const tournament = await prisma.event.findUnique({
|
||||
where: { id: tournamentId },
|
||||
include: {
|
||||
@@ -48,6 +49,10 @@ export default async function TournamentSchedulePage({ params }: PageProps) {
|
||||
},
|
||||
},
|
||||
})
|
||||
console.log(`[Schedule Page] Tournament ${tournamentId} has ${tournament?.rounds?.length || 0} rounds`);
|
||||
if (tournament?.rounds && tournament.rounds.length > 0) {
|
||||
console.log(`[Schedule Page] First round:`, JSON.stringify(tournament.rounds[0]));
|
||||
}
|
||||
|
||||
if (!tournament) {
|
||||
notFound()
|
||||
|
||||
Reference in New Issue
Block a user