Skip to content

Conversation

@saikhurana98
Copy link
Collaborator

Phase 1 — P0/P1 correctness:

  • duel-aware disconnect in room-service (skip removal for duel rooms)
  • state guard + idempotency on submitResult and updateProgress
  • extract tryRecordDuelResult with idempotency flag
  • guard one-player race start and joinLobby auto-start re-trigger
  • clear liveWpm between rounds
  • fix spectator active flag and connected field
  • add duelResultRecorded to Room type, clear on reset

Phase 2 — disconnect/reconnect & spectator:

  • cancel countdown/race on opponent disconnect
  • server clears duelStartTimeout
  • client clears race timers + state guards on race functions
  • guard progress updates to active race phases only
  • fix spectator sync returning true on invalid payload
  • remove unused DUEL_CONFIG import

Phase 3 — ghost entries & stuck rooms:

  • fix socket ID mutation bug in registerSystem transfer paths
  • save oldSocketId before duelStore.transferSide mutates it
  • emit room_player_left for old socket ID to peers on transfer
  • reset duel room to LOBBY on grace-period expiry
  • prevents stuck RACE_ONGOING blocking future auto-starts

Description

Checks

  • Adding/modifying Typescript code?
    • I have used qs, qsa or qsr instead of JQuery selectors.
  • Adding quotes?
    • Make sure to include translations for the quotes in the description (or another comment) so we can verify their content.
  • Adding a language?
    • Make sure to follow the languages documentation
    • Add language to packages/schemas/src/languages.ts
    • Add language to exactly one group in frontend/src/ts/constants/languages.ts
    • Add language json file to frontend/static/languages
  • Adding a theme?
    • Make sure to follow the themes documentation
    • Add theme to packages/schemas/src/themes.ts
    • Add theme to frontend/src/ts/constants/themes.ts
    • Add theme css file to frontend/static/themes
    • Add some screenshots of the theme, especially with different test settings (colorful, flip colors) to your pull request
  • Adding a layout?
    • Make sure to follow the layouts documentation
    • Add layout to packages/schemas/src/layouts.ts
    • Add layout json file to frontend/static/layouts
  • Adding a font?
    • Make sure to follow the themes documentation
    • Add font file to frontend/static/webfonts
    • Add font to packages/schemas/src/fonts.ts
    • Add font to frontend/src/ts/constants/fonts.ts
  • Check if any open issues are related to this PR; if so, be sure to tag them below.
  • Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info)
  • Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title.

Closes #

notkanishk and others added 17 commits February 6, 2026 01:15
Phase 1 — P0/P1 correctness:
- duel-aware disconnect in room-service (skip removal for duel rooms)
- state guard + idempotency on submitResult and updateProgress
- extract tryRecordDuelResult with idempotency flag
- guard one-player race start and joinLobby auto-start re-trigger
- clear liveWpm between rounds
- fix spectator active flag and connected field
- add duelResultRecorded to Room type, clear on reset

Phase 2 — disconnect/reconnect & spectator:
- cancel countdown/race on opponent disconnect
- server clears duelStartTimeout
- client clears race timers + state guards on race functions
- guard progress updates to active race phases only
- fix spectator sync returning true on invalid payload
- remove unused DUEL_CONFIG import

Phase 3 — ghost entries & stuck rooms:
- fix socket ID mutation bug in registerSystem transfer paths
- save oldSocketId before duelStore.transferSide mutates it
- emit room_player_left for old socket ID to peers on transfer
- reset duel room to LOBBY on grace-period expiry
- prevents stuck RACE_ONGOING blocking future auto-starts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add seedLeaderboardFromOtpMap to pre-fill all OTP users as
  greyed-out placeholder entries (wpm: -1) on the spectator
  leaderboard, sorted to the bottom like F1 standings
- Add auth guard in tryRecordDuelResult to skip recording
  when participants are not authenticated
- Clear stale unauthenticated test data from duel-results.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously handleAuthenticate returned false immediately when the socket
wasn't connected, causing submitOtp to clear inputs and hide the spinner.
Now awaits the connection before returning the real auth result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Hide all ad elements during duel flow
- Remove "public profile" link from EULA page
- Non-finishers shown at bottom with "DNF" label, greyed out

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove dead COUNTDOWN_1/COUNTDOWN_2 states and isInCountdown()
- RESULTS now allows transition to LOBBY (opponent disconnect)
- Remove strict OTP flow-state guard that blocked valid submissions
- Always register side before authenticating (both connected paths)
- Populate opponent WPM/graph on race complete (was skipped by
  shouldBlockUI early return during RACING state)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add animation and countdown to race view (@notkanishk)
- POST/PUT/DELETE /duel/admin/users — manage OTP user map
- GET/POST /duel/admin/config — view/update runtime config
- POST /duel/admin/leaderboard — set leaderboard entries directly
- All user changes persist to duel-otp.json
- Leaderboard changes persist to duel-results.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Reset tribe results and destroy charts before each practice and race
- Lock Tab/Enter/Escape during active duel flow to prevent test restarts
- Lock config changes during duel flow unless explicitly overridden
- Track and clean up showAutoAdvanceTimeout properly
- Clean up auto-advance UI on opponent disconnect
- Use tribeOverride for all config changes in duel flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 47 entries from xlsx gate pass codes
- 8 generated codes for participants without gate pass
- 7 test entries preserved (000000-555555, 999999)
- Seeded leaderboard placeholders for all participants

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Suppress ads on result page during duel sessions
- Force ads config off at duel flow init
- Don't block duel progression on result-save latency/failures
- Add error handling for save promise to prevent unhandled rejections
- Capture duel state before async operations to avoid race conditions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants