Bugfix for busy.org's Incorrect Payout Schedule

in #utopian-io8 years ago

This is another contribution to busy.org. The fix was simple, but the investigation to get to the fix took time and trial and error.

1. The Issue

From the bug report:

Busy says my payout will release 2 hours ago.
From this message, I can't know whether it is already paid or not paid yet.
Actually, it is not paid yet. It will be paid in 7 hours.

2. The Solution

There was only 1 file changed:

  • src/client/vendor/steemitHelpers.js

2.1. src/client/vendor/steemitHelpers.js

image.png

  • Appended '.000Z' to cashoutInTime

3. Investigation

Initially, the solution I thought that could fix the bug was to to provide explicitly a value for the option now of intl.formatRelative() API.

image.png

However, after further investigation, it seems that the fix would take a lot of fixes:

  1. Where will the now value be instantiated?
  2. How will the value of now be passed?

Which eventually led me to steemitHelpers.js.

To arrive at the solution, I had to provide additional codes of printing out of values of cashoutInTime and add values of the calculation of the current time:

image.png

And had to modify steemitHellpers.js like these:

image.png

These two changes gave me these:

image.png

4. Demonstration

Here's a demo of the fix showing the payout schedule from the feed, full-story post, and then comparing it with the actual payout schedule displayed in steemit.com:

Feed Payout Sched

feed_payout_schedule

Full Story Payout Sched

fullstory_payout_sched

Steemit Payout Sched

steemit_payout_sched



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

1up-logo.png


You've got a 1UP from the @utopian-1up curation trail. 22 Utopians have upvoted your quality contribution to the open source community.

Follow the trail for profitable curation of quality content on SteemAuto.

@utopian-1up is neither organized nor endorsed by Utopian.io!

Great work!

Thank you for raising the issue. :)

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Great job! I've always believed that the most elegant solutions are the simplest ones. Nice job spotting the error. It would've taken me far longer to come up with the same solution, I feel.

Thank you @jedau. Well, actually it did take me time to come up with the fix. :D

There just seems to be a need for space - a span of time - between the problem and you before you are able to come up with a solution, so I've learned. Lol.

Haha! Good to know! Hopefully we would be able to work on the same open source project in the future :)

Hey, man. I found out that the issue persists and commented on the Github issue instead of creating a new one. Let me know if you need me to create a new issue on Utopian instead of reopening the old one.

BTW, what category in Utopian did you use to create a "Bug Fix" post?

Hello @jedau, which post did you test this on? I'll check. I also suggest you create a new bug hunting/issue for it in github or utopian.

Perhaps the nature is different. You can also submit a fix in utopian via the development category.

I saw this earlier while viewing my profile. Scroll down to the NaNotes 5 post to see it. Once you confirm it, I'm happy to create a new issue. I just wanted to see if it's not connected to the earlier issue.

Hey @eastmael I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thanks you.