Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Replays for code battles

Abierto
#16 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, nextjs, nodejs
Área
full-stack

Línea de trabajo

Read frontend/pages/agent-replay/[id].js for the existing replay flow and backend/db.js for migration patterns; trace the code-update stream and battle-finish handling. Add a replay-log round-trip test that verifies byte-for-byte final code, route tests for private replay access, and run npm test plus node scripts/check-boundary.js; done means the design requirements and definition of done are met.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement help wanted

After a battle, players can see the final code, but not how either player got there. A replay that scrubs through both editors side by side is the best learning tool a battle site can offer: you see where the winner started, what they deleted, and when the tests went green.

Agent battles already have replays (frontend/pages/agent-replay/[id].js). Code battles do not. battles_history stores only the final winner_code and loser_code.

Design

  • Record a compact edit log per player during the battle: timestamped diffs from the existing throttled code-update stream, plus each run and submit with its pass count. Do not store every keystroke.
  • Store it in a new table keyed by battle_uuid, written once when the battle finishes. Add the migration in backend/db.js the same way existing ones are added.
  • Cap the size per battle (for example 256 KB compressed) and degrade gracefully past it by keeping fewer snapshots.
  • A replay page at /replay/<battleId> with a shared timeline, play and pause, 1x/4x/16x speed, and markers for runs and submits.
  • Only the two players can see a replay by default. Either player can make it public. Public replays show on profiles.
  • Delete edit logs after a configurable retention period (default 90 days), with a scheduled sweep.

Definition of done

  • Replaying reconstructs the exact final code for both players (add a test that replays a recorded log and compares byte for byte).
  • A three-minute battle produces a log under the cap, with numbers in the pull request.
  • Privacy rules covered by route tests: non-players get 404 on private replays.
  • npm test and node scripts/check-boundary.js pass.
Lenguaje dominante
JavaScript
Estrellas
0
Forks
2
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sennaicodes/codearena

Todos los issues de sennaicodes/codearena

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.