The subject message is appended when activeChat.readUpTo() returns nothing. Borogove returns null when there is no readUpToId on the chat, this would be the case where you’ve actually read nothing.
It also returns null if there is a readUpToId but it can’t find that message. And that’s what is happening when I see this.
readUpToId can get set by the server. I can see that I received urn:xmpp:mds:displayed:0 which updated the id. I think this happened because I read that message on a different client.
On the client receiving this that doesn’t have that message, we find no message and return null, so we show the subject message.
I don’t know why we’re missing the message exactly. In this case it looks like I stopped receiving messages for a while, but when I refreshed the page it was there and by the time I looked in the db myself it was there.
We could fix this by checking the presence of readUpToId instead. I think this makes some sense, not sure if we should care that I actually have that message or not, for this specific use case.