lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

`limit` isnt respected when `max_depth` is used on comments endpoint

Open markcellus opened this issue 2 years ago • 1 comments

  • [x] Did you check to see if this issue already exists?
  • [x] Is this only a single bug? Do not put multiple bugs in one issue.
  • [x] Is this a question or discussion? Don't use this, use https://lemmy.ml/c/lemmy_support .
  • [x] Is this a UI / front end issue? Use the lemmy-ui repo.

Issue Summary

The getComments endpoint doesn't seem to respect the limit when used with max_depth

Steps to Reproduce

  1. Navigate to https://feddit.de/api/v3/comment/list?post_id=745959&type_=All&max_depth=4&limit=1 or curl or whatever
  2. Notice that it returns way more comments than just the 1 I've set in the limit param

Technical details

  • Please post your log: sudo docker-compose logs > lemmy_log.out.
  • What OS are you trying to install lemmy on?
  • Any browser console errors?

markcellus avatar Jun 13 '23 11:06 markcellus

For now this is intended, not sure what the long term resolution is:

https://github.com/LemmyNet/lemmy/blob/5af831c6fad0cd462f6abe3645d8c26b3481bab7/crates/db_views/src/comment_view.rs#L335-L342

kartikynwa avatar Jun 15 '23 04:06 kartikynwa

Closing in favor of https://github.com/LemmyNet/lemmy/issues/4543

Nutomic avatar Mar 15 '24 14:03 Nutomic

Thanks for working on this. I took a look at #4543 issue and doesnt seem related. Was closing this issue and marking it completed a mistake? 🤔

markcellus avatar Mar 15 '24 18:03 markcellus

I believe its part of the same problem which is described in this comment. cc @dessalines

Nutomic avatar Mar 18 '24 09:03 Nutomic

Yes that's correct, the new issue is used to track this now.

dessalines avatar Mar 25 '24 20:03 dessalines