jdev - 2020-08-18


  1. edhelas

    do you guys have some script to cleanup old presences in your clients ?

  2. jonas’

    what does that mean?

  3. edhelas

    or is there some rule that exists to explain that

  4. jonas’

    what are old presences?

  5. edhelas

    what is happening if you have a client that receives a presence and nothing else for days but stays connected

  6. jonas’

    nothing?

  7. edhelas

    nothing else from the other jid

  8. edhelas

    let me rephrase that

  9. jonas’

    why is that a problem?

  10. edhelas

    well after 5 days you can maybe think that somehow those presences are not valid anymore

  11. jonas’

    how could that be?

  12. edhelas

    well, regarding by your questions I have a feeling that it's not a problem :p

  13. Ge0rG

    edhelas: it's only a problem if you have significant loss on your s2s links

  14. Holger

    It may well be a 24/7 (mobile/terminal/whatever) client that manages to keep the session alive, of course. But yes it may also be borked s2s. Who cares about presence anyway :-)

  15. jonas’

    edhelas, as a client, you can’t do a lot, except cycling your session :)

  16. Ge0rG

    I care about presents!

  17. jonas’

    a server can send type="probe" presence stanzas to refresh

  18. edhelas

    i'm just seing some old presences in the movim db after a few days, and i was wondering that, might be a bug

  19. Ge0rG

    I'm logged into my server for 9 days now

  20. Ge0rG

    which coincidentally is the uptime of the server

  21. edhelas

    this causes issues with https://xmpp.org/extensions/xep-0319.html

  22. Zash

    Related https://issues.prosody.im/904

  23. Zash

    jonas’: But then you likely get only the new presence. Stale presence where the unavailable got lost would not get an unavailable unless you count one for the entire account.

  24. Zash

    I'm not so sure about 319. I've seen almost flood amounts of presence where 319 is the only diff.

  25. jonas’

    Zash, huh?

  26. jonas’

    type="probe" SHOULD be answered with unavailable if the peer is offline

  27. jonas’

    and an unavailable from the bare JID should count for all resources, in general, shouldn’t it?

  28. Zash

    Yes

  29. Zash

    But if you have another resource online

  30. jonas’

    ahhh

  31. Zash

    One that is different from what you think is online

  32. jonas’

    and there is no "end" marker...

  33. Zash

    That's where it gets tricky and you'll need some smart tracking / caching magic

  34. jonas’

    yeah

  35. jonas’

    I can come up with some, you can probably too.

  36. Zash

    Sure.

  37. Zash

    Doesn't strike me as an urgent enough problem tho, not when it'll have a memory cost.

  38. eta

    wait clients can't send probes?

  39. jonas’

    nope

  40. jonas’

    https://tools.ietf.org/html/rfc6121#section-4.3

  41. jonas’

    Presence probes SHOULD NOT be sent by a client, because in general a client will not need to send them since the task of gathering presence from a user's contacts is managed by the user's server. However, if a user's client generates an outbound presence probe then the user's server SHOULD route the probe (if the contact is at another server) or process the probe (if the contact is at the same server) and MUST NOT use its receipt of the presence probe from a connected client as the sole cause for returning a stanza or stream error to the client.

  42. jonas’

    well clients SHOULD NOT send probes

  43. eta

    so you can!

  44. eta

    I thought Dino did

  45. jonas’

    why would you tho

  46. eta

    iunno

  47. Zash

    Perhaps of interest / relevance: https://xmpp.org/extensions/xep-0310.html

  48. Zash

    Tho still needs server-side caching/tracking of remote presence

  49. Zash

    Altho, synthesizing an annotated unavailable bare-jid presence on (detected) s2s failure could work, and then you queue probes for when s2s comes back.

  50. lovetox

    there are cases when you want to presence probe

  51. lovetox

    although not very relevant ones

  52. lovetox

    for example if you use privacy lists

  53. lovetox

    when you remove some blocking presence rule, then you have to presence probe

  54. lovetox

    i dont think a server does that for you

  55. lovetox

    it does though in blocking command xep which is nice