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

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@kirkins·
0.000 HBD
Steemit.com/Busy.org stop corrupt tags from breaking timeline and author page
## Commits
- [Steemit PR - Filter non-string tags](https://github.com/steemit/condenser/pull/2705)
- [Busy PR #1 - Filter non-string tags](https://github.com/busyorg/busy/pull/1697)
- [Busy PR #2 - Filter non-string app attribute - *Specifically Parley*](https://github.com/busyorg/busy/pull/1722)

## 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](https://github.com/steemit/condenser/issues/2693) 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](https://cdn.utopian.io/posts/a096ec67df6c76fc475df50a201ef0807a3e68747470733a2f2f7667792e6d652f7949655167612e706e67.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:

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

<hr/>

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](https://www.parley.io/). 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:

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

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

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@kirkins/steemit-com-busy-org-fix-posts-that-break-timeline-and-author-page">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,