-
lovetox
Sam in you sync strategy it says
-
lovetox
after: <last message time>
-
lovetox
I don't think you can pass a time here
-
lovetox
After needs an index in the dB, which should be the mam id
-
Sam
That's after-id, different thing
-
lovetox
No I don't think so
-
lovetox
There is no after in the mam spec
-
Sam
oh, it's called "start", not "after", right.
-
lovetox
You mean after from the rsm spec
-
lovetox
Rsm needs an index
-
Sam
I think I call it "After" in code, so I'll go fix it.
-
Sam
That's different and I leave that unset
-
Sam
Thanks for the catch!
-
lovetox
That's not a good approach
-
lovetox
Using start you will always get one duplicated message
-
lovetox
Using rsm after is better
-
Sam
Yah, you'd have to do both. A single duplicate is the least of the problems with MAM though, but that does seem like a good idea to filter out the duplicate that way
-
Sam
I should convert this to a graphic, it's hard to read these bullet points.
-
Sam
Hmm, somehow the bullets don't work right on the page either, I thought they were working when I previewed it.
-
Sam
4 spaces apparently. Oops. Anyways, fixed both: https://github.com/modernxmpp/modernxmpp/pull/43
-
raucao
just to throw something meta in here: shouldn't the current room name here actually be the room description, and the title be something shorter, like e.g. only "Modern XMPP"?
-
Sam
lovetox: just added before/after to the current strategy; thanks. Not exactly the biggest change in the world, but nothing wrong with speeding this up by having one message less each time!
-
Sam
I am struggling to explain in the docs what they're for and why they're different from before-id and after-id, but if you don't have before-id and after-id available this is at least a practical use for them.
-
Sam
Also what it should be called; I made it a single field (since you can't set both <before/> and <after/>), so the unified ID field I called "PageID". I'm not sure if that actually makes sense.
-
Zash
Context?
-
Sam
Zash: lovetox suggested an improvement to my MAM sync strategy. I was just using start/end, but this results in a single duplicate message (the one we got the time from). Using RSM's "before/after" you can filter out that message though. However, in code I don't know what to call it (it's a single ID field since you can't set both, which one gets set is controlled by a boolean that already existed)
-
Zash
FWIW in Prosody there were always `before` and `after`
-
Zash
Internally
-
Zash
Direction is specified with a different field
-
Zash
So in MAM, `before-id` is just like the RSM `before` but without implying a reverse direction. Maybe it makes sense to do that at a higher level in the client too?
-
Sam
That's what I'm doing, I just don't know what to call the before/after field. There's already "BeforeID", "AfterID", and "PageDirection" or something. I called the thing that gets turned into <before/> or <after/> based on PageDirection "PageID" for now, but that seems unclear.
-
Zash
That seems weird and confusing to me
-
Sam
I guess I didn't understand what you were saying then, because I thought that's what you were describing.
-
Sam
I could have After and Before, but that seems more confusing because only one of them will actually be used and you have to know which one to set based on the direction bool.
-
Sam
Or I could get rid of the direction bool, but then what happens if you set both After and Before?
-
Zash
Turn one into before-id or after-id 🤷️
-
Sam
But that may or may not exist, as far as I know nobody supports mam#extended yet
-
Zash
Prosody (trunk) does, modulo storage backend support
-
Sam
Oh nice, I was looking for that and couldn't find it, that's good to know anyways. Amend that to "many people don't and they may or may not work"
-
Sam
But anyways, this is specifically for the case where that's not supported.
-
Zash
Hm, probably not directly relevant for Modern XMPP what your internal naming is like
-
Sam
Sure, we were just discussing the sync strategy and I said "what would I call that?"
-
Sam
Maybe in the doc it can just be "before or after"