Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Replays for code battles

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Domain
full-stack

Research direction

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.

Written by the indexing model from the issue text.

Description

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.
Dominant language
JavaScript
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sennaicodes/codearena

All issues in sennaicodes/codearena

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.