lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.55k stars 2.27k forks source link

Losses vs the AI or anonymous players show up under the Draws tab #3815

Open cyanfish opened 6 years ago

cyanfish commented 6 years ago

It looks like the counts in the tab titles are correct but the contents of the tabs are not.

See: https://lichess.org/@/Gary_Internet/draw https://lichess.org/@/Gary_Internet/loss https://lichess.org/forum/lichess-feedback/i-cant-filter-on-the-game-ive-lost-when-looking-at-my-profile

ornicar commented 6 years ago

it's because the DB selection for draws is

def draw(u: String): Bdoc = user(u) ++ finished ++ F.winnerId.$exists(false) and the AI has no winnerId

There's no fixing it without adding a new index on the games collection, which is very expensive

cyanfish commented 6 years ago

Since loser was added to advanced search, does the needed index exist now? e.g. winner != user && loser != user