Skip to content

Commit

Permalink
Fix regression in handling of races between renames and MMR
Browse files Browse the repository at this point in the history
  • Loading branch information
Slayer95 committed Aug 7, 2017
1 parent deccaf5 commit 1aabf2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ladders-matchmaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ class Matchmaker {
formatid = Dex.getFormat(formatid).id;

return Promise.all([
Promise.resolve(user.userid),
user.prepBattle(formatid, 'search', null),
Ladders(formatid).getRating(user.userid),
]).then(([validTeam, rating]) => {
]).then(([userId, validTeam, rating]) => {
if (userId !== user.userid) return;
return this.finishSearchBattle(user, formatid, validTeam, rating);
}, err => {
// Rejects iff we retrieved the rating but the user had changed their name;
Expand Down

0 comments on commit 1aabf2d

Please sign in to comment.