jdev - 2022-09-09


  1. lovetox

    in the MAM Xep there is a stable flag the MAM Service can set

  2. lovetox

    is there any client out there that does anything with that info

  3. lovetox

    i mean the text basically says the results are useless

  4. lovetox

    they can change in sequence and in *content*

  5. lovetox

    i mean how bad can it get lol

  6. lovetox

    basically as a client i would drop all messages from that query, what am i expected to do here?

  7. lovetox

    display the user some content, but tell him, hey this can be all gone and totally changed in a minunte

  8. lovetox

    display the user some content, but tell him, hey this can be all gone and totally changed in a minute

  9. lovetox

    also weird, it only tells me in the <fin> element

  10. lovetox

    means i have to process all messages, only to find out they maybe in the wrong order or content is not correct

  11. lovetox

    or messages are missing etc

  12. lovetox

    ok wait the <fin> element is on each page

  13. lovetox

    so thats fine

  14. lovetox

    so my approach would be, get a page which is unstable, abort the query drop everything, show the user the archive has some problem and gajim will try to fetch messages in a minute again?

  15. Zash

    show the results in the chat view, but don't save them in the local database? like a "thin client"

  16. lovetox

    why would i show the user possible incomplete content, with possibly wrong order and missing messages inbetween

  17. lovetox

    i consider that worse than "hey there is a problem, wait a minute"

  18. lovetox

    hey i fetched some content, but its incomplete, but here is a little teaser of what awaits you :D

  19. MattJ

    lovetox: I understand your pain, but there are situations where this is needed. Throwing the results away if you don't think your client architecture is capable of handling this is certainly an option.

  20. lovetox

    MattJ, there is no pain, im just in a whining mood :D

  21. lovetox

    anyway, im really interested if *any* client implements tha

  22. MattJ

    It came up recently in the context of the Matrix bridge

  23. lovetox

    anyway, im really interested if *any* client implements that

  24. lovetox

    or does something special with it

  25. MattJ

    On Matrix, rooms are distributed. Messages can happen simultaneously on two disconnected servers. When they finally federate successfully, the history is merged.

  26. MattJ

    That's the extreme example, but the less extreme example happens every day: sometimes it is not disconnected, but just a little slow

  27. MattJ

    It can lead to "interesting" results via the bridge

  28. Zash

    And it couldn't have used the local received order, with like delay stamps to indicate the time discrepancy?

  29. Zash

    Then it would have been just like when messages get delayed by stream management or stuff

  30. lovetox

    no Zash, with have no order attribute with MAM

  31. lovetox

    timestamp != order

  32. lovetox

    the messages have to be in the correct sequence delivered from MAM

  33. lovetox

    i dont see a use case other than "drop this request and wait"

  34. lovetox

    except if you are a thin client, without database, i guess it doesnt matter

  35. lovetox

    you display all messages, and a minute later clear the whole view and do the request again

  36. lovetox

    but then again, why would i show an incomplete chat

  37. lovetox

    i see no benefit

  38. flow

    wouldn't it be better to show an incomplete chat instead of showing no chat?

  39. lovetox

    not in my opinion

  40. lovetox

    i see everyday how serious people treat chat

  41. lovetox

    like its an absolute katastrophe if a message is missed

  42. pep.

    I'd rather have an incomplete chat than not being able to talk at all fwiw

  43. lovetox

    im not sure how "talking" factors into that

  44. lovetox

    im not saying i quit the application and let people not talk anymore

  45. lovetox

    what i would do is showing a message, that the archive request failed and we try in a minute again

  46. lovetox

    you free to talk of course :)

  47. lovetox

    but thats maybe a bit of baggage from my work life

  48. Maranda

    lovetox: FWIW I don't think the approach has to be changed, I'd take it as: I see the flag I check more often, I don't see it I just stuff it in the db with less to no invalidation. Deduplication eventually should sort all the rest.

  49. Maranda

    (Because SIDs still have to remain stable)

  50. Maranda

    (Because SIDs still have to remain a stable reference to start from)

  51. lovetox

    no deduplication does not fix it, because MAM archive convey order with the order the messages arrive at the client

  52. lovetox

    the only way would be, to mark the messages in the db, then delete all of them on the query that works later

  53. lovetox

    or not write it to the db at all and keep it in cache or something

  54. Maranda

    Tbh I always found this stream order arrival strictness *very stupid* in XMPP

  55. lovetox

    its not a design decision

  56. lovetox

    as i remember it, there is one use case where you can build a cluster of xmpp servers

  57. lovetox

    and have a distributed archive or something

  58. Maranda

    Indeed

  59. lovetox

    and then they didnt want to make the server have some global order mechanism

  60. lovetox

    and now we have that :)

  61. lovetox

    although probably 0,01% uses a xmpp cluster

  62. lovetox

    although i dont really understand how such a cluster can restore the order, if he doesnt know it somehow

  63. lovetox

    and if he knows the order he could also put it into the stanza id

  64. lovetox

    ah i think i remember the cluster doesnt know the order

  65. lovetox

    ejabberd has microseconds as stanza id or something

  66. lovetox

    and they just hope that works good enough

  67. Maranda

    well Matrix has 2 timestamp references, origin_server_ts which equals to the timestamp when the original server sent the event, age which is the time that lapsed in ms from when that event was actually processed (locally)

  68. Maranda

    and that looks to be a rather *convenient* approach to deal with timeline ordering

  69. lovetox

    yeah, timestamp sorting should be enough

  70. lovetox

    if the timestamp has a good resolution

  71. lovetox

    now im not sure if seconds is good enough

  72. lovetox

    and there is nothing that says a server needs to provide a ms timestamp with mam messages

  73. lovetox

    if we got ms resolution, then i guess its a 1 in a million that 2 messages have the same timestamp

  74. lovetox

    and we could further say, those two messages are not a response to each other

  75. lovetox

    so does it really matter in which order they are

  76. lovetox

    this would really simplify the whole thing

  77. lovetox

    i do currently request the messages from my db with timestamp sorted, but with the additional benefit that if timestamps are the same, then insert order in the db counts

  78. lovetox

    and insert order depends on message received order

  79. Maranda

    anyways even if that's controversial because re-ordering the archive indeedly breaks the RFC, I think the case that I hypothesized concerto/fugata possibly experienced is *really* cornerish and missing messages mostly depends on other factors e.g. spam filter or stringprep (which I now fixed) for example more than that

  80. Maranda

    (I never had Gajim jinx me with it for example, and I do almost all testing with it)

  81. Maranda

    (I never had Gajim jinx me with it, and I do almost all testing with it)