Chat messages being processed out of order

I’ve noticed sometimes that when a user sends a message, it’ll get posted above other messages already posted in the chat. On the other hand, sometimes the opposite happens, where a user will send a message and it will stubbornly cling to the bottom of the chat, even as newer messages are sent.

I’ve done some investigation and the only real clue I have is this PR #34592, which was merged around the time we started experiencing the issue, late August/early September. I think it’s related because it allows the client’s time to be used as timestamps for messages, and it would fit nicely as an explanation for some the issues we’re having. I’m not entirely sure if the PR is related though, since there are some oddities that don’t really add up, but I think it’d be a good place to start looking.

To be perfectly clear, this is not only an issue on my end, the messages are being displayed in the wrong order to ALL users in the chat.

Here’s some more things that we observed that might help investigate this issue:

  • The bug is not deterministic at all, it only happens sometimes, but when it does it usually happens around specific users and all their messages. For example a user will have all their messages be sent “in the past” or “in the future” so to speak (i.e. before other older messages, or after newer messages).
  • It seems to happen more consistently with a few specific users, which might mean it’s related to specific routing or the latency of different users.
  • Someone can reply directly to a message they see in chat, and the reply will STILL be registered as having happened BEFORE the message it’s replying to, leading to some very odd situations like this:

2 Likes

This is a fantastic report, super appreciate your time to write this.

I’ll let the relevant team know and they can prioritise accordingly.

2 Likes