steem icon indicating copy to clipboard operation
steem copied to clipboard

Potential bug in MIRA version of follow plugin

Open Gandalf-the-Grey opened this issue 6 years ago • 2 comments

It's possible that if testnet is running with MIRA, there may be a bug in the follow plugin.

steemit/condenser#3438

Gandalf-the-Grey avatar Jul 17 '19 10:07 Gandalf-the-Grey

As far as I know, we are deprecating tags and follow plugin in favor of using a hivemind solution. There has been known issues (#3342) and we are recommending you don't run these plugins anymore.

sgerbino avatar Jul 17 '19 15:07 sgerbino

Gandalf's OP:

[HF21 Testnet] Blog posts are missing

Well, not sure if that's anything testnet related (out of scope of HF21) it just appeared during operations on testnet.

I've created three posts:

post_comment gtg gtg-sps-1 "" sps "[SPS] Performance Improvements R&D" "https://www.youtube.com/watch?v=YRwHrVVU2NA" "" true
post_comment gtg gtg-sps-2 "" sps "[SPS] Marketing efforts" "https://www.youtube.com/watch?v=IYMNvHV1V4E" "" true
post_comment gtg gtg-sps-3 "" sps "[SPS] Return to the pool" "https://www.youtube.com/watch?v=vAuOfRRmtSc" "" true

https://condensertestnet.steemitdev.com/@gtg

Shows only first one. If anything I would expect to miss older posts, but in this case only first one, i.e. the oldest one is visible.

All posts can be accessed without problems (but it require me to manually type in the permlink into browser) https://condensertestnet.steemitdev.com/sps/@gtg/gtg-sps-1 https://condensertestnet.steemitdev.com/sps/@gtg/gtg-sps-2 https://condensertestnet.steemitdev.com/sps/@gtg/gtg-sps-3


Testing

http -j post https://testnet.steemitdev.com/ jsonrpc=2.0 id=1 method=condenser_api.get_state params:='["@gtg"]'

returns only 1 entry in blog key of account gtg


http -j post https://testnet.steemitdev.com jsonrpc=2.0 id=1 method=condenser_api.get_discussions_by_author_before_date params:='["gtg","","2128-03-20T20:27:30",10]'

reveals all 3 posts as expected


http -j post https://testnet.steemitdev.com jsonrpc=2.0 id=1 method=condenser_api.get_blog_entries params:='["gtg", 5, 5]'

returns only one (gtg-sps-1) post. (This method is used internally by get_state)


Based on:

https://github.com/steemit/steem/blob/5486f77a2fba31bbf9dbc360485b1f9f5638e80b/libraries/plugins/apis/condenser_api/condenser_api.cpp#L362

            }
            else if( part[1].size() == 0 || part[1] == "blog" )
            {
               if( _follow_api )
               {
                  auto blog = _follow_api->get_blog_entries( { eacnt.name, 0, 20 } ).blog;
                  eacnt.blog = vector<string>();
                  eacnt.blog->reserve(blog.size());
                  for( const auto& b: blog )
                  {
                     const auto link = b.author + "/" + b.permlink;
                     eacnt.blog->push_back( link );
                     _state.content[ link ] = tags::discussion( _db.get_comment( b.author, b.permlink ), _db );
                     set_pending_payout( _state.content[ link ] );
                     if( b.reblog_on > time_point_sec() )
                     {
                        _state.content[ link ].first_reblogged_on = b.reblog_on;
                     }
                  }
               }
            }

It seems like follow_api is indeed enabled, otherwise we should expect no posts to be returned. On mainnet, hive serves these APIs. It's possible that if testnet is running with MIRA, there may be a bug in the follow plugin.


Possibly irrelevant but I couldn't figure out the params for these calls:

http -j post https://testnet.steemitdev.com/ jsonrpc=2.0 id=1 method=condenser_api.get_discussions_by_blog params:='{"tag":"gtg"}'

Bad Cast:Invalid cast from object_type to Array

http -j post https://testnet.steemitdev.com/ jsonrpc=2.0 id=1 method=condenser_api.get_discussions_by_blog params:='["gtg"]'

Bad Cast:Invalid cast from type 'string_type' to Object

roadscape avatar Jul 17 '19 15:07 roadscape