jdev - 2019-11-23

  1. lovetox

    must a IQ ID be unique within a session?

  2. lovetox

    i dont remember reading this anywhere

  3. lovetox

    but would be weird if a client would have to expect reoccurring iq ids

  4. Zash


  5. jonas’

    lovetox, It is up to the originating entity whether the value of the 'id' attribute is unique only within its current stream or unique globally.

  6. jonas’


  7. lovetox

    ok but it has to be one of either

  8. lovetox

    thought so, otherwise this would create weird problems

  9. jonas’

    lovetox, in which way?

  10. jonas’

    because a remote client may open a new stream without you noticing

  11. jonas’

    so you still might see duplicate IDs

  12. Zash

    At least avoid using the same (from, to, id) while one such iq is in flight

  13. lovetox

    i just thought about, if i send a iq get

  14. lovetox

    i only save the id, and if i see the id i call the callback

  15. Zash

    What if I reply with the same id from a different jid?

  16. lovetox

    its considered so unlikely that i can live with it

  17. Zash

    feels bad man

  18. lovetox

    you would have to guess the id in the right moment

  19. lovetox

    also iqs i send are uuid

  20. lovetox

    so the chance is lets say near zero

  21. lovetox

    it would be a major achievment if you could guess a uuid in the right moment

  22. lovetox

    but i guess i answered my own question

  23. lovetox

    because im in control of choosing the id

  24. lovetox

    not the server