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

Make distinction between CommentReplies and PostReplies in /api/v3/user/unread_count #3601

Open
4 tasks done
robertnabbe opened this issue Jul 12, 2023 · 1 comment
Open
4 tasks done
Labels
area: api enhancement New feature or request

Comments

@robertnabbe
Copy link

robertnabbe commented Jul 12, 2023

Requirements

  • Is this a feature request? 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 feature request? Do not put multiple feature requests in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

In getting the unread_counts for a user (the endpoints returns { replies: int, mentions: int, private_messages: int }, see

let replies = CommentReplyView::get_unread_replies(&mut context.pool(), person_id).await?;
let mentions = PersonMentionView::get_unread_mentions(&mut context.pool(), person_id).await?;
let private_messages =
PrivateMessageView::get_unread_messages(&mut context.pool(), person_id).await?;
), there's currently no distinction made between comment replies, and post replies (and are thus counted together).

Describe the solution you'd like.

It would be helpful to add a post_replies property to the returned object that shows the count for the amount of unread post replies a user has.

Subsequently, this would alse mean that the replies property only counts the current user's unread comment replies.

Describe alternatives you've considered.

Currently, for Voyager we're making the distinction after the data fetch, by iterating over all unread comments and determining whether a reply is to a comment or to a post, and tallying the unread amounts that way.

It would be far simpler to simply handle this on the BE, and add an additional count (and 'fix' the current replies count) for just 'post' replies.

Additional context

No response

@dessalines
Copy link
Member

What's the value, or why does it matter to differentiate them?

It would entail adding a column to the comment_reply table, but I don't see why you'd need to distinguish between them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants