Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-inconsistent message ordering between element-ios and element-web #1913

Open
nh2 opened this issue Oct 31, 2022 · 2 comments
Open

Self-inconsistent message ordering between element-ios and element-web #1913

nh2 opened this issue Oct 31, 2022 · 2 comments
Labels
A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@nh2
Copy link

nh2 commented Oct 31, 2022

Steps to reproduce

When messages are sent from element-ios to another user using element-web, messages appear out of order.

The key thing is that even messages from the same user appear out of order, e.g. user U1 sends messages M1, M2 to user U2, and those messages are shown in order M2, M1 in U2's UI.

Thus I call it "self-inconsistent" message ordering: This issue is not about a message from U1 racing against a message from U2 (in which actual races are possible). When U1 sends M1, M2, then the order should be exactly as written.

In fact, the message interleaving delay can be so large that conversations become very nonsensical. Here is a concrete example with screenshots I recorded today. My friend U2 chats with me (U1, @nh2). Both use matrix.org as homeserver.

What my friend U1 wrote and sent on iOS:

[M1]: You dont know what the kids are up to on Halloween
[M2]: Don't want to be involved on any of it.

I (U2) receive only:

[M2]: Don't want to be involved on any of it.

I (U2) reply:

any of what?

and a minute later I (U2) receive:

[M1]: You dont know what the kids are up to on Halloween

Screenshot from U1's perspective (black background on element-ios):

matrix-element-inconsistent-message-order-iphone

Screenshot from U2's perspective (white background on element-web):

matrix-element-inconsistent-message-order-element-web

As you can see, from my perspective (white background), the conversation is nonsensical:
I get a message "Don't want to be involved in any of it" without knowing what "it" refers to.

Outcome

What did you expect?

That when a user sends me messages M1, M2, I do not get presented only M2, which destroys temporal order of what the user sent to me, and thus makes me misunderstand the messages.

What happened instead?

I suspect that something (not sure if it's the Matrix protocol, or either of the clients) tries to send messages in full isolation.

For example, when the network is spotty, or a switch from cellular network to WiFi occurs, perhaps element-ios fails to send M1, schedules a timer to retry that, and meanwile the user types and sends M2; then the timer for M1 triggers a minute later and it gets delivered out of order.

I guess that a message delivery platform should first always check if there are unsent messages in the out-queue and try to re-send those, e.g. when the user sends M2, Element/Matrix should check whether there are unsent messages ahead of it, and send those first, or at least together in one batch with the current newer message.

Operating system

iOS, and Element Web from NixOS Linux 22.05

Browser information

The iOS app, and Firefox 106

URL for webapp

app.element.io

Application version

element-ios 1.9.9 (20221018161714), Matrix SDK 0.24.1, OLM 3.2.12

Homeserver

matrix.org

Will you send logs?

No

@nh2 nh2 added the T-Defect label Oct 31, 2022
@florianduros florianduros added O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Nov 2, 2022
@weeman1337
Copy link

@nh2 can you also create an issue in the Element ios tracker, so that both sides are aware of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

4 participants