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:
2026-05-01 16:39:50 -07:00
parent 9353ab1edc
commit caefb0dcc0
11 changed files with 454 additions and 23 deletions
+7 -1
View File
@@ -85,17 +85,23 @@ test-acceptance-postgres:
# Run Cucumber e2e tests with SQLite
test-cucumber-sqlite:
@echo "Clearing Next.js cache..."
rm -rf .next/
@echo "Running Cucumber e2e tests with SQLite..."
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance:cucumber
# Run Cucumber e2e tests with PostgreSQL (uses .env.development)
test-cucumber-postgres:
@echo "Clearing Next.js cache..."
rm -rf .next/
@echo "Running Cucumber e2e tests with PostgreSQL..."
npm run test:acceptance:cucumber
# Run Cucumber e2e tests with PostgreSQL against production build
# This is more reliable than dev server (no HMR, faster API responses)
test-cucumber-postgres-prod:
@echo "Clearing Next.js cache..."
rm -rf .next/
@echo "Building application for production..."
bun run build
@echo "Starting production server in background..."
@@ -211,7 +217,7 @@ help:
# Clean up project (remove node_modules, build artifacts)
clean:
@echo "Cleaning project..."
rm -rf node_modules .next dist
rm -rf node_modules .next dist .turbo
# Generate Prisma client
prisma-generate: