-
Trung
sort by time ?
-
Trung
clock don't run backward ;p
-
moparisthebest
It do in distributed systems π
-
deport
oh shit
-
jonasβ
moparisthebest, or, does anyone remember the first AMD dual-core processors where the time counters weren't synced between the cores? caused all kinds of fun bugs
-
Zash
> clock don't run backward ;p Someone told that to NTP yet?
-
edhelas
Time to write XEP xxxx: NTP over Pubsub
-
lovetox
kurisu, you simply store message the way they arrive, if you request only in one direction
-
lovetox
if you request in both direction, backwards and forwards, you load message sorted by time, and pray that the server has subsecond timestamps (which basically means no message will ever have the same timestamp)
-
lovetox
if the server does not have subsecond timestamps, you can decide to still life with messages loaded in the wrong order which have the same timestamp
-
lovetox
or you implement a very complicated logic how you store the order info, which to my knowledge no xmpp client has implemented till now
-
Trung
whatif server had a power cut and pushing rubbish ? will Donald Trump save Elon Musk for Harris ?
-
kurisu
> kurisu, you simply store message the way they arrive, if you request only in one direction Well, you also have messages that are just sent to you directly, not out of mam. It may so happen that a live message is sent to you before the client gets older ones from mam. Is that handled at all? ↺
-
Trung
if the server has mam, i think it's *always* out of mam.
-
Trung
s/mam/MAM/
-
Trung
g
-
kurisu
Uhm?
-
Menel
Nah. If the client is connected, it will not query mam generally. Only at the connect
-
Menel
A smart client won't use messages until the initial mam load is complete
-
Menel
To not mix it up
-
Menel
Or sorts and deduplicates by timestamp locally again
-
lovetox
kurisu, you dont request message from mam you received live
-
Trung
client should sort by time is what am sayin' they get something that are "out of mam" they add to their local log. Should not concern mam at that point if i understand correctly.
-
lovetox
a message has a mam-id, even a life message because its stored on the server first
-
lovetox
you request messages *after* that mam-id
-
lovetox
ok if you sort by timestamp its probably wise to update timestamps of live message with timestamps from the server
-
lovetox
yeah tricky ..
-
lovetox
generally there is no nice solution
-
lovetox
MAM was never really good designed for that, the idea of MAM was that you only request in one direction
-
lovetox
so never backwards, some stuff was added later to make backwards easier, but order is then always tricky if you cache locally
-
lovetox
thats why Gajim only requests messages in one direction
-
kurisu
My goodness
-
singpolyma
It really depends on your datastore. Getting it right in a flat file for example, is trivial. In a sql database that has no natural ordering it is trickier to do the synthetic sort ids needed and so timestamp is "close enough" for most people
-
singpolyma
I've even seen clients requesting mam based on timestamp instead of based on id, but that's maybe a bridge too far in general
-
kurisu
If we're limiting ourselves to one way, it's no harder with sqlite than it is with a flat file, just use the default rowid which autoincrements and thus preserves the order.
-
kurisu
But if we're doing both ways... With sqlite one could find the lowest counter field value and decrement that I guess... While with a flat file prepending would mean overwriting the whole thing from what I understand
-
singpolyma
prepending is no issue, though yes it may have performance cost. the problem with decrementing is that negative ids may or may not be allowed. and then there's the mess if you allow "holes" which is where it actually gets hard
-
singpolyma
if you have only up to A and then you request backwards from Z to D ... you don't yet have B or C but how do you know that? and how do make sure to put them in the right place later?
-
kurisu
That's why the server ids should be sortable.
-
singpolyma
That would magically solve every version of this problem, yes
-
moparisthebest
What's this? We need another id on messages? ππ
-
kurisu
the existing mam id could just be made meaningful
-
Zash
without a breaking change, creating MAM 2 ?
-
moparisthebest
As a client how could you tell, because ^
-
singpolyma
it would just need to be a new feature var or something that means "the ids from this mam are ordered"
-
singpolyma
for the client to know
-
singpolyma
we can make the ordered without the client knowing first, no harm and some benefit, but yes we would need discovery eventually
-
singpolyma
Like even without discovery it would make debugging a lot easier for the human who knows
- Zash eyes already done UUIDv7 support
-
moparisthebest
That seems like it'd be ok, next question is ordered how, easy if you mandate numeric, hard with strings
-
Zash
In the dawn of MAM, I argued for leaving IDs as opaque strings so servers could use whatever their databases uses for unique ids.
-
singpolyma
moparisthebest: UUIDv7 almost for sure is the right thing to do, but that can be up to the server
-
moparisthebest
And the server is expected to have messages sorted by what?
-
Zash
I see the archive as a simple FIFO. Messages are added to one end, get removed from the other.
-
kurisu
what's the point of uuivds oer just time with milliseconds✎ -
kurisu
what's the point of uuivds oer just unit time with milliseconds ✏
-
singpolyma
moparisthebest: the server already has messages sorted
-
kurisu
what's the point of uuivds oer just unit time with milliseconds or something like that ✏
-
kurisu
what's the point of uuivds oer just unit time with milliseconds or something like that, which you can also sort by like a normal integer... ✏
-
singpolyma
kurisu: if you just want time you already have that
-
singpolyma
using uuidv7 gives you a stable total ordering even if two arrive the same millisecond
-
singpolyma
or using an incrementing integer server side gives you the same
-
Zash
or appending into a file!
-
kurisu
> I see the archive as a simple FIFO. Messages are added to one end, get removed from the other. that's how the client always ends up getting them unfortunately. IIRC Jami pulls off a whole git-like tree thing to reconcile history, but that's because it's p2p. It should be much easier with centralized storage like jabber, but yet isn't entirely easy without a sortable ids ↺
-
singpolyma
Zash: yes, I meant in terms of ids, but yes
-
Zash
You can still infer ordering from MAM, you know you get messages in the same order (or reverse if you <flip-page>) and you know that messages from adjacent pages are adjacent to that
-
Zash
Tricky to translate into SQL, sure. Easier if you had a linked list I imagine.
-
singpolyma
yes, if you just have a linked list it's trivial
-
lovetox
its also rather trivial to ad a sortable id for the server to the store and adding a feature to disco inf✎ -
lovetox
its also rather trivial to ad a sortable id for the server to the store and adding a feature to disco info ✏
-
singpolyma
What do people think about defining a new XMPP URI querytype for linking to messages? Something like xmpp:someone@example.com?ref;id=blah where id is either the @id or the stanza-id in a MUC case
-
lovetox
to use in what situation? because we have replies
-
SavagePeanut
links to messages in another room once we have "spaces"
-
singpolyma
SavagePeanut: we already have spaces, but I don't think that's relevant here :)
-
singpolyma
yes, links to messages in another room is one of the ways. but also even links to previous messages, not as a reply just as a "remember you said LINK" etc
-
lovetox
then you can type "Remember" and use a reply
-
lovetox
is this purley about using reply without a body?
-
singpolyma
It's about linking to a message in a context that is not a reply at all
-
singpolyma
sure, if it's in the same conversation one could sort of abuse replies for this
-
lovetox
the question is why a uri
-
lovetox
a uri makes for me only sense if its used outside of xmpp
-
lovetox
you want to click it in a browser
-
moparisthebest
Why not both?
-
singpolyma
I suppose most of the inside-XMPP use cases I have in mind would be handled fine by message forwarding as well, once I support that
-
singpolyma
but yes link from totally outside can be useful
-
moparisthebest
But even if you wanted it to only work in XMPP clients, wouldn't it still be a URI ? Otherwise how does gajim and Conversations link to the same post ?
-
lovetox
not sure what i should do with a link, it somehow depends on the feature that any user can query any message from any MUC archive?
-
lovetox
can i do that without joining?
-
lovetox
if not, i dont think i will query that message
-
moparisthebest
I suppose you'd join and query mam no ?
-
lovetox
ugh π€’οΈ
-
SavagePeanut
I don't think it'd do anything without clicking and joining
-
lovetox
why not simply forward the message you want to show someone
-
lovetox
its all already there defined, you can simply start implementing it
-
moparisthebest
A message alone isn't always helpful
-
SavagePeanut
"We discussed this in another room, start reading here:"✎ -
lovetox
yeah? and you can still do this with message forwarding
-
SavagePeanut
"We discussed this in another room, start reading here: <uri>" ✏
-
moparisthebest
Yes, "this is where it was discussed: link"
-
lovetox
a forwarded message, contains the whole message
-
lovetox
a link is useless
-
SavagePeanut
> a forwarded message, contains the whole message But doesn't have everything after or immediatly before ↺
-
moparisthebest
What message would you forward? The entire conversation ?
-
lovetox
a link i can not preview, i can show an empty box and say "click here if you want to see what this is"
-
lovetox
moparisthebest, the message i want to share?
-
moparisthebest
Yes, so how all links work?
-
lovetox
?! did you see the proposed link?
-
lovetox
or are you talking about some link you have in mind but didnt tell us
-
moparisthebest
lovetox: one message isn't helpful alone, often you need to link an entire conversation with perhaps hundreds of messages
-
lovetox
not sure what you are talking about
-
lovetox
the proposed link has one ref to one mam id
-
lovetox
thats what iam talking about, but maybe tell us the feature you have in mind
-
moparisthebest
Which the UI needs to scroll to with all messages before and after filled in
-
lovetox
a forwarded message has also the mam id
-
lovetox
.....
-
lovetox
there is nothing you can put in a link, that you cant put into a forwarded message
-
moparisthebest
There are important differences
-
lovetox
are you seriously arguing that the uri spec is more versatile than whole xml spec?
-
lovetox
the point is, i forward a xml payload (message) that has everything another client needs to display something useful to the user
-
lovetox
a link has nothing i can display to the user
-
lovetox
except an empty box that reads "hey someone shared something, please click here, and i will join a chat with 1000 people" and download 2 mb of data for you to get one message"
-
moparisthebest
1. I can't put a forwarded message on my blog or project readme (biggest problem) 2. Forwarding you the message might violate security if you aren't allowed to see it. Sending a link would result in a nice "sorry you aren't allowed to see this"
-
SavagePeanut
2. At that point, copy/pasting it would violate security which is what people would do without forwarding it
-
moparisthebest
People can always do that
-
singpolyma
lovetox: I think you've convinced me to implement forwarding first before I come back to deciding if I need this URI
-
moparisthebest
These are real use cases that other systems have by the way (Sadly) many projects link to chat messages for documentation/downloads etc, slack, discord etc In slack itself if you send a link to a message and the user(s) don't have permission it'll ask if you want to forward instead
-
moparisthebest
> (Sadly) many projects link to chat messages for documentation/downloads etc, slack, discord etc How do we do this with XMPP without a URI ?
-
SavagePeanut
prompote the use of forums!
-
singpolyma
SavagePeanut: did you mis-spell discord?
-
SavagePeanut
π https://support.discord.com/hc/en-us/articles/6208479917079-Forum-Channels-FAQ
-
kurisu
Telegram has message links and those are occasionally used to link some posts from the web or even inside telegram itself. But then telegram also has chat history much more advanced than xmpp, it can do "breaks" in cache that singpolyma mentioned earlier today, so e.g. if you're following a link to a message sent a year ago, it will load only the messages around that message, and will load more as you scroll up or down.
-
kurisu
oh and forwarded messages are also links at the same time there
-
singpolyma
kurisu: xmpp can do that as well (only load some around the message in question)
-
singpolyma
By XMPP can I mean, MAM can
-
kurisu
Yeah in theory... But we discussed earlier today how awkward it gets in practice when you lack sortable message IDs
-
kurisu
And in practice I don't think any client does that✎ -
kurisu
And in practice I don't think any client does that? ✏
-
Menel
But no client does that isn't an argument. If you now implement the telegram thing in xmpp no client will do that too. Seems even trivial https://xmpp.org/extensions/xep-0313.html#filter-time
-
kurisu
Isn't an argument for what
-
Menel
> And in practice I don't think any client does that?
-
kurisu
>seems Yes, *seems* as we discussed above.
-
Menel
For needing something else
-
Menel
It is one query to receive a specific part of history
-
Menel
With mam.
-
kurisu
If you're not caching it, that can be simple I guess.
-
singpolyma
yeah. the "hard part" is disjointed storage
-
singpolyma
downloading and rendering is 'easy'
-
lissine
kurisu: the feature you're describing is mostly unneeded because most servers have a short rentention time for history (a few weeks / a couple of months)
-
lissine
It would be more valuable to e.g. find a way to sync mam between clients than your feature request
-
kurisu
I don't see how that makes it indeed... I think you meant impossible✎ -
lissine
kurisu: unneeded i.e. not needed
-
kurisu
I don't see how that makes it unneeded... I think you meant impossible ✏
-
kurisu
> It would be more valuable to e.g. find a way to sync mam between clients than your feature request At that point you'd be reinventing whatever jami has been doing I guess ↺
-
lissine
> At that point you'd be reinventing whatever jami has been doing I guess It wouldn't be something you'd do everyday. It would be something you'd do when you get a new device and want to transfer your years of history
-
lissine
It is already possible to do this between two instances of the same client, but not between two different clients
-
kurisu
I think nowadays people expect servers to store that tbh, especially given that years of history are usually a dozen megabytes
-
kurisu
Without media
-
singpolyma
Yes. I think for community chat stuff that's pretty important these days
-
moparisthebest
> kurisu: the feature you're describing is mostly unneeded because most servers have a short rentention time for history (a few weeks / a couple of months) I don't know that this is true, but even if it is, that's just a deployment decision ↺
-
kurisu
What I love most about these "decisions" is that you never know
-
kurisu
Which basically makes them random from user pov
-
singpolyma
Well user hopefully isn't making their stuff in a random server they don't know the policies of π
-
kurisu
Nobody reads "policies" of a server especially given that they're well concealed
-
singpolyma
If you don't know what a server is or what it can do why would you put your stuff there?
-
kurisu
Yeah yeah in the end the users don't care. In the end they end up sticking to things like telegram because they know if you put something there it's there for good and won't randomly get erased whenever the admin saw fit
-
kurisu
Whenever the admin saw fit to free the 10mb worth of your year long correspondence