volentixlabsinc / venue-server

The backend services for Venue, a community engagement platform for the Volentix community
https://venue.volentix.io
MIT License
6 stars 0 forks source link

Users have the same rank in the user stats #166

Closed Lyncis closed 6 years ago

Lyncis commented 6 years ago

I've noticed that different users with the same number of tokens have the same overall rank in the user stats.

To be more detailed, if I go to http://localhost:8000/api/retrieve/leaderboard-data/ I get the following result: image image

Then I go to localhost:8000/docs, log in as spiderman, then go to retrieve/stats, I get this: image

So, in the leaderboard-data spiderman has rank 8, but in the user stats his rank is 9. And it is the same for every user with the same number of tokens as a spiderman.

I don't know if it should be like that or if this needs to be fixed. Leaderboard hilhlighting is not displayed correclty in some cases and it seems like it is because of this rank in user stats.

shawnlauzon commented 6 years ago

@joemarct Could you take a look at this?

alexdashkov commented 6 years ago

I've tested it on the master and I have the same values in the leaderboard-data and stats. Also, I completely remade leaderboard-data in the performance branch, so I prefer to wait for the merge and after that develop the changes if required.

And a question, @shawnlauzon is it correct that users with the same points have a different rank?

shawnlauzon commented 6 years ago

Ok, that seems reasonable. @alexdashkov please create a PR for merging into master and ask @joemarct to review it.

Yes, users with same points will have different ranks; the ranking can be arbitrary (although ideally the first user who earned a certain number of points should be ranked higher), but consistent.

alexdashkov commented 6 years ago

@shawnlauzon do you mean a PR with the leaderboard data? @realrhys has said that that he will merge a performance branch to the master by the end of testing.

shawnlauzon commented 6 years ago

Yes, with the leaderboard data. Now this is more than a performance fix, it's possibly a correctness fix. So I want it in master so that we can complete our integration testing. Performance testing can happen in parallel in the performance branch, and if there are additional performance fixes, they can be merged later.

alexdashkov commented 6 years ago

@shawnlauzon I'm not sure yet that this a bug fix as I can't reproduce the problem. I'm waiting for the @Lyncis's response. Does it make sense?

shawnlauzon commented 6 years ago

Talked to Alex, PR is coming up.

Lyncis commented 6 years ago

I pulled the last changes on the server, still have the same issue,

Trying to explain it again.

I go to http://localhost:8000/docs/ Authenticate as ironman: image

Then I retrieve leaderboard-data with this user, I see that his rank is 10. image

Then I go to retrieve user stats and see that his overall_rank is 10

image

Then if I log in as spiderman and retrieve leaderboard-data, his rank is 9 here image

But if I go to the user stats, his overall_rank is 10 as it was for ironman image

Same is for hawkeye and other who has the same number of tokens. As for other users, their rank is displayed correctly.

I also noticed that when I am retrieving leadreboard for these users, they quite often have different ranks. For example, spiderman can have rank 9, and on the next time he can have rank 7. In the user_stats though, it is always the same for all of them.

Lyncis commented 6 years ago

Seems like this is an issue only locally, everything works fine on uat and dev.

shawnlauzon commented 6 years ago

I'm going to close this as a duplicate of Volentix/venue#257; better to have a single issue for a single problem.