67P / kredits-web

Kredits Web UI
https://kredits.kosmos.org
6 stars 2 forks source link

Contributor not showing up in toplist #114

Closed bumi closed 5 years ago

bumi commented 5 years ago

Currently I am not showing up in the contributor list though I have 7500 kredits earned (and a 298 kredits balance).

I currently do not have any unconfirmed contributions. This line makes me wonder if contributors without unconfirmed contributions get lost: https://github.com/67P/kredits-web/blob/master/app/services/kredits.js#L49

raucao commented 5 years ago

Ah yes, that's a logical bug for sure!

bumi commented 5 years ago

I am wondering how will we do that when the pagination kicks in...

raucao commented 5 years ago

Load more pages if all contributions on page 1 are unconfirmed.

bumi commented 5 years ago

as far as I can read the code we calculate the balance from the contributions here? if we paginate the contributions we no longer have all the contributions to calculate the balance.

raucao commented 5 years ago

No, the balance is from your totalKreditsEarned plus the sum of kredits from unconfirmed contributions. See kredits service for the details.

Edit: this line specifically: https://github.com/67P/kredits-web/blob/master/app/services/kredits.js#L58

bumi commented 5 years ago

ah, ok. :+1: so we should actually take all contributors from the service and group/count the unconfirmed contributions for those. and always load all unconfirmed contributions?

raucao commented 5 years ago

We can just load more pages initially, in case kredits.contributionsConfirmed is 0 after loading the first page. In any case, it's a luxury problem to have, because that would be a lot of contributions in the last 7 days (currently more than 200).

The fix here could be adding the diff between contributors in the current output and all contributors to that array, and set the unconfirmed balances to 0 for those.