busyorg / busy

Blockchain-based social network where anyone can earn rewards 🚀
https://busy.org/
MIT License
359 stars 252 forks source link

Some custom json ops cause empty activity #1909

Closed emre closed 6 years ago

emre commented 6 years ago

Expected behavior

STEEM blockchain lets accounts to push any type of JSON into custom_json operations. Activity page should show the operation's details.

Since it's impossible to pre-define the structure on this, visualization may be done via tables. (Or as a design decision, busy may ignore the unregistered CustomJSON operations.)

Actual behavior

Activity pages show the operation empty, fails to fill the row.

Example:

screen shot 2018-05-26 at 6 44 54 pm

See related transaction. It happens any type pf custom json except follow/unfollow/ignore/reblog.

How to reproduce

Push a CustomJSON operation to the blockchain. It shouldn't follow the conventions on known custom jsons. (follow/unfollow, mute, etc.)

You will the see the activity page shows a blank entry.

For the reference, here is a python script to reproduce the issue:

from steem import Steem
from steem.transactionbuilder import TransactionBuilder
from steembase import operations
s = Steem(nodes=["https://rpc.buildteam.io"],
          keys=["active_wif"])
account = "emrebeyler"
ops = [
    operations.CustomJson(**{
        "from": account,
        "id": "custom_id",
        "json": [
            'custom_action',
             {
                "custom_key": "custom_value",
            }
        ],
        "required_auths": [],
        "required_posting_auths": [account, ],
    }),
]
tb = TransactionBuilder()
tb.appendOps(ops)
tb.appendSigner(account, "posting")
tb.sign()
tb.broadcast()
emre commented 6 years ago

I might actually work on a possible fix. My proposed solution is just ignoring unfamiliar custom jsons. What do you think?

Sekhmet commented 6 years ago

@bonustrack

Sekhmet commented 6 years ago

I think we can ignore unknown operations.

emre commented 6 years ago

You can see @steemmonsters to see the issue. And all users playing on steemmonsters are affected.

I will create a PR.

bonustrack commented 6 years ago

Instead of ignoring these ops, i would rather display it within a table similar than others unhandled op like this: image

emre commented 6 years ago

Like this:

screen shot 2018-06-26 at 1 14 08 pm

Working on it. Thanks.

bonustrack commented 6 years ago

Yes!