Closed shawnlauzon closed 6 years ago
It's weird; the data in Nuxt seems to be inconsistent:
The user
data is correct:
But the userStats
is wrong (antman is rank 8)
seems like it highlights all users with the same number of tokens wrong (highlights the last one of them in the list)
Apparently this only happens in a local installation; will have to address it later.
This definitely is still a problem, and it seems to have to do with logging in and logging out. Will investigate now.
The problem is the call to retrieve/stats
is returning the wrong rank when there are multiple users with the same number of posts.
This can be reproduced by finding a leaderboard that has two users with the same number of points (e.g. thor and wolverine) and signing in with the user who is ranked higher (e.g. thor in dev at the moment). You will see after signing in as thor that the UI highlights the wrong user:
This is because the current rank in the stats call is 3:
"user_level": {
...
"total_posts": 1,
"total_points": 105,
"total_points_pct": 7,
"total_tokens": 8817,
"overall_rank": 3
}
But then on the same server, /retrieve/leaderboard-data
will swt
{"username":"wolverine","total_posts":1,"total_points":105.0,"total_tokens":8817,"rank":2},{"username":"thor","total_posts":1,"total_points":105.0,"total_tokens":8817,"rank":3},
And then if I refresh the UI:
So I still cant tell exactly what is going on, but there is inconsistency in the ranking of the users coming back from the server. Assigning to @alexdashkov to investigate.
What is the priority? I'd like to start it when I'll finish with the stats endpoint, does it make sense?
PM'd.
This issue should be fixed with the stats PR
Looks good to me!
Describe the bug The user who is logged in is not being highlighted; a different user is
To Reproduce Steps to reproduce the behavior:
Expected behavior My user should be highlighted
Screenshots Hawkeye is highlighted
But I am antman
Additional context N/A