Closed singhpratyush closed 5 years ago
This API call simply exposes our underlying database and allows you to iterate through it via an API call. The reason votes for another account are being returned is because when this was queried, curie's vote on janicechua/w08u7lz0
was their last vote and the next object in the database was a vote for another account.
No, this call does not allow for you to query their most recent vote. In fact, the call does not even guarantee that the last vote seen for a particular author is their most recent. The last vote is the last comment, sorted by comment id. While that means it will always be a recent comment, it does not mean it is the last comment.
If you want user activity based on time, the account history api is a better tool for the job.
I updated the wording on the dev portal slightly to make this nuanced distinction a bit clearer. https://github.com/steemit/devportal/pull/414
Thanks for the response, @mvandeberg. It makes sense.
Currently, I am using the account history API. But an operation such as fetching the latest 50 votes by the account requires iterating through a lot of data which is not relevant. And pagination on the top of it is even more costly - you need to scroll through the results until you reach some permlink and go for the next 50 votes.
The get_account_votes
method was also very inefficient. But if it had a pagination parameter, things would become much better.
While using the
list_votes
method, I noticed this unexpected behavior. As seen in the following request, votes by accounts other than curie are also returned (faurntezil
here). Also, the date goes back to2016-11-05T08:21:48
from2019-01-09T06:44:30
.I am not able to understand this behavior (in case if it's not a bug). Is it possible to use the
list_votes
API to query the votes in reverse order (i.e. latest first)?Please let me know if I need to provide more info.
Method documentation - https://developers.steem.io/apidefinitions/#database_api.list_votes