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

Unread comments count and number of comments don't match #136

Open
nitely opened this issue Sep 30, 2016 · 9 comments
Open

Unread comments count and number of comments don't match #136

nitely opened this issue Sep 30, 2016 · 9 comments
Labels

Comments

@nitely
Copy link
Owner

nitely commented Sep 30, 2016

Basically, topic's actions (topic pinned, etc) are not being counted as comments and that is ok, but... actions are actually comments and that creates some issues.

The unread comments count (the red highlighting when there's a new comment) feature relies on the bookmark and the comment count, it does something like (comments_count - bookmark.comment_number) to calculate if there is a new comment. When there is an action posted, the bookmark.comment_number will be greater than comments_count, so the next new comment won't be counted as unread.

There are three ways of fixing this thing: 1. add a post_count field to track all kind of posts (comments and actions) and calculate the unread count (something like actions_count won't quite work: see #131) or 2. make the unread comments count an app (ie: extra join to a OneToOne table) or 3. decouple actions from comments somehow (still requires a post_count field to handle deleted comments).

👍 to option 1.

Reported by @alesdotio here.

@nitely nitely added the bug label Sep 30, 2016
@nitely
Copy link
Owner Author

nitely commented Oct 1, 2016

OK, I'll go with option 1 coz it's required regardless (ie: to handle deleted comments count).

But I think decoupling actions from comments would be really cool, so they don't count as page items. Also, styling them ala github would be great!

@alesdotio
Copy link
Contributor

Will deleted comments not count towards the comment count any more? If so, could we also add an option to not show them in the topic at all?

@nitely
Copy link
Owner Author

nitely commented Oct 1, 2016

Will deleted comments not count towards the comment count any more?

Not sure, but probably.

If so, could we also add an option to not show them in the topic at all?

Nop. That would break notifications and the bookmarking.

@nitely
Copy link
Owner Author

nitely commented Oct 1, 2016

Just checked, the bookmark can be updated to comment_number - 1. The notifications are trickier, if the there is a mention then it's broken anyway (it takes the user to a deleted comment), if it's a new comment then it can be updated to the next comment.

So it can be done. It adds a bunch of complexity though. IMHO, the only upside of doing this is so deleted comments are not page items, but other than that I don't see why it would be a good idea.

@nitely
Copy link
Owner Author

nitely commented Oct 1, 2016

We could just skip them whle rendering, maybe that's what you meant. That can be done.

@alesdotio
Copy link
Contributor

That'w what I do but then the count and pagination is off.

@nitely
Copy link
Owner Author

nitely commented Oct 1, 2016

I meant literally skip them while rendering (ie: {% if comment.is_removed %}). The problem is if all comments are deleted in a given page then that page will be empty, or if there are too many deleted comments, it may look weird.

If you filter them out in the database query, that will break many things.

@alesdotio
Copy link
Contributor

Yeah, it works ok-ish with just hiding them.

Anyway, any chance of fixing the count issue?

@nitely
Copy link
Owner Author

nitely commented Nov 5, 2016

Yes, I will try to get it done this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants