Modern XMPP project discussion - 2021-08-22


  1. lovetox

    Sam in you sync strategy it says

  2. lovetox

    after: <last message time>

  3. lovetox

    I don't think you can pass a time here

  4. lovetox

    After needs an index in the dB, which should be the mam id

  5. Sam

    That's after-id, different thing

  6. lovetox

    No I don't think so

  7. lovetox

    There is no after in the mam spec

  8. Sam

    oh, it's called "start", not "after", right.

  9. lovetox

    You mean after from the rsm spec

  10. lovetox

    Rsm needs an index

  11. Sam

    I think I call it "After" in code, so I'll go fix it.

  12. Sam

    That's different and I leave that unset

  13. Sam

    Thanks for the catch!

  14. lovetox

    That's not a good approach

  15. lovetox

    Using start you will always get one duplicated message

  16. lovetox

    Using rsm after is better

  17. 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

  18. Sam

    I should convert this to a graphic, it's hard to read these bullet points.

  19. Sam

    Hmm, somehow the bullets don't work right on the page either, I thought they were working when I previewed it.

  20. Sam

    4 spaces apparently. Oops. Anyways, fixed both: https://github.com/modernxmpp/modernxmpp/pull/43

  21. 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"?

  22. 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!

  23. 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.

  24. 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.

  25. Zash

    Context?

  26. 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)

  27. Zash

    FWIW in Prosody there were always `before` and `after`

  28. Zash

    Internally

  29. Zash

    Direction is specified with a different field

  30. 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?

  31. 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.

  32. Zash

    That seems weird and confusing to me

  33. Sam

    I guess I didn't understand what you were saying then, because I thought that's what you were describing.

  34. 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.

  35. Sam

    Or I could get rid of the direction bool, but then what happens if you set both After and Before?

  36. Zash

    Turn one into before-id or after-id 🤷️

  37. Sam

    But that may or may not exist, as far as I know nobody supports mam#extended yet

  38. Zash

    Prosody (trunk) does, modulo storage backend support

  39. 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"

  40. Sam

    But anyways, this is specifically for the case where that's not supported.

  41. Zash

    Hm, probably not directly relevant for Modern XMPP what your internal naming is like

  42. Sam

    Sure, we were just discussing the sync strategy and I said "what would I call that?"

  43. Sam

    Maybe in the doc it can just be "before or after"