Skip to content

Conversation

@robotzurg
Copy link
Collaborator

Hopefully this works

Hopefully this works
@robotzurg robotzurg requested review from Casjb and ershisan99 October 16, 2025 22:47
}
}


Copy link
Collaborator

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

const eloChanges = await calculatePredictedMMR(queueId, teamData, winningTeamId)

// Store the calculated ELO changes in match_users table
for (const [userId, eloChange] of eloChanges.entries()) {
Copy link
Collaborator

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

}
}
} catch (err) {
console.error('Error calculating initial ELO changes:', err)
Copy link
Collaborator

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) {
Copy link
Collaborator

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

participants: matchUsersArray,
onComplete: async (interaction, winner) => {
console.log(
`Starting finish vote from vote from ${interaction.user.id}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log the winner too

@robotzurg robotzurg merged commit 2a93f10 into main Oct 17, 2025
@robotzurg robotzurg deleted the mmr-fix branch October 17, 2025 01:00
@ershisan99 ershisan99 changed the title Potential fix for LOSS 0.0 MMR Detailed logs for LOSS 0.0 MMR Oct 17, 2025
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