XF 2.2 Clues on Browser Message Read issue

chris p

Member
We've had some instances where user's browsers fail to mark a thread as read. It gets stuck in the browser's cache (I think) and refuses to let go, even with edits and further replies. I would have written this off except it's now happened to me a couple of times on two different browsers. I found that by clearing cache, the problem goes away.

Can anyone point me to somewhere that I can start researching this. I don't even know what table may be involved, but I'm presuming there is server side code and data related to this since after clearing the history, the thread was immediately marked as read on the Firefox I tested that on. It's also happened on a current Safari and I've not cleared history there so I had a test bed to debug this.
 
Solution
We've had some instances where user's browsers fail to mark a thread as read. It gets stuck in the browser's cache (I think) and refuses to let go, even with edits and further replies. I would have written this off except it's now happened to me a couple of times on two different browsers. I found that by clearing cache, the problem goes away.

Can anyone point me to somewhere that I can start researching this. I don't even know what table may be involved, but I'm presuming there is server side code and data related to this since after clearing the history, the thread was immediately marked as read on the Firefox I tested that on. It's also happened on a current Safari and I've not cleared history there so I had a test bed to debug...
I would add to this that the read flag isn't cleared if the thread was moved to a different node either. The original threads that triggered my question were not moved threads though, and the moved thread issue is predicable to mods, thus explainable to users.

Additional info on this is that I've had one thread sitting there for over 24 hours that has even been replied to again, yet is still showing as unread to one of my browsers after having been read numerous times.

The issue is somewhat critical to us since users are converting from a primitive wwwboard and everything is a personal affront to them, just having icons makes them see red. Other users try to help by explaining how you know what you've read or not (bold thread title and brash New text block) and those helpers feel like they will be perceived as liars for giving false information when one of these anomalies appears. In reality, this problem occurs very infrequently but just once is enough to raise a flurry of complaints.
 
We've had some instances where user's browsers fail to mark a thread as read. It gets stuck in the browser's cache (I think) and refuses to let go, even with edits and further replies. I would have written this off except it's now happened to me a couple of times on two different browsers. I found that by clearing cache, the problem goes away.

Can anyone point me to somewhere that I can start researching this. I don't even know what table may be involved, but I'm presuming there is server side code and data related to this since after clearing the history, the thread was immediately marked as read on the Firefox I tested that on. It's also happened on a current Safari and I've not cleared history there so I had a test bed to debug this.
I now see why no one has answered. This is a conceptual bug in my own addon, so no one would have seen this problem. It has to do with how XF decides a thread has been read. For a thread to be marked as read, XF appears to only look to the last reply in the thread, if that last post is not New, it doesn't trigger the thread to be marked as read. This is an appropriate assumption unless you mess with how the posts are reordered in the thread. My addon reorders posts to appear under who was replied to, so new posts may not fall at the end of the thread. The mods can decide if this should be deleted, or if the awareness I've come to would be useful to someone else messing with the ordering of posts in a thread. It's certainly a big gotcha if you are doing something like this.

Edit: As long as this thread remains, I'll add that the solution to this for anyone else changing the post order in XF (which implies they are writing an addon to do that), you modify Thread.php where it checks last_post_date and instead provide it a date from looping through the posts checking for the highest date.
 
Last edited:
Solution
Top Bottom