The ninety-ninety rule, again...

in #utopian-io6 years ago

I've written about the ninety-ninety rule before and unfortunately it happened again. Just when my brain goes

reality goes

Just recently @drmake made a commit to visualize the steemmakers curation trail on our website. The intent is to give our backers some more visibility and in a later stage we plan on showing the top followers in a more visible way as designed by @fabiyamada here. As it was his first vue.js / typescript experience there are some things that needed some rework. But after that it should only be a matter of deploying.

Improved code separation and better estimation

Vue.js is designed around the MVVM pattern (Model - View - ViewModel). It's a pattern that can be challenging at first but when applied correctly can save a lot of time and make cooperation a lot easier. Professionally I'm quite fond of using this technique for designing 'big' WPF applications (together with PRISM). IMHO there was not enough separation in the design by @drmake so I fixed that. Another 'issue' was the use of the any type in typescript. noImplicitAny is preferably set to true typescript can catch unintentional errors at design time and makes the code more readable.

While fixing these issues I noticed that the calculations by @drmake assume a voting power of 100% which, in reality, is seldom the case. I had to do some research and extra testing to account for that. There is no direct functionality in steemjs to do this and it requires some basic calculation as outlined here by @stoodkev. I did some further digging to be able to explain the magic numbers and commented those in our code base.

Proxying the request

After these changes only deployment was left, the first 90% was done. But that was where things went completely sideways and another 90% arrived. Once deployed the code did not work, the list didn't show. It took some digging to find out this was the error: "No 'Access-Control-Allow-Origin' header is present on the requested resource". It literally took me many hours to understand the root of this issue and by the time I got that I realized there was not much I could do about it. As it turned out this was an issue because of a cross site request. The trail data is fetched from steemauto and this site did not accept this request once deployed to our side. Almost all information on the internet explains how to modify the backend to fix this error message but in our case it is not our backend so we really can't change it or expect steemauto to change it and request them to trust us. A lot of digging later I found out that proxying the request might fix the issue and that is the current patch in the work. We now rely on a heroku proxy and this seems to work reliable.

Have a look at our Trail page to see the result.

Future work

The heroku proxy is a patch and more a proof of concept on how to bypass / fix the issue. On the longer term we will make a proxy on our own server.

Proof of work done

Repository: https://github.com/JefPatat/SteemMakers/tree/master/website

My github account: https://github.com/JefPatat

Relevant commits: several commits from July 2nd to July 17th: https://github.com/JefPatat/SteemMakers/commits/master

Sort:  
  • It seems like you have a new design, did I miss that information in the post? website/design/Home.html
  • Looks like you gave us a look into your troubleshooting attemps to get this right.

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]

Thanks for the review!

I was appreciating it, looked a lot like what I do. Glad you found the secret sauce.

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

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

Vote for Utopian Witness!

@jefpatat You have received a 100% upvote from @introbot because this post did not use any bidbots and you have not used bidbots in the last 30 days!

Upvoting this comment will help keep this service running.

Coin Marketplace

STEEM 0.20
TRX 0.25
JST 0.039
BTC 97549.65
ETH 3484.99
USDT 1.00
SBD 3.21