TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Message order in Matrix: right now, we are deliberately inconsistent

136 点作者 whereistimbo5 个月前

11 条评论

timokoesters5 个月前
I&#x27;m the author of the spec issue this blog post is based on: <a href="https:&#x2F;&#x2F;github.com&#x2F;matrix-org&#x2F;matrix-spec&#x2F;issues&#x2F;852">https:&#x2F;&#x2F;github.com&#x2F;matrix-org&#x2F;matrix-spec&#x2F;issues&#x2F;852</a><p>In my implementation for the Conduit Matrix server, the &#x2F;sync order is used for everything. The timeline is just one list that grows on one end for incoming events and on the other end for backfilled events.<p>I think it&#x27;s important that the message order does not change, because that&#x27;s very difficult to communicate to the user.
评论 #42340620 未加载
评论 #42325836 未加载
danpalmer5 个月前
This is something that many chat apps get wrong and I&#x27;m not sure this article is moving in the right direction. The UX is fairly clear in my mind:<p>1. All up-to-date clients should be displaying the same message order. 2. A single client should not send messages in the wrong order.<p>Yes a client may be out of date and therefore show something different, but once it becomes up to date it should be showing the same state even if that means amending history. Why? Because the humans reading it will be confused otherwise! An app getting more data is something we intuitively understand, but if my client shows something and yours shows something else, we will conclude different meanings from it.<p>Additionally there are some clients that treat each message input by the user as a retriable thing in isolation, which is also clearly incorrect. If I send two messages and the first fails to go through, I almost certainly don&#x27;t want to retry the second until the first has gone through, otherwise my client has literally sent out of order messages! I use Beeper for chat and this is one of the most frustrating things it does.
评论 #42335067 未加载
评论 #42325584 未加载
评论 #42329237 未加载
评论 #42324955 未加载
评论 #42325002 未加载
Vanit5 个月前
I&#x27;m throwing some shade here, but this reeks of backend engineers not caring about UX.
评论 #42325748 未加载
thomastay5 个月前
Having dealt with this problem at work for several years now, I feel the pain of keeping different clients in sync - it&#x27;s extremely difficult. Not sure if it&#x27;s possible in Matrix, but consider having a message ID that increments by one on every message in a room. That lets the client know pretty quickly if there&#x27;s a gap or a misordering.<p>Not really getting this point though:<p><pre><code> The &#x2F;sync API returns events in an order &quot;according to the arrival time of the event on the homeserver&quot;. The spec for &#x2F;messages says it returns events &quot;in chronological order. (The exact definition of chronological is dependent on the server implementation.)&quot;. </code></pre> Why would those two return different results? When does the chronological order of two messages differ from the arrival time of the event on the homeserver?
评论 #42324919 未加载
评论 #42324970 未加载
评论 #42324911 未加载
评论 #42324899 未加载
lmm5 个月前
In general we certainly want to be able to change things &quot;in the past&quot;. When there is unpleasant spam in a groupchat, you want a moderator to be able to remove or at least hide it, in a way that means people scrolling up won&#x27;t be exposed to it unless they explicitly want to. (You could argue for having the client deal with all of that, but I don&#x27;t think there&#x27;s much benefit).<p>And if, as in the example at the end, clients on different homeservers will inevitably see different views, then I don&#x27;t think always showing the same history to the same client, or clients on the same server, solves the &quot;gaslighting&quot; problem - if anything it could make it worse. Maybe clients should make it obvious when messages have been &quot;retconned&quot; into the scrollback, and maybe servers should have certain features to support that. But the idea of having a consistent linear timeline is one of those answers that&#x27;s clear, simple, and wrong.
rkangel5 个月前
This article makes a logical step that I think is incorrect - that message order from the server is the order that a client then displays them in.<p>Surely that&#x27;s a presentation issue - you should display messages chronologically, regardless of what order you got them from the server? The author does touch on this a little bit, I don&#x27;t see how that isn&#x27;t the &quot;obviously&quot; correct approach?:<p>&gt; An alternative is to continue providing events in any order, but add some kind of order number that allows clients to sort events into &#x2F;sync order. MSC4033 proposes this.
评论 #42338913 未加载
Saris5 个月前
That&#x27;s something that Telegram always seems to get right, I&#x27;ve never seen messages out of order in different clients, and if I do something like upload a video then immediately send more text messages before it&#x27;s done, it will shove the video in between the messages where it should be when the upload is done.<p>I know it&#x27;s a much harder problem without a central server managing things. But consistency is very important for messages, out of order they could have a very different meaning and be very confusing.
评论 #42334426 未加载
throwaway143565 个月前
i had a hilarious argument with the significant other when my messages appeared a very lame response to messages i didn&#x27;t receive.<p>i think the mental model should be what is most useful in court. if a netsplit occurs the state of the room doesn&#x27;t exist anymore, conversation can continue but it should be a different room populated with working available clients. The main room can be restored and the missed convo can be a 3rd room
评论 #42337939 未加载
Terr_5 个月前
My preference would be to avoid even <i>attempting</i> to force all into a single chronology. Instead, imagine something like the output of `git log --graph`, where the network split&#x2F;rejoin moments are also displayed by lines. It would allow people to tell that two independent conversations were going on, and that certain messages were written while another was not known.
shepherdjerred5 个月前
This sounds like a pretty good use case for a consensus algorithm like Paxos or Raft
评论 #42325600 未加载
评论 #42325598 未加载
amstan5 个月前
It&#x27;s infuriating how the client must be stateful and have local storage, for both the access_token and the last message recieved. That&#x27;s right you must remember as the client where the last events [1] you&#x27;ve seen (even if you already told the server to mark it as read) was or else the server will happily send you the same messages over and over again across restarts of your client. I kind of miss making IRC bots where things were much simpler and ... quicker honestly (latency wise).<p>[1] <a href="https:&#x2F;&#x2F;uhoreg.gitlab.io&#x2F;matrix-tutorial&#x2F;sync.html#:~:text=w" rel="nofollow">https:&#x2F;&#x2F;uhoreg.gitlab.io&#x2F;matrix-tutorial&#x2F;sync.html#:~:text=w</a>...