Skip to content
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

Fix sorting events on the client #47

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Fix sorting events on the client #47

merged 1 commit into from
Nov 30, 2024

Conversation

eltoder
Copy link
Owner

@eltoder eltoder commented Nov 30, 2024

(k1 < k2) should have been (k1 < k2 ? -1 : 1), but Array.sort() has been stable for a long time. We don't compare keys on the server side, so just remove this on the client side as well.

Also, change tiebreak in the leaderboard as suggested in[1]. Instead of comparing user IDs, which are arbitrary, compare the times that they found the last set.

Fixes #46

[1] ekzhang/setwithfriends#153

(k1 < k2) should have been (k1 < k2 ? -1 : 1), but Array.sort() has been
stable for a long time. We don't compare keys on the server side, so
just remove this on the client side as well.

Also, change tiebreak in the leaderboard as suggested in[1]. Instead of
comparing user IDs, which are arbitrary, compare the times that they
found the last set.

Fixes #46

[1] ekzhang/setwithfriends#153
@eltoder eltoder merged commit 2b8ec71 into main Nov 30, 2024
4 checks passed
@eltoder eltoder deleted the feature/sort-order branch November 30, 2024 23:50
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.

firefox sometimes displays incorrect game state
1 participant