-
Notifications
You must be signed in to change notification settings - Fork 3
Detailed logs for LOSS 0.0 MMR #53
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
Conversation
Hopefully this works
src/utils/algorithms/calculateMMR.ts
Outdated
| } | ||
| } | ||
|
|
||
|
|
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.
Ah yes my favorite kind of change
src/utils/queueHelpers.ts
Outdated
| const eloChanges = await calculatePredictedMMR(queueId, teamData, winningTeamId) | ||
|
|
||
| // Store the calculated ELO changes in match_users table | ||
| for (const [userId, eloChange] of eloChanges.entries()) { |
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.
This should be a transaction
src/utils/queueHelpers.ts
Outdated
| } | ||
| } | ||
| } catch (err) { | ||
| console.error('Error calculating initial ELO changes:', err) |
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.
Maybe log additional details for ease of debugging later?
| await updatePlayerWinStreak(player.user_id, queueId, team.score == 1) | ||
|
|
||
| // Update elo change if it exists | ||
| if (player.elo_change !== undefined && player.elo_change !== null) { |
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.
If Im being honest I don't see why exactly this would've caused issues to begin with. Maybe add some logging first to try and trace back the issue? ,flatMap is usually a bit confusing to work with, I have a suspicion something might be off because of it. Maybe rewrite it to use simpler methods instead?
I also don't see how this change would fix the issue tbh
src/events/interactionCreate.ts
Outdated
| participants: matchUsersArray, | ||
| onComplete: async (interaction, winner) => { | ||
| console.log( | ||
| `Starting finish vote from vote from ${interaction.user.id}`, |
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.
Log the winner too
Hopefully this works