FIX: Link notification to first unread post (PR #12849)

If a topic with a few posts was posted in a watched category, the created notification would always point to the last post, instead of pointing to the first one.

The root cause is that the query that fetched the first unread post uses ‘TopicUser’ records and those are not created by default for user watching the category.


Isn’t Notification.last making a SQL request everytime you’re calling it? Might be worth storing that in a variable? Especially on the last part of the test where it’s called 3 times

Superseded by #12868.