I'm writing custom code to render the user PM inbox, so perhaps this only occurs in non-standard use cases, but I thought I'd report this issue anyway.
When a new thread gets started, all members get added to it via PrivateMessageThread::addMember().
For each member added to the thread, the last access timestamp is set to the current timestamp.
Unless there is a delay in the PHP execution, the "updated" timestamp for the PrivateMessageThread entity will be set to the same (current) timestamp.
However, when the PrivateMessageThreadViewBuilder class decides to set the 'unread-thread' class, it only checks if $last_access_time is smaller than $newest_message_timestamp.
In the case where a user receives a new PM thread, and the thread renders for the very first time for this user, this check does not add the 'unread-thread' class, even though it should.
This can be fixed by checking whether last_access_time <= $newest_message_timestamp, instead of just <.
Alternatively, if a new PrivateMessageThreadAccessTime entity gets created, the timestamp could be set to 0 instead of current time, since the user hasn't actually accessed the thread yet anyway. Not sure if this has unwanted consequences elsewhere though...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | if_a_user_has_not_yet-2895876-2.patch | 683 bytes | svendecabooter |
Comments
Comment #2
svendecabooterAdded a patch that fixes this flaw for me.
Comment #4
jaypanThank you, the patch has been applied and will become part of the next release.