Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Request to get the replies from a parent_id also returns the parent_id as comment #3767

Closed
4 tasks done
MV-GH opened this issue Jul 29, 2023 · 2 comments · Fixed by #3823
Closed
4 tasks done
Labels
area: api bug Something isn't working

Comments

@MV-GH
Copy link
Contributor

MV-GH commented Jul 29, 2023

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

A request to get replies to a comment also includes the comment again. Found in this post if relevant https://lemmy.ml/post/2568562

Steps to Reproduce

https://lemmy.ml/api/v3/comment/list?max_depth=6&parent_id=2090453&type_=All

the response {"comments":[{"comment":{"id":2090686,"creator_id":838903,"post_id":2568562,"content":"It's not a criticism. It just wasn't to my taste.","removed":false,"published":"2023-07-29T04:45:28.575867","deleted":false,"ap_id":"https://lemmy.ca/comment/1699010","local":false,"path":"0.2088635.2088937.2089235.2089291.2089718.2090453.2090686","distinguished":false,"language_id":37},"creator":{"id":838903,"name":"floofloof","banned":false,"published":"2023-06-16T20:57:24.782101","actor_id":"https://lemmy.ca/u/floofloof","local":false,"deleted":false,"admin":false,"bot_account":false,"instance_id":210},"post":{"id":2568562,"name":"Developer of Reddit is Fun just released an app for Tildes.","url":"https://tildes.net/~tildes/18s2/three_cheers_for_tildes_android_version_is_open_for_alpha_testing_on_the_google_play_store","creator_id":625710,"community_id":16,"removed":false,"locked":false,"published":"2023-07-29T02:45:14.578842","deleted":false,"nsfw":false,"embed_title":"Three Cheers for Tildes (Android version) is open for alpha testing on the Google Play Store - ~tildes","embed_description":"69 comments in the discussion of this post on Tildes","thumbnail_url":"https://lemmy.ml/pictrs/image/9a650d23-04bb-4c5c-ad3f-8032c6c703c2.png","ap_id":"https://lemmy.ml/post/2568562","local":true,"language_id":0,"featured_community":false,"featured_local":false},"community":{"id":16,"name":"technology","title":"Technology","description":"This is the official technology community of Lemmy.ml for all news related to creation and use of technology, and to facilitate civil, meaningful discussion around it.\n\n---\n\nRules:\n\n1: All Lemmy rules apply\n\n2: Do not post low effort posts\n\n3: NEVER post naziped*gore stuff\n\n4: Always post article URLs or their archived version URLs as sources, NOT screenshots. Help the blind users.","removed":false,"published":"2019-04-25T21:58:01.788609","updated":"2023-06-16T08:43:35.744685","deleted":false,"nsfw":false,"actor_id":"https://lemmy.ml/c/technology","local":true,"icon":"https://lemmy.ml/pictrs/image/2QNz7bkA1V.png","hidden":false,"posting_restricted_to_mods":false,"instance_id":394},"counts":{"id":1844199,"comment_id":2090686,"score":1,"upvotes":1,"downvotes":0,"published":"2023-07-29T04:45:28.575867","child_count":0,"hot_rank":1395},"creator_banned_from_community":false,"subscribed":"NotSubscribed","saved":false,"creator_blocked":false},{"comment":{"id":2090453,"creator_id":1145297,"post_id":2568562,"content":"It’s literally the tech bro news site, though, by design. This criticism is ridiculous. YCombinator is the organization that funds so many Silicon Valley tech dreams.","removed":false,"published":"2023-07-29T04:31:10.587558","deleted":false,"ap_id":"https://lemmy.world/comment/1840944","local":false,"path":"0.2088635.2088937.2089235.2089291.2089718.2090453","distinguished":false,"language_id":0},"creator":{"id":1145297,"name":"pbbananaman","banned":false,"published":"2023-06-28T15:35:32.621615","actor_id":"https://lemmy.world/u/pbbananaman","local":false,"deleted":false,"admin":false,"bot_account":false,"instance_id":136816},"post":{"id":2568562,"name":"Developer of Reddit is Fun just released an app for Tildes.","url":"https://tildes.net/~tildes/18s2/three_cheers_for_tildes_android_version_is_open_for_alpha_testing_on_the_google_play_store","creator_id":625710,"community_id":16,"removed":false,"locked":false,"published":"2023-07-29T02:45:14.578842","deleted":false,"nsfw":false,"embed_title":"Three Cheers for Tildes (Android version) is open for alpha testing on the Google Play Store - ~tildes","embed_description":"69 comments in the discussion of this post on Tildes","thumbnail_url":"https://lemmy.ml/pictrs/image/9a650d23-04bb-4c5c-ad3f-8032c6c703c2.png","ap_id":"https://lemmy.ml/post/2568562","local":true,"language_id":0,"featured_community":false,"featured_local":false},"community":{"id":16,"name":"technology","title":"Technology","description":"This is the official technology community of Lemmy.ml for all news related to creation and use of technology, and to facilitate civil, meaningful discussion around it.\n\n---\n\nRules:\n\n1: All Lemmy rules apply\n\n2: Do not post low effort posts\n\n3: NEVER post naziped*gore stuff\n\n4: Always post article URLs or their archived version URLs as sources, NOT screenshots. Help the blind users.","removed":false,"published":"2019-04-25T21:58:01.788609","updated":"2023-06-16T08:43:35.744685","deleted":false,"nsfw":false,"actor_id":"https://lemmy.ml/c/technology","local":true,"icon":"https://lemmy.ml/pictrs/image/2QNz7bkA1V.png","hidden":false,"posting_restricted_to_mods":false,"instance_id":394},"counts":{"id":1843982,"comment_id":2090453,"score":0,"upvotes":1,"downvotes":1,"published":"2023-07-29T04:31:10.587558","child_count":1,"hot_rank":922},"creator_banned_from_community":false,"subscribed":"NotSubscribed","saved":false,"creator_blocked":false}]}

This requests returns the replies to to comment 2090453, which also includes itself again. I believe this is a bug as usually it does not do that.

Technical Details

Jerboa currently assumes each comment has a unique_id, when it tries to insert twice the same comment (twice the same id). It crashes. See LemmyNet/jerboa#1109

Version

0.18.3

Lemmy Instance URL

lemmy.ml

@MV-GH
Copy link
Contributor Author

MV-GH commented Aug 3, 2023

Actually I take that back, from looking the Jerboa code, it seems that it has always return the parent comment too but the order is reversed now. Previously it would return the parent comment always first and the the child comments after that. Now I am not even sure if it has order.

@Mutant
Copy link

Mutant commented Aug 3, 2023

This is caused by #3717 - if the post_id is not supplied, the list of comments is no longer sorted by parent path. Supplying the post_id in the API request will give a consistent (and correct) ordering of comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants