XSF Discussion - 2018-11-04


  1. jonas’

    so I’m thinking about the case where SM resumption fails, but the server gives me an ``h`` value in the <failed/> stanza (as allowed in XEP-0198).

  2. jonas’

    I’m not sure what to do with this information, as a library.

  3. jonas’

    I can of course mark all unacked stanzas covered by the h value as acked

  4. jonas’

    that probably makes sense unconditionally

  5. jonas’

    does it also make sense to automatically re-send stanzas which have not been acked?

  6. jonas’

    I tend to "no, because we don’t know what happened in the meantime and the application should re-sync state and re-send whatever it wants to re-send"

  7. jonas’

    i.e. treat the stanzas as "lost" and attach a clear error to their tracking handle.

  8. lovetox

    hm that would be rather bad in my opinion

  9. lovetox

    imagine a mobile use case, where the SM timeout is 5 minutes

  10. jonas’

    what would be "bad"?

  11. lovetox

    so all messages i send after 5 minutes when im currently offline, get a error

  12. lovetox

    and i have to retype them?

  13. jonas’

    of course not

  14. jonas’

    your client would have a resend button

  15. jonas’

    or may even resend them automatically

  16. jonas’

    question is, what should the *library* do

  17. lovetox

    if you think there is a case where a client does not want to resend them you have to implement this option

  18. jonas’

    I don’t think that resending by default is the safe way

  19. lovetox

    whats unsafe?

  20. jonas’

    (note: not insecure, but unsafe)

  21. jonas’

    for example, a presence stanza sent to a MUC

  22. jonas’

    which changes your nickname

  23. jonas’

    no, bad example, you’d await an ack for htat

  24. jonas’

    but you get the idea: state was lost, and stanzas were queued under assumption of state which was lost.

  25. jonas’

    I think re-sending those stanzas under a different state isn’t safe

  26. lovetox

    does the lib hold the stanzas or the client?

  27. jonas’

    the lib

  28. jonas’

    it has the outbound queue where unacked stanzas are kept until they are acked

  29. lovetox

    then you provide the stanzas, and he can sort stuff out he doesnt want to be resent?

  30. jonas’

    that’s kinda what happens when I mark them as failed

  31. lovetox

    as a client dev, i would disable all functionality in the client except sending messages

  32. lovetox

    to circumvent any complicated problems

  33. lovetox

    the most important thing is sending a message

  34. lovetox

    everything else, like changing a nick or stuff like that, can wait until the user is online

  35. jonas’

    > as a client dev, i would disable all functionality in the client except sending messages

  36. jonas’

    that statement is confusing

  37. lovetox

    i mean message from the standpoint of the user

  38. lovetox

    not from the protocol

  39. jonas’

    you mean while offline?

  40. lovetox

    yes

  41. jonas’

    right

  42. jonas’

    but you don’t know immediately that you’re "offline"

  43. lovetox

    dont i? gajim seem to know it pretty sson

  44. lovetox

    dont i? gajim seem to know it pretty soon

  45. lovetox

    usually after the first stanza

  46. jonas’

    depends on the failure mode

  47. jonas’

    right, and that first stanza could be whatever action the user triggered

  48. jonas’

    also, I’m not sure that blocking most of the UI on intermittend network failures is a good thing

  49. lovetox

    Gajim blocks all UI, you cant even write messages ^^

  50. jonas’

    meh

  51. lovetox

    i agree its not good

  52. lovetox

    but it needs a lot of work to cache all message, make good ui for it, so the user sees whats sent and what not etc

  53. lovetox

    and then you still have to think alot about the things you just thinign now

  54. jonas’

    indeed

  55. lovetox

    have to go, see you later

  56. jonas’

    gl

  57. flow

    jonas’, smack das also resend unacked stanzas on resumption FWIW

  58. jonas’

    flow, on failed resumption?

  59. jonas’

    note that this is all about failed resumption.

  60. flow

    yes, alswas

  61. flow

    IIRC

  62. jonas’

    huhm.

  63. flow

    I see the issues you mentioned, but one has to weight it against the advantages

  64. jonas’

    I think this conflicts with the state resync which aioxmpp (i think correctly) does after a failed resumption too much to do this by default

  65. jonas’

    although it could be interesting to auto-resend stanzas after everything else has reported that state has been synced (e.g. MUCs rejoined)

  66. jonas’

    but that would give things even more time to diverge unknowingly…

  67. flow

    hmm, also sounds like to much complexity for a minor/very rare/(non existent?) issue

  68. jonas’

    yeah, I also don’t think this is a good idea

  69. jonas’

    I think I’ll go the route of: resumption failed? -> mark acked stanzas as acked, mark unacked stanzas as failed and let the application/services deal with it

  70. jonas’

    because that’s the only way I can provide clear guarantees to the using code

  71. jonas’

    and aioxmpp is all about clear guarantees

  72. flow

    now I wonder what the code really does on failed resumption, let me check

  73. flow

    yeah, smack does simply resend in every case

  74. jonas’

    ok

  75. jonas’

    I’ll go with "make unacked stanzas fail"

  76. jonas’

    this makes "failed resumption without @h" just a special case of "failed resumption with @h", which is conceptually very nice.

  77. jonas’

    and provides consistency.

  78. Ge0rG

    jonas’ [12:10]: > I’ll go with "make unacked stanzas fail" That's a good approach. In yaxim, I'm re-sending all messages that are pending, after a reconnect. But obviously only proper messages

  79. flow

    Ge0rG, so no presences? how do you prevent lost presence updates?

  80. flow

    by remembering the last presence and resend it on reconnection/failed resumption?

  81. Ge0rG

    flow: when resumption fails, you need to redo all presence anyway

  82. Ge0rG

    flow: I'm sending presence from the client preferences on connect

  83. flow

    ok, nice idea, so on failed resumption you filter messages stanzas out of the list of pending stanzas and only send those

  84. flow

    that could work

  85. flow

    and on successfull resumption one could remove all but the last self-presence stanza, although that optimization probably won't give you much in most cases

  86. jonas’

    on successful resumption, you don’t need to do anything

  87. flow

    you don't need do, right

  88. jonas’

    ahh, I see, you want to CSI-style collapse multiple queued outbound stanzas

  89. flow

    yeah, just some premature micro optimization that nobody should do client side :D

  90. jonas’

    heh

  91. flow

    bbl

  92. jonas’

    gl

  93. Ge0rG

    The issue with that is that you need to fix the counters. There is a big chance to f* it up.

  94. jonas’

    you don’t need to fix counters for stanzas which haven’t been sent to the server yet (only queued)

  95. jonas’

    you don’t need to fix counters for stanzas which haven’t been acked by the server yet (only queued / sent without ack)

  96. jonas’

    you don’t need to fix counters for stanzas of which the server said it didn’t receive them upon resumption

  97. Seve

    So I sent my application for Board. Please wish me lucky stanzas!

  98. jonas’

    \o/

  99. jonas’

    so we’ll at least have a competition for board this year...

  100. jonas’

    Link Mauve, https://wiki.xmpp.org/web/index.php?title=Emmanuel_Gil_Peyrot_for_Council_2018&action=edit&redlink=1

  101. Seve

    Very healthy indeed!

  102. jonas’

    well, maybe. ralphm and arc still need to do their applications.

  103. jonas’

    Seve, sounds great :)

  104. Seve

    By the way, last time I think I also had the same problem. Not sure if it was me or some kind of cache. My application link still appears in red colour. Do you remember what was it, jonas’? I feel you were also in the discussion last time I mentioned that.

  105. jonas’

    yes, that’s some caching

  106. jonas’

    I think there’s a magic thing you can say to mediawiki to purge the caches, or you just wait

  107. jonas’

    there we go

  108. jonas’

    append ?action=purge to the URL

  109. Seve

    Woah, lovely! Saving that for next time, thanks, jonas’!

  110. jonas’

    Even though I’m sure that Alex will click the links to be sure that there really is no application before removing candidates when the application period closes :)

  111. jonas’

    (when clicking the link, you get shown the actual existing page, not the "no page here" page)

  112. jonas’

    hm

  113. ralphm

    Yes , I do. Haven't copy/pasted yet

  114. jonas’

    https://github.com/horazont/aioxmpp/pull/254/commits/f014831357cb7804c0ba6a5b45ebc65f62064bcf#diff-46a421af09863be52f28a8bb03d339d1R34 this is what I went for

  115. jonas’

    (regarding the stream management discussion from earlier)

  116. vanitasvitae

    ralphm, can you replace my old blog (https://blogs.fsfe.org/vanitasvitae/category/xmpp/feed/) on the planet with my new blog (https://blog.jabberhead.tk/category/xmpp/feed) ?