Skip to content

Changes to list_comments proposed by Andrzej L.

Dariusz Kędzierski requested to merge dk-list-comments-improvements-cont into develop

Tests will fail for this branch. To be fixed.

As @ABW proposed: I'd like to propose some changes to how database_api.list_comments works in corner cases. The old implementation in fat node seemed to follow natural results of implementation in multiindex with no regard to the meaning/use scenarios of the API. Since implementation now is completely different, what was natural then is problematic to replicate at the moment. We did replicate old behaviour (with one exception that was broken in fat node), however if we make the following changes it can help simplify and speed up the queries ( @dkedzierski ) and possibly make life of callers easier (I don't know who could check that: @dan @gandalf @hbehar ? I suspect that in some cases callers have to filter results of the call in order to drop excess posts they never intended to ask for, yet they got them anyway - see proposed changes below).

by_root (apparent intended use: list posts from given discussion) now: root post can be left blank change: valid root post is mandatory now: when limit is not yet reached it returns also posts bound to discussions started later than given root post (which caller likely has to filter out) change: only returns posts from requested discussion

by_parent (apparent intended use: list replies to given post) now: parent post can be left blank; parent post can be invalid (returns posts of authors that happen to have "bigger" name and if author is valid the same with permlink) change: valid parent post is mandatory now: when limit is reached it returns also replies to posts of the same author but with "bigger" permlink and if that is not enough also replies to posts of "bigger" authors (caller most likely filters them out) change: only returns replies to given parent post

by_last_update (apparent intended use: list replies to posts of given author; last update used for paging to start with newest replies and continue with older in next call) now: parent author can be left blank; parent author can be invalid (returns replies to authors that happen to have "bigger" name) change: valid parent author is mandatory now: when limit is reached it returns also replies to posts of authors with "bigger" names (caller most likely filters them out) change: only returns replies to posts of given author

by_author_last_update (apparent intended use: list posts of given author; last update used for paging to start with newest posts and continue with older in next call) it has problems similar to that of by_last_update; also that call never worked in fat node since despite having correct index the call used the same one as in by_last_update (we now use proper intended index, returning results vastly different from failed original, but in the same manner as by_last_update so we can make similar changes for the better)

Edited by Andrzej Lisak

Merge request reports

Loading