lovetoxif i send an IQ to a server without a "to" attribute
MattJMy favourite topic!
lovetoxserver needs to treat like my bare jid?
lovetoxbecause the rfc text is a bit cryptic
jonas’lovetox, yes
lovetoxok nice
jonas’but implementations vary :)
jonas’be aware that you might get your IQ back with a @to attribute
jonas’instead of without
jonas’so your reply matchers have to treat @to=localBareJID identical to absent @to
jonas’%s/to/from/g, sorry
jonas’%s/@to/@from/g, sorry
lovetoxyes, actually i do this very early after stanza parsing
lovetoxif there is to or from missing
jonas’:+1:
jonas’then you should be good
lovetoxi fill in te respective values the rfc says
Ge0rGand then you have the missing @to in carbons
MattJMy opinion: clients should never use the 'to' attribute of incoming stanzas
lovetoxbecause i simply dont want to deal with absent from / to later in my code
MattJBut I can understand why the missing/different 'from' trips implementations up
lovetoxyeah incoming from is obviously important
jonas’MattJ, yes, it was a tpyo
lovetoxi asked about outgoing to
jonas’MattJ, yes, it was a typo
lovetoxbecause i spares me to always look up my bare jid
lovetoxon the various PEP operations
Жокирhas left
Beherithas left
Beherithas joined
Beherithas left
Beherithas joined
Beherithas left
Beherithas joined
debaclehas joined
debaclehas left
lovetoxhas left
lovetoxhas joined
Beherithas left
etahas left
etahas joined
lovetoxhas left
Beherithas joined
Beherithas left
Beherithas joined
adiaholic_has left
adiaholic_has joined
Beherithas left
Beherithas joined
sonnyhas left
sonnyhas joined
adiaholic_has left
lovetoxhas joined
adiaholic_has joined
debaclehas joined
goffihas left
Lancehas joined
dendanghas joined
dendanghas left
lovetoxhas left
Wojtekhas joined
lovetoxhas joined
sonnyhas left
sonnyhas joined
sonnyhas left
sonnyhas joined
Bartekhas joined
Bartekhas left
Lancehas left
KevI don't have the RFC to hand, but last time I looked it up I decided that if a server stamps a bare JID as the 'from' of a reply to to a stanza that has no 'to', that is not allowed, and therefore a bug.
KevSo
> But I can understand why the missing/different 'from' trips implementations up
Clients are allowed to be tripped up by this, because it's illegal.
KevAlthough ISTR there is at least one case where, although the server has to treat no to and bare JID as the same, one of the protocols requires that it be no to rather than bare JID for no good reason.
flowKev, which case is that?
KevI don't recall, sadly.
Beherithas left
flowre the first part: I only cound find the following stanza error rule:
2. The error stanza SHOULD simply swap the 'from' and 'to' addresses
from the generated stanza,
flowso I am not sure if I would call the behavior you described above a bug
lovetoxmissing from attribute is allowed
lovetox When the server generates a stanza from the server for delivery
to the client on behalf of the account of the connected client
(e.g., in the context of data storage services provided by the
server on behalf of the client), the stanza MUST either (a) not
include a 'from' attribute or (b) include a 'from' attribute
whose value is the account's bare JID
lovetoxand i think thats the case MattJ was thinking about
Kevflow: You might be right. It might be that type=result doesn't mandate that, only type=error.
Kevlovetox: Yes, missing from is definitely allowed.
Lancehas joined
sonnyhas left
sonnyhas joined
Beherithas joined
sonnyhas left
sonnyhas joined
lovetoxi wonder why this was made that way
lovetoxit seems really not worth it, its not expected that a big percentage of all traffic is from server to client in a account context
lovetoxlets save 20 bytes on every 50th message
lovetoxbut makes it very easy to be tripped up as a developer
sonnyhas left
sonnyhas joined
sonnyhas left
sonnyhas joined
test2has joined
Beherithas left
Beherithas joined
sonnyhas left
sonnyhas joined
Guushas left
Guushas joined
Beherithas left
lovetoxjonas’, im looking again trhough aioxmpp
Beherithas joined
lovetoxand i see you raise an exception when a IQ error is returned
lovetoxi guess i look into jabbercat how this looks in a client code
lovetoxi had the same thought, for my library, to raise exception
lovetoxbut i wonder how nice this is for client developers
lovetoxespecially for iq errors
etauses Promises for IQs and just fails the promise
lovetoxeta, whats the lib you are writing?
etalovetox: the component library used by whatsxmpp
eta(which isn't really a fully separate thing yet)