[Bug fix] Incorrect vote value due to incorrect voting power

in utopian-io •  7 months ago  (edited)

Project Information

This is not just a bug reporting. I've fixed the code and finished testing. Pull request is also made.

Expected behavior

Vote value should be shown correctly.

Actual behavior

Vote value is shown incorrectly, e.g., $0 for Ned, who just became an Orca a couple of days ago and his last vote was on 2018-11-14.

This incorrect financial information may lead users to lose their interests in voting and any activity on Steemit.

How to reproduce

  • Browser: Any desktop browser (or desktop mode in mobile browser)
  • Operating system: Any

Recording Of The Bug

https://busy.org/@ned Before the fix

https://steemd.com/@ned

Cause of the bug and fix

The voting power Steem API provides is the voting power updated on the last vote. Thus to get the correct voting power, we need to calculate the time passed since the last vote and adjust the actual voting power. Busy.org doesn't use that update for the vote value. I made a fix and a pull request: https://github.com/busyorg/busy/pull/2140

After the fix (on my local devserver) See now Ned has some vote value :)

GitHub Account

https://github.com/economicstudio

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thanks for your contribution @blockchainstudio

I can see this issue is present both on busy.org and staging.busy.org (they seem to be on the same version, but wanted to check anyway) if you didn't already know busy.org provides a version number within their settings area, including this in your post would only provide further value to your reports :)

It's great to see that you've added an issue on GitHub and even a pull request to resolve the issue, did you know that you can score higher with Utopian if you wait until the issue has been acknowledged by the project owner before submitting your contribution?

Overall, the issue was easy to understand and as your steps only required one line, no trouble here. With that said I would have liked to have seen so more detail in the explanation surrounding the issue, for example, within your fix you mentioned that you need to make adjustments to get the actual voting power, how did it get to a point where it would be calculated as zero? Also, what would be the cause that other accounts would be affected by this too? Are all accounts currently affected by this? I believe that providing this information you would be able to provide more value to the readers of this report, or maybe I'm just interested to know ;)

Overall, it's great to see that you've both identified the issue and provided a potential fix through a pull request. I see that you contribute to busy quite a lot? Have you had a chance to look through any of the other projects on our whitelist?

Thanks again for your contribution and I apologize for so many questions haha, look for your contributions in the future.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hi @tobias-g, thank you so much for your review and comment.

did you know that you can score higher with Utopian if you wait until the issue has been acknowledged by the project owner before submitting your contribution?

Actually I didn't know that and thanks a lot for this tip! Last time interestingly, it was merged before the review (by a different reviewer) even though I posted the same way :) But this time you came quite early :)

I'll post after the fix is merged next time. Thanks!

No problem :) Also, just so you know, you could potentially add bug fixes within the development category instead of in bugs-hunting. I would recommend this when you carry out larger, more complex fixes. I think in this case, with the number of additions made, this is perfect for the bug-hunting category. One to remember for the future :)

Thanks for the additional tip. Yes I actually know dev category and since this is simple as you mentioned, that's why I submitted as bug-hunting :)

Actually, I have a question. What if the bug is already reported but there is no fix and I made a fix. Then is it eligible for bug-hunting category?

In the scenario where a bug has already been reported and you make a fix, this would be a contribution that would fall under the development category. The main purpose of the bug-hunting category is for QA individuals to seek and report issues, however it's always great to see a little more added value to the project through a pull request :)

Thank you for your answer. That's what I expected. By the way, then if it's a simple bug fix, at least it can still be accepted under the dev category? Of course, I don't expect high score, but at least it'd be good to be accepted.

Yes, you can submit smaller bug fixes into development, just explain it well, the reasons it occurred and how you resolved it. As you say, you they may not always be high scores due to the amount of work required, but they're definitely valid contributions in that category.

Thanks! But it says on https://join.utopian.io/guidelines/

"Submissions should include a comprehensible commit history. Projects or updates submitted in a single commit will not be considered for potential reward."

Fortunately, I have a multiple commits, but I still wonder what's the exact rule. You know in some cases, one commit can be very critical.

Thank you for your review, @tobias-g! Keep up the good work!

Summary in Korean: 네드가 혹시 보팅가치가 $0.00으로 찍혀서 속상해서 보팅도 안하고 글도 안 쓰나 싶어서 고쳐주었습니다ㅎㅎ 원인은 Steem API가 주는 보팅파워가 마지막에 보팅한 시점 기준이라 진짜 보팅 파워는 지난시간 계산해서 재계산을 해야하거든요ㅠㅠ 그걸 안해줬네요. 희한하게 보팅파워는 제대로 해놓고 보팅가치는 그렇게 안해놨더라고요. 사실 효율적으로 하려면 코드를 몇군데 바꾸어야해서 같은 페이지에서 보팅파워를 두번 불러오는 비효율은 있는데 이미 로컬에 가져온 정보를 쓰는거라 큰 비효율은 아니고 부정확한거 보단 나으니 그냥 간단하게 고쳤습니다.

아무튼 그동안 보팅을 오래 쉬셨을 때 특히 스파 양이 많거나 파워업등을 대규모로 해서 변동이 클 경우 잘못된 정도가 무시못할 수준이었을텐데 이거 반영되면 고쳐지겠습니다. 깃허브에 수정요청해두었습니다.

ps. 사실 수정할게 하나 더 있긴한데(특히 네드같은 경우 적용해야할) 깜빡하고 이미 올린 상태고 이부분은 어차피 그와 독립적으로 수정을 해야하긴 하는 부분이라 따로 하나 더 쓰는게 나을 것 같습니다.

덕분에 busy.org가 점점 좋아지고 있네요.ㅎㅎ 감사합니다. 덕분에 비지를 사용하며 익숙해지고 있습니다.

오늘 busy PR를 3개 했네요ㅎㅎ busy직원보다 더 열심히 일한듯ㅎㅎ

곰돌이가 @anpigon님의 소중한 댓글에 $0.018을 보팅해서 $0.005을 살려드리고 가요. 곰돌이가 지금까지 총 2339번 $29.317을 보팅해서 $29.163을 구했습니다. 새해 복 많이 받으세요~~! @gomdory 곰도뤼~


@blockchainstudio님 곰돌이가 5.6배로 보팅해드리고 가요~! 영차~

짱짱맨 호출에 응답하여 보팅하였습니다.

Hi @blockchainstudio!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @blockchainstudio!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!