jdev - 2023-07-12


  1. nicoco

    any reason for clients to send the "MUC join presence" twice in a row? I've noticed dino does that, is it just a bug related to https://github.com/dino/dino/issues/1457 ?

  2. Zash

    only twice? those are rookie numbers. poezio used to send 8+ or so

  3. nicoco

    haha ok

  4. Kev

    Clients should only send the join once.

  5. nicoco

    what should I do? send a "kick" (110, 333) before completing the sequence? just ignoring it?

  6. nicoco

    (also, reporting the issue to dino, yeah ;))

  7. Kev

    As a server? Pretty sure 45 covers this, and IIRC it says that you should treat the second join as a fresh join.

  8. nicoco

    ok. ignoring sounds tricky, the client may have shutdown or the connection broke and it is trying to join again. so treating it as a new join is okish, except for the part where in large groups this means sending a ton of useless presences

  9. nicoco

    thanks for your replies, it makes my "lazy loading" (delaying presences after join) of participants trickier to implement than I hoped it would be, but that comes with open ecosystems I guess :)

  10. Link Mauve

    nicoco, note that clients such as poezio have optimisations for presences received before the join.

  11. Link Mauve

    After the join it will treat them all independently, before the join it will batch update its internal state, not sorting the participants list every presence, etc.

  12. nicoco

    because it sends joins 8 times? :D

  13. Link Mauve

    No, only once nowadays I think?

  14. nicoco

    hehe I'm kidding

  15. Zash

    Note that clients may send a separate presence to set their presence in the chat.

  16. nicoco

    anyway, I think it makes sense for super large groups to send the subject before the whole list of participants, especially in the contacts of presences containing vcard-temp hashes for avatars

  17. Kev

    > Note that clients may send a separate presence to set their presence in the chat. Right, but that won't have the MUC join element in it.

  18. Kev

    > anyway, I think it makes sense for super large groups to send the subject before the whole list of participants, especially in the contacts of presences containing vcard-temp hashes for avatars Except that the spec requires that you don't?

  19. jonas’

    yes, don't do that

  20. jonas’

    client software relies on that order to know when the join sequence is complete

  21. Zash

    Isn't it a valid optimization tho, to pretend participants aren't really there until they say something?

  22. jonas’

    maaaybe, but that's differetn from "sending subject first, then presence flood"

  23. nicoco

    jonas', Kev: well, it just looks like I'm the only participant, then a bunch of people join afterwards?

  24. nicoco

    is that really that bad?

  25. nicoco

    I thought it was an OK optimisation

  26. jonas’

    nicoco, note what Link Mauve says: knowing that "this is the initial presence flood" allows for important optimizations

  27. Zash

    I'd probably keep a cache of the last active participants and send only those, then subject, then inject presence for whoever speaks that weren't in the cache.

  28. jonas’

    nicoco, you can avoid re-sorting lists and stuff, which means reducing complexity from O(n² log n) to O(n log n)

  29. jonas’

    nicoco, you can avoid re-sorting lists and stuff, which means reducing complexity from O(n² log² n) to O(n log n)

  30. nicoco

    in fact, participants that have spoken since slidge was started will have their presences sent before the joiner presence and subject

  31. jonas’

    if you do what Zash says though and only send a "relevant" subset of presence, you obviously win

  32. jonas’

    nicoco, I do not understand that sentence

  33. nicoco

    slidge starts, receives messages from Bob in group A. when dino joins group A, Bob presence will be sent unoptimized (ie, before the join sequence).

  34. nicoco

    but also, on the first join by a client of group A, slidge will make a legacy API call: "fetch all members of group A"

  35. nicoco

    and (a) I don't want this to be blocking for the join sequence (b) I never even want to retrieve this member lists for groups that no xmpp will join

  36. nicoco

    isn't that a valid case for such optimisations?

  37. nicoco

    > O(n² log² n) to O(n log n) I hadn't thought of that, and maybe I should just block everything then…

  38. lovetox

    Yes roster sort is a killer

  39. nicoco

    > I'd probably keep a cache of the last active participants and send only those, then subject, then inject presence for whoever speaks that weren't in the cache. Zash: this is more or less what slidge does. except it's *not only* those who speak that are lazy loaded, all members are (in the limit of what the legacy API allows to retrieve, though)

  40. jonas’

    nicoco, so when you say "unoptimized", it's a server-side optimization, you're talking about

  41. nicoco

    yup, server-side

  42. nicoco

    but I understand that it makes it harder to optimize to clients, which I had not thought about

  43. lovetox

    If you spam Gajim with join presences it will simply freeze because roster sort will take all cpu

  44. lovetox

    It's not expected that servers ddos you with presence after successful join

  45. lovetox

    Also xeps depend on roster being complete

  46. nicoco

    lovetox: from what I've experienced, in practice, it makes "joining takes a little time" to "instant join", but my desktop is beefy.

  47. lovetox

    See for example the mic hats xep

  48. lovetox

    nicoco: because you test it with one MUC, but clients join 30

  49. Link Mauve

    nicoco, do you want some toaster to play with? :)

  50. nicoco

    ok, I had been advised to do this optimisation in here before, but apparently it sucks then :)

  51. Link Mauve

    Did we?

  52. nicoco

    Link Mauve: I do have my android

  53. nicoco

    Link Mauve: I do have my android device as a toaster, just harder to test during dev with it because android

  54. nicoco

    Link Mauve: oh yeah, but I will not point fingers :P

  55. nicoco

    the really annoying part I guess is that I want to include the vcard-temp thing in the initial presences

  56. nicoco

    but I guess I should first send a list of presences without it, then for participants that have avatars send another one after (unless avatar has been retrieved, processed, and hashed before)

  57. nicoco

    this is worse server-side, but if it's better client-side, I'll just ditch my recent "lazy load participant" optim, ok

  58. jonas’

    nicoco, that could very much work, yes

  59. jonas’

    nicoco, also, if this lazy loading of participants is only needed on the first client join and afterwards you can cache the stuff inside slidge, maybe it's bearable.

  60. Link Mauve getting flashbacks of trying to join a Matrix room, and it would take hours to download the state from the legacy protocol and not notify whatsoever of any progress.

  61. Zash

    That's what people want apparently 🤷️

  62. Zash

    Just make sure that all the messages arrive out of order

  63. nicoco

    tbf it doesn't have to be like that. discord or telegram large groups just don't load the participant list on join, and only when you try to display it.

  64. nicoco

    tbf it doesn't have to be like that. discord or telegram large groups just don't load the participant list on join, only when you try to display it.

  65. jonas’

    MIX can do that, too.

  66. jonas’

    but nobody likes MIX for whatever reason.

  67. msavoritias

    I do o/

  68. msavoritias hides

  69. nicoco

    I know :) I initially thought I'd support MIX instead of MUC for non-anon groups, but it seems very few clients will implement MIX, so I don't have a lot of incentive to do so…

  70. jonas’

    the chicken-egg-issue

  71. jonas’

    no servers -> no clients. no clients -> no servers.

  72. msavoritias

    yep. but we could do more to change that 😕

  73. jonas’

    like implementing MIX in gajim|dino|... instead of NIH-ing? :-)

  74. msavoritias

    i would settle for accepting MIX is where we are heading and its better than MUC

  75. msavoritias

    for starters

  76. msavoritias

    then we can work on implementing everywhere 🙂 I would be interested to

  77. jonas’

    define "we"

  78. nicoco

    I'm not against adding support in slidge, but I just feel too amateurish to implement it "in the dark", ie, without being able to test against a client while developing

  79. msavoritias

    > define "we" xmpp community

  80. msavoritias

    i know you specifically are not so against it

  81. jonas’

    nicoco, I also think that a gateway component is probably not the right thing to vanguard a rollout---as useful as gateways are, they are pretty nieche compared to common MUC usage.

  82. nicoco

    agreed

  83. jonas’

    msavoritias, thing is, agreement is just words. if nobody does it, that won't help. doing it on server and client side is what manufactures agreement.

  84. nicoco

    but at the same time, I support rich replies, reactions, etc. so…

  85. jonas’

    msavoritias, thing is, agreement is just words. if nobody does it, that won't help. doing it on server and client side is what manufactures actually useful agreement.

  86. Zash

    There's the matter of ROI tho, the benefits of a big rewrite don't seem worth it and would take you backwards until you catch up to feature parity with MUC.

  87. jonas’

    correct

  88. Zash

    While slowly applying small fixes to MUC until it becomes close enough to MIX that we can just slap some protocol translations on it, seems more feasible.

  89. Zash

    (as a server developer who is _not_ getting paid to implement MIX (or at all))

  90. msavoritias

    > msavoritias, thing is, agreement is just words. if nobody does it, that won't help. doing it on server and client side is what manufactures actually useful agreement. well words are powerful and helps us change the culture around it. but fair i know i need to do stuff myself 🙂

  91. nicoco

    lovetox: isn't receiving "a flood of renames" the same as getting "a flood of presences after join"?

  92. lovetox

    A flood of anything after successful join is bad I guess

  93. lovetox

    I have to display renames to the user

  94. lovetox

    Also joins ans lefts if the user wants

  95. lovetox

    But why would you send a flood of renames?

  96. nicoco

    to avoid blocking while fetching participants "display names", but OK, I'll make that blocking the join. it's marginal, only on the first joining a MUC since slidge was started, and also, I'll probably cache that persistently in the future™

  97. nicoco

    thanks for your replies

  98. nicoco

    btw, why do you need to sort participants? isn't that only needed when the "muc roster" is shown?

  99. jonas’

    UI frameworks may still do that automatically unless you tell them to hold their horses for a moment

  100. jonas’

    (and "for a moment" should generally not be too long, so what you'd typically do is buffer the participants in the xmpp client layer and flush them into the list only later)

  101. jonas’

    and "doing things only when showing" is how you get sluggish UIs :|

  102. sagaracharya

    jonas: What's your real name?

  103. sagaracharya

    Re-add me to the XMPP group and apologize

  104. sagaracharya

    I'm not going to speak the way you want me to

  105. sagaracharya

    And if you outright label correct things as wrong, you're gonna be sorry when you see the truth

  106. MSavoritias (fae,ve)

    i think this is the time to bring up the CoC :)

  107. msavoritias

    https://xmpp.org/extensions/xep-0458.html

  108. jonas’

    plus the specific rules for operators@: https://xmpp.org/community/channels/operators/

    ☝️ 2
  109. jonas’

    sagaracharya, as per the operators@ rules, your ban will be lifted after a day.

  110. jonas’

    we expect you follow the rules then, or stay out of the place.

  111. jonas’

    and with that, I'd like to close the discussion here, because moderation of operators@ is not on-topic here.

  112. jonas’

    you may discuss moderation, while following the rules, once you're allowed back in.

  113. nicoco

    jonas': I see, thanks for the explanation. but then it's a matter of sluggish UI vs sluggish joining :)

  114. jonas’

    I take sluggish one-time-action with a clear "something is happening here" indication over sluggish overall UI any day.

  115. sagaracharya

    jonas: So will you apologize after a day?

  116. sagaracharya

    After a day, we'll discuss if your action was biased or not and you will apologize

  117. sagaracharya

    Every small deviation from your expectations is not even remotely a 'violation of rules'

  118. sagaracharya

    I will clearly quote your provocation following which you can apologize

  119. Zash

    sagaracharya: This channel is for technical discussions, please stop.

  120. moparisthebest

    > There's the matter of ROI tho, the benefits of a big rewrite don't seem worth it and would take you backwards until you catch up to feature parity with MUC. See: nearly 14 year old Wayland, not yet at feature parity with X

  121. moparisthebest

    > There's the matter of ROI tho, the benefits of a big rewrite don't seem worth it and would take you backwards until you catch up to feature parity with MUC. See: nearly 15 year old Wayland, not yet at feature parity with X

  122. Link Mauve

    Thankfully!

  123. msavoritias

    ^

  124. moparisthebest

    Also see https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ re: rewrites

    ☝️ 1
  125. jonas’

    I was wondering whether I should search my history for that :)

  126. Zash

    This was the article I had in mind when I wrote that about ROI :)

  127. lovetox

    Mix would not be a rewrite it would be a additional to muc and the trying to find good abstractions over both in your code and horribly fail

  128. lovetox

    Hm can servers not do a mix - muc bridge kind of thing where I have to implement only mix

  129. singpolyma

    Sure, if we decided MIX was a good idea we would want that in both directions

  130. moparisthebest

    As is mix has no backwards compatibility with muc so all channels would just be completely seperate, that 100% needs fixed before implementing it would even be feasible

  131. moparisthebest

    Mix was spec'd for closed deployments and is only useful there at the moment

  132. Kev

    Other than being 100% not true, I agree with what you say.

  133. Ge0rG

    I remember heated details about making details of MIX work in a way that would allow to join a MIX room from a MUC client

  134. Ge0rG

    but then again I'm getting old, and I probably dreamed that up

  135. moparisthebest

    Well if it was spec'd for the open federated network I would have expected some thoughts about an upgrade path for muc besides "flag day!"

  136. lovetox

    The problem with MUC is, that it's not bad enough for people wanting to switch

  137. Ge0rG

    unless you have a MUC with thousands of users

  138. msavoritias

    or want to work around stuff like presence above

  139. msavoritias

    also yes MIX can be implemented side by side.

  140. msavoritias

    so we dont have to do all at once

  141. msavoritias

    this is the kind of words I was talking about 🙂

  142. jonas’

    lovetox, is https://xmpp.org/extensions/xep-0408.html what you were asking for earlier?

  143. Kev

    There's no flag day, you just have the rooms support both MUC and MIX.

  144. msavoritias

    yep

  145. moparisthebest

    Side by side is the split-network-flag-day approach, single rooms that support mix and muc is the only sane upgrade path, has any of that been specified or implemented ?

  146. msavoritias

    thats a moving the goalposts now. but I am out of this discussion anyway...'

  147. msavoritias

    thats moving the goalposts now. but I am out of this discussion anyway...'

  148. jonas’

    moparisthebest, XEP-0408?!

  149. moparisthebest

    What goalposts moved? I've always said mix must have backwards compatibility or an upgrade path that isn't "ok everyone move to the mix room now" (flag day) to be usable on the public federated network (for the record, the only network I care about)

  150. singpolyma

    I think that's always been a part of the MIX design

  151. singpolyma

    Personally I find mix over complex and don't really like it on its own terms myself, but if your main issues is back compat it's not too hard

  152. moparisthebest

    > moparisthebest, XEP-0408?! Very cool, I guess https://xmpp.org/extensions/xep-0408.html#mix-muc-invite-choice should be changed so an invite is valid for both because disco is useless and it seems likely 1 account will have multiple clients some of which only do muc and others mix for sometime

  153. singpolyma

    What's wrong with disco?

  154. singpolyma

    Oh, you mean disco against the client

  155. moparisthebest

    I'm using multiple clients only half of which are online at any time

  156. moparisthebest

    Yes, sorry