blockchainstudio avatar

Nitrous tag order bug and fix

blockchainstudio

Published: 27 Jul 2019 › Updated: 27 Jul 2019Nitrous tag order bug and fix

Nitrous tag order bug and fix

Project Information

Issue: https://github.com/steem-engine-exchange/nitrous/issues/56

I personally contacted the PO and the bug is acknowledged. I found the exact cause of the problem and made a PR which has been already merged.

PR: https://github.com/steem-engine-exchange/nitrous/pull/57

Expected behavior

Tag order should be preserved as the order a user used.

Actual behavior

Tag order is tangled when more than 8 tags are used.

The category (first tag) cannot be even changed later, so this is a serious issue.

How to reproduce

  • Visit https://www.palnet.io or any Nitrous
  • Use more than 8 tags
  • tag order is tangled (mostly alphabetically) so even the main tag (category) can be randomly selected.
  • Browser/App version: Any
  • Operating system: Any

Recording Of The Bug

When more than 5 tags are used, the tag (even including the main tag, called category) is sorted alphabetically.

Trying to post with this order of tags on palnet.io

https://busy.org/@guest123/pob-is-dead
alphabetically ordered and palnet is inserted in a random position.

Another example.

palnet is inserted in 4th position (instead of 3rd position) which shows it's quite random.
https://busy.org/@guest123/3y2xik-test

Cause and Fix

should use OrderedSet instead of Set

This was difficult to find, since standard JS library Set preserves the order,

and immutable library Set also preserve the order up to 8 elements! Why up to 8!

Anyway, now the problem has been resolved. Enjoy the untangled tag order in the dead PoB society :)

previously tag order is tangled. https://busy.org/@guest123/j1tbe-test

fixed. You can also see duplicated tag is automatically removed, and APP_NAME is added to the last position if it's not added by users. https://busy.org/@guest123/tag-order-test

GitHub Account

https://github.com/economicstudio

Leave Nitrous tag order bug and fix to:

Written by

economist / dev / creator of @hivefinex, @steemfinex, @scotauto, @scotview, @finex, @gomdory

Read more #utopian-io posts


Best Posts From blockchainstudio

We have not curated any of blockchainstudio's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From blockchainstudio