This issue was bumped from http://drupal.org/node/6162
If you have multiple pages of comments in a thread, they will get marked as "old" when a user accesses the node, even if they haven't been viewed. This is because comment_num_new() uses the timestamp of the last node access by the user, and when there are multiple pages the node could have been accessed without the comment having been accessed.

I can't really think of a good solution. Here are two options:
1) Label comments "new" based on a timestamp alone (e.g. within the last 24hrs), not when the user last viewed them.
2) Add a timestamp column on the comments table for the last comment view by the user. This would require rewriting parts of the comment module and extra database calls.

I'm sure somebody smarter can think of a better solution.

Comments

catch’s picture

I don't have any great ideas (although "comments as nodes" would cover option 2). This is related to merging 'node_comment_statistics' back in to 'node' I think http://drupal.org/node/148849 - certainly in terms of how keeping track of it would affect performance.

catch’s picture

How about a cookie? With just a "read" (or unread) flag in it for each page of comments. That could work at least for a few minutes/hours reading of a long thread. Reverting to current behaviour longer term for scalability.

catch’s picture

1) Label comments "new" based on a timestamp alone (e.g. within the last 24hrs), not when the user last viewed them.

I'd be very much against this - if you're reading a forum topic that's moving at 10-20 posts an hour, going between threads etc., then it's really important to be able to find the new comments easily when you go back to it (or on long threads at longer time intervals). This would actually make it harder to do so.

2) Add a timestamp column on the comments table for the last comment view by the user. This would require rewriting parts of the comment module and extra database calls.

You'd have to record a timestamp for every user though right? That sounds like it'd add a lot of weight to the comment table. I think this issue is worst during sessions (like navigating multiple paged, threaded comments with new comments on each) - so if there was an efficient way to store each page view in the session to retain the #new markers, then fall back to existing logic in between sessions, that'd solve most of the navigation problems without requiring long term storage of all the viewing data. Maybe.

catch’s picture

Title: "New" comments set as read on viewing any page in a forum thread » All comments marked as read when viewing any page.
Version: 6.x-dev » 7.x-dev
catch’s picture

Status: Active » Closed (duplicate)

marking as duplicate of: http://drupal.org/node/6371 look at that nid!