Skip to content

Received deferred messages are impossible to spot in a chat #8088

@DarkCat09

Description

@DarkCat09
  • Operating System (Linux/Mac/Windows/iOS/Android): Android
  • Core Version: 2.48.0
  • Client Version: ArcaneChat 2.48.0-foss

An attempt to fix order of messages coming from different relays (#8031) led to another UI/UX bug.

What happened: one relay (B) couldn't connect to another (A) and deferred some mail. Then eventually federation issues resolved and the mail was delivered. But a user from relay A already wrote some messages to B, so B's deferred message is not the last one in their chat.

So here's the bug:

Expected behavior

I expect any newly received messages (even if deferred and actually written before my last one) to appear at the bottom of a chat, not somewhere in the middle.

Actual behavior

B's deferred message got sorted by its sender-side timestamp and, on the A's side, popped up in the middle of the conversation (right where it should've been placed if the connectivity hadn't been broken).

Additionally, a mark "1 new message" is displayed above the last 1 message which is A's msg, not the B's one, because it's not the last in the chat due to this sorting order.

So, there's no way for A to even spot the message they've just received, because it's lost somewhere above and not marked by "1 new message" (instead, this mark is mistakenly shown above A's own msg, because it was the last msg in the chat).

Please see the attached screencast for a better description.

Steps to reproduce the problem

To artificially reproduce this, you'll need two different chatmail relays (A and B) and one profile on each of them (users A and B) with a DM chat between these users.

  1. Temporarily block relay B on the relay A firewall, e.g. iptables -A INPUT -p tcp -s 1.2.3.4/32 -j DROP.
  2. On user A's side, send some messages.
  3. Then, on user B's side, send some messages too.
  4. On user A's side, send some messages again (so, when later sorting by timestamp, these will be at the bottom).
  5. Unblock relay B, iptables -D INPUT 1.
  6. Wait half a minute, click "Resend" on user B's messages if they still don't arrive to user A.
  7. Notice that user A received the deferred B's messages sent in the step 3, and they are sorted above A's messages sent in the step 4, and the "X new messages" mark incorrectly points to those A's msgs from step 4.

Screenshots

dc_repro.mp4

Logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions