Steemit.com/Busy.org stop corrupt tags from breaking timeline and author page

in #utopian-io8 years ago (edited)

Commits

Fixes

This fix is related to multiple bugs on Steemit.com and Busy.org, where posts created by 3rd party apps on Steem were breaking both sites.

This issue was marked important and help wanted on the steemit github.

The issue was more critical on steemit than busy as a post with corrupted tag would cause all users following to have their feeds show the error message below.

68747470733a2f2f7667792e6d652f7949655167612e706e67.png

These are two examples of pages that were breaking on Steemit:

https://steemit.com/@ikidnapmyself

https://steemit.com/dngo/@ikidnapmyself/my-awesome-title

I was able to fix it by creating and a new function to filter tags, then applying the filter where tags are used:

export function filterTags(tags) {
    return tags
        .filter(tag => typeof tag === 'string')
        .filter((value, index, self) => value && self.indexOf(value) === index);
}

The first commit on Busy applies the same fix from the steemit commit. Simply filter non-string tags. Only difference is I used lodash as suggested by Sekhmet and Jm90m.

The second commit on Busy was related to the new app on Steemit called Parley. This app uses an object instead of a string for the app name and version, causing posts made on Parley to break the Busy interface.

Here is an example of a post that breaks (still broken as fix not applied on production yet):

https://busy.org/@zer0hedge/20180417t234518101z

This issue was fixed by adding a check for string:

if (typeof postMetaData.app !== 'string') {
  postMetaData.app = '';
}

The above was later changed to a solution using lodash based on feedback from Sekhmet and Jm90m.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the fixes. It has been approved.


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

[utopian-moderator]

.

i also facing this problem. Thank you so much dear for clearing this problem dear @kirkins. You are always helpful and informative dear. I wish your good luck.

thanks for clearing the air.
i had it on my head for some days.

Hey @kirkins! Thank you for the great work you've done!

We're already looking forward to your next contribution!

Fully Decentralized Rewards

We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.

Utopian Witness!

Vote for Utopian Witness! We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

Want to chat? Join us on Discord https://discord.me/utopian-io

Loading...