forked from monkeytypegame/monkeytype
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: harden duel system correctness and disconnect handling (@psygos) #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
saikhurana98
wants to merge
17
commits into
dev
Choose a base branch
from
working-persistent-storage-and-results
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…el view transition. (@notkanishk)
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>
…ub.com/redbrickhacks/monkeytype-duel into working-persistent-storage-and-results
- 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>
This reverts commit 4394c8e.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Phase 1 — P0/P1 correctness:
Phase 2 — disconnect/reconnect & spectator:
Phase 3 — ghost entries & stuck rooms:
Description
Checks
qs,qsaorqsrinstead of JQuery selectors.packages/schemas/src/languages.tsfrontend/src/ts/constants/languages.tsfrontend/static/languagespackages/schemas/src/themes.tsfrontend/src/ts/constants/themes.tsfrontend/static/themespackages/schemas/src/layouts.tsfrontend/static/layoutsfrontend/static/webfontspackages/schemas/src/fonts.tsfrontend/src/ts/constants/fonts.tsCloses #