Make Busy.org work better in areas with slow connection

in #utopian-io6 years ago (edited)

Related pull request.

This change was to fix the browsing experience for those with a very slow Internet connection.

When I would use busy from a certain room in my apartment (the part with the slowest Internet). I found the navigation would load but not the content itself. Where as steemit.com would take a long time but still eventually load.

I looked through the reported errors and found Steem user @dodybireuen had reported many people in Indonesia are experiencing the problem:

Untitled.png

It is relatively hard to re-create the problem on fast wifi, I even used Chrome's network tools to simulate "slow 3g" which still wasn't slow enough to trigger the bug.

Screenshot from 2018-03-13 10-40-09.png

But on my own slow wifi I ended up finding the following error messages in the console:

37183585-cf8272de-2304-11e8-9a8d-b456e9c64a16.png

In the end it was related to Busy assuming that if the front-end hadn't received a response within 5 seconds an error had occurred (which would be true on fast internet).

With some help from @Sekhmet, developer at Busy, I was able to adjust that time from 5 seconds to 15:

const options = {
  timeout: 15000,
};

const steemUrl = process.env.STEEMJS_URL || 'https://api.steemit.com';

const client = createClient(steemUrl, options);

It fixed the problem with my slow wifi at my house so hopefully it does the same for others!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

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

Hey @kirkins 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

Coin Marketplace

STEEM 0.29
TRX 0.11
JST 0.030
BTC 68362.52
ETH 3747.89
USDT 1.00
SBD 3.66