Beem: Unable to get replies to an account via discussions.Replies_by_last_update

Project Information

A GitHub issue as well as a PR to fix it were created. The PR was accepted/merged by the PO and will be part of the next beem release.

Expected behavior

discussions.Replies_by_last_update() should return a list of the last replies to posts/comments from a given author

Actual behavior

discussions.Replies_by_last_update() could not be used to get a list of the last replies to posts/comments from a given author. The list of Comment instances returned were not replies to the given author.

How to reproduce

from beem.discussions import Replies_by_last_update, Query
query = {'limit': 10, 'start_parent_author': 'stmdev',
         'start_permlink': None, 'start_author': None}
replies = Replies_by_last_update(query)
for reply in replies:
    print(reply)

Output:

<Comment @bonanza-kreep/agrotechfarm-presents-a-cutting-edge-smart-farming-solution>
<Comment @pizzaboy77/song-challenge-tag-1-30>
<Comment @w6lk3r/k-2018-6-2-11-21-57>
<Comment @ram2144/3wfp2n-punch>
<Comment @statsexpert/daily-top-posts-in-category-nature-on-2018-07-17>
<Comment @carlsmart303/9y5xb-travel>
<Comment @sahelmakrani/saud-binmazi>
<Comment @revia/kisah-seorang-petani-6851709cbae9b>
<Comment @fingersik/decentralizationtotherescuedecenternetthevisionpt1of6-qbd77zigc6>
<Comment @gaiablock/an-appetizer-of-cpos-consensus-algorithm-by-gaiaworld-gamechain>

Neither of these posts are replies to the author in the query.


The reason is that the start_parent_author parameter was not propagated to the RPC call:
https://developers.steem.io/apidefinitions/#tags_api.get_replies_by_last_update

With the fix in place, the script above returns the correct results:

<Comment @utopian-io/re-beem-account-history-fails-with-float-division-by-zero-exception-20180630t011007z>
<Comment @fego/re-stmdev-beem-account-history-fails-with-float-division-by-zero-exception-20180628t201140335z>
<Comment @adolmac/re-stmdev-beem-account-history-fails-with-float-division-by-zero-exception-20180628t182846176z>
<Comment @fego/re-stmdev-beem-race-condition-slowing-down-multi-threaded-blockchain-stream-20180626t083435603z>
<Comment @utopian-io/re-beem-race-condition-slowing-down-multi-threaded-blockchain-stream-20180626t065008z>
<Comment @utopian-io/re-beem-documentation-update-20180625t004707z>
<Comment @ms10398/re-stmdev-beem-documentation-update-20180622t132910715z>
<Comment @utopian-io/re-beem-blockchain-getallaccounts-fails-for-limit-steps-on-appbase-20180616t164008z>
<Comment @utopian-io/re-beem-blockchain-getallaccounts-returns-duplicate-entries-20180616t151508z>
<Comment @jestemkioskiem/re-stmdev-beem-blockchain-getallaccounts-fails-for-limit-steps-on-appbase-20180615t235133288z>

Environment

  • beem master at rev. e522373 / version 0.19.48
  • python 3.6.5

GitHub Account

https://github.com/crokkon

H2
H3
H4
3 columns
2 columns
1 column
4 Comments