Repository navigation
Conversation
Dadadah
left a comment
There was a problem hiding this comment.
By omitting the lastMessageID update on messages owned by the user, the channel cannot progress its updatedAt value until someone else sends a message or reload. You will need to update lastMessageID for the user's own messages while also updating the ack (but only update the ack if the previous ack position was owned by the user).
Signed-off-by: onewhobridges <pneumatic.tube.b@gmail.com>
5dd5690 to
5ee5be9
Compare
|
lastMessageID must always be updated, got it.
I may not fully understand this. I know that we don't want to ack earlier unread messages from other users; my latest commit handles this by only acking the new message if it is the user's own AND channel.unread is false. |
|
Yes, acking on that condition is the correct scenario. Thanks for updating, I'll get this reviewed soon. |
This should fix stoatchat/for-web#1713, by changing the Message event handler to skip updating channelUnreads for the user's own messages. This mirrors the behavior of the client that sends the message, which skips processing the Message event entirely due to the
!client.messages.has(event._id)check.Also removed a redundant call to
client.channels.updateUnderlyingObjectforlastMessageId.Tested locally using for-web main (8cd48758) and api:v0.15.5.