-
Ge0rG
is it illegal to send a presence update to multiple joined MUCs using the same szanza id?
-
jonas’
maybe
-
jonas’
It is up to the originating entity whether the value of the 'id' attribute is unique only within its current stream or unique globally.
-
jonas’
you’re fulfilling neither of those .. requirements .. in that case
-
ralphm
But treating ids as unique in its own is bound to give you grief, so better take the addressing into account.
-
Ge0rG
oh god who wrote that code? `if (packetID != null ? !packetID.equals(packet.packetID) : packet.packetID != null) {`
-
ralphm
Oops
-
Ge0rG
So I was just sending the same presence packet to multiple @to MUCs, to my own participant JID, but it turns out only to work randomly. And from the logs it seems to have uncovered another unrelated bug.
-
Ge0rG
Oh my. You can't send-change-send the same Packet object in smack3.
-
ralphm
I think there's an assumption that clients don't repeat stanza ids on outbound traffic, but can't find the reference. As a recipient, you probably want to associate with the sender and recipient address. I'm pretty sure there are a lot of exploitable/buggy implementations.
-
ralphm
*especially* with MUC
-
Ge0rG
the problem is that I give smack3 a reference to the Packet object, not a copy. So by changing the JID, all of the enqueued references are sent to the same JID
-
ralphm
Haha
-
Ge0rG
which explains why the MUC status update happens randomly in a subset of MUCs
-
ralphm
That's a bad idea to try anyway
-
Ge0rG
because race conditions between enqueue and send thread.
-
Ge0rG
flow: does smack4 create a local copy of a Packet that you pass to sendPacket()?
-
ralphm
Yeah, once you send a stanza, don't touch it. I'm many libraries and languages.
-
ralphm
In
-
Ge0rG
See, I was just trying to be smart and to re-use resources.
-
Ge0rG
also, should I set the same priority for MUCs as for my normal presence, or just keep it at 0?
-
jonas’
aioxmpp would behave the same
-
Ge0rG
the nicest thing is, when I was debugging the user report, single-stepping through the code made the bug vanish.
-
jonas’
but it also has a convenient way to duplicate a stanza, so...
-
jonas’
oh, a heisenbug
-
ralphm
No, presence to MUC is directed and you can do whatever
-
Ge0rG
And I was short of telling the user they are crazy. After they provided logs, I got suspicious, because the 0198 logger told me the packet is not being counted, which should never happen after <enable/>
-
flow
Ge0rG, no, that wouldn't be sensible, as you had to pay the copy operation for every sendStanza() whereas I'd assume only a minority calls would benefit from it
-
flow
but Presence has a copy constructor
-
Ge0rG
flow: not in smack3 ;)
-
flow
yeah, I can't really comment on five year old code
-
Ge0rG
flow: it might be a good idea then to add a @warning to the docs, telling to never submit the same Packet twice.
-
Ge0rG
C++ has some sophisticated ownership management cruft around that. I don't think there is any way to enforce that in Java though
-
flow
I'm not sure if it justifies a warning since it is common for sink like functions that you hand over ownership of the provided arguments, but a note to the javadoc sure can't hurt
-
Ge0rG
it's not going to prevent people from doing what I did, leading to hard to debug issues. But after they realize what they did wrong, they'll see the message in the docs and feel even more ashamed.
-
jonas’
hah
-
flow
patches welcome ;)
-
Ge0rG
I had to look up the semantics of Queue.contains() and single-step through Packet.equals() to be enlighted
-
Seve
Hey guys, I couldn't attend the meeting yesterday unfortunately, but congratulations to everyone and thank you very much Alex :)
-
jonas’
Seve, congratulations to you, too :)
-
Ge0rG
and congratulations to jonas’ as well!
-
jonas’
thanks, but didn’t we have that yesterday or did I miss something? ;-)
-
Ge0rG
jonas’: I think I didn't congratulate you specifically.
-
jonas’
ah, well
- Seve sends happy stanzas for everyone.
- Ge0rG now wonders what the XML looks like for that
-
Zash
User Mood?
-
Zash
`<happy xmlns='http://jabber.org/protocol/mood'/>`
-
jonas’
<x xmlns="jabber:x:oob"><url>https://www.youtube.com/watch?v=ZbZSe6N_BXs</url></x>?
-
Zash
Lol ❌
-
Ge0rG
jonas’: I'm disappointed in your taste of music.
-
Ge0rG
(I also kind of had expected https://www.youtube.com/watch?v=DLzxrzFCyOs)
-
jonas’
Ge0rG, who says that this is my taste of music?
-
Ge0rG
jonas’: I considered it would be too meta if you implied that that was Seve's music taste.
-
jonas’
no, I don’t know his music taste :)
-
Seve
I like human music
-
Ge0rG
as opposed to computer-generated music?
-
Ge0rG
what about music written by humans and performed by computers? (the 386dx project comes to mind)
-
Seve
It was a reference to a show called Rick and Morty :D https://www.youtube.com/watch?v=S1jWdeRKvvk
-
flow
-
jonas’
empty message is empty