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

in #utopian-io6 years ago

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

Sort:  

Hello @stmdev,

Great work!!
I loved your findings, and fix.
It was a crucial addition to the project
Your post was formal and properly stating the use cases of the Project you're contributing. This makes it easy for others to understand.

Your Fix was merged successfully and your input helped make this project more awesome, This is why I am Staff-picking your report.

Please continue to post great bugs on Utopian :) in future as well.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @stmdev
Thanks for contributing on Utopian.
Congratulations! Your contribution was Staff Picked to receive a maximum vote for the bug-hunting category on Utopian for being of significant value to the project and the open source community.

We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations @stmdev! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of posts published

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - The results, the winners and the prizes

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.027
BTC 60063.85
ETH 2313.06
USDT 1.00
SBD 2.46