-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When two players exactly tie (in milliseconds) on a buzz, their clients can end up in a state where each client believes it has won the buzz. The getWinningBuzzer function iterates through the buzzes map to find a winner. Since JavaScript Maps iterate in insertion order, each local client can choose a different winner. Sort the buzzes by userId prior to searching to make the winner deterministic across clients.
- Loading branch information
1 parent
9a9bbb8
commit a2c713f
Showing
2 changed files
with
32 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
a2c713f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
jep – ./
jep-cmnord.vercel.app
jep-psi.vercel.app
www.whatis.club
jep-git-main-cmnord.vercel.app
whatis.club