You are viewing a single comment's thread from:

RE: comment.upvote doesn't work on some cases at Beem

in #utopian-io6 years ago

ah, you got me excited there for a while. :)
I tried to reproduce it but failed to do so on a random comment with 0 in upvote. Then I tested your snippet above and got the same result as you...

reply = main_comment.reply("test-comment", author=ACCOUNT)
reply will not hold a post identifier, but instead a post summary looking like this:
{'expiration': '2018-07-10T21:22:20', 'ref_block_num': 12194, 'ref_block_prefix': 472120501, 'operations': [['comment', {'parent_author': 'danielsaori', 'parent_permlink': 're-alimamasstory-re-danielsaori-steemit-comment-challenge-33-usd5-sbd-2-x-200-sp-1-weeks-delegation-comment-like-a-champ-grow-your-blog-like-a-champ-20180628t195834418z', 'author': 'dorabot', 'permlink': 're-re-alimamasstory-re-danielsaori-steemit-comment-challenge-33-usd5-sbd-2-x-200-sp-1-weeks-delegation-comment-like-a-champ-grow-your-blog-like-a-champ-20180628t195834418z-20180710t212150z', 'title': '', 'body': 'test-comment', 'json_metadata': '{"app": "beem/0.19.47"}'}]], 'extensions': [], 'signatures': ['207b644f450c33697703ffae1a880831aec9f99344e73771a03b0537971885cef755de32b98f48942896747110ef31e773e09fe7475ca5fbcf09bdcfbf03d77b92']}

And using this in Comment(reply) will return None of class Comment.
Preferably this should raise an exception instead

Then using this None Comment, stored in reply_comment with the .upvote method, will raise VotingInvalidOnArchivedPost.
Preferably it should raise a different exception

My reply with two potential bugs... 😀

Sort:  

Somehow I forgot updating the reproduce script here, updated now.

    reply_comment = Comment(reply["operations"][0][1])

works fine. Comment class can also work with op data.

holger already fixed the issue. :)

Btw, it's a deterministic bug, any chance you're using .vote instead of upvote?

ah, I checked github now. I see Holger fixed it, and I see it was only reproducable on a newly created Comments.

The problem I've seen is completely random. Could be 1 in a 1000 upvotes that just silently fails. Actually the .upvote method returns a valid vote, so no error, but it is not added to the blockchain. Few users talked about it on Discord.
It doesn't necessarily need to be linked to Beem, but I had users complaining just after switching to beem. Need some more time to try to debug that one... :)

Coin Marketplace

STEEM 0.27
TRX 0.12
JST 0.032
BTC 56858.44
ETH 2919.14
USDT 1.00
SBD 3.60