Bugfix for busy.org's Incorrect Payout Schedule

Words
229
Reading
2 min
9y
Listen to this post
~2 min

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