#794 Prosody generating presence-unsubscribed during client-to-client subscription

Reporter ge0rg
Owner Zash
Created
Updated
Stars ★ (1)  
Tags
  • Milestone-0.11
  • Type-Defect
  • Status-Fixed
  • Priority-Medium
  1. ge0rg on

    I have two instances of yaxim connected to the same prosody server, easy@yax.im and georg@yax.im. Now, easy@yax.im scans an XEP-0379 PARS QR code and sends a subscription request followed by a roster-set: OUT: <presence id="BbzI6-20" to="georg@yax.im" type="subscribe"><preauth token="2gna3maxx1dhj2hf" xmlns="urn:xmpp:pars:0" /><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="ih6Hz6YBD8bnYCKQn0Sj+lnjFMg="/></presence> OUT: <iq id="BbzI6-21" type="set"><query xmlns="jabber:iq:roster" ><item jid="georg@yax.im" name="Georg"></item></query></iq> Then, because there is a bug in smack3, another presence-subscribe is emitted by easy@yax.im: OUT: <presence id="BbzI6-23" to="georg@yax.im" type="subscribe"><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="ih6Hz6YBD8bnYCKQn0Sj+lnjFMg="/></presence> Some milliseconds later, the request is approved by georg@ and easy@yax.im sees the response: IN: <presence to="easy@yax.im" from="georg@yax.im" type="unavailable"></presence> (this is probably generated due to the roster change) IN: <presence id="W4vDT-52" to="easy@yax.im" from="georg@yax.im" type="subscribe"><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="ih6Hz6YBD8bnYCKQn0Sj+lnjFMg="/></presence> Because easy@ is also PARS auto-approving, it immediately sends out a 'subscribed' response: OUT: <presence id="BbzI6-24" to="georg@yax.im" type="subscribed"><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="ih6Hz6YBD8bnYCKQn0Sj+lnjFMg="/></presence> Then, a really short moment later, prosody generates this presence packet and sends it to easy@yax.im. It is not generated by the other user! IN: <presence to="easy@yax.im" from="georg@yax.im" type="unsubscribed"></presence> For yaxim, this now looks like the other user unfriended us, so we are sad and unfriend them as well. That last stanza originates from prosody, and is probably related to #673 and https://hg.prosody.im/0.9/rev/ad0b15f253ee - it looks like this in the prosody log: Dec 08 17:20:33 yax.im:presence debug inbound presence subscribed from easy@yax.im for georg@yax.im Dec 08 17:20:33 yax.im:presence debug broadcasted presence of 1 resources from easy@yax.im to georg@yax.im Dec 08 17:20:33 yax.im:presence debug inbound presence probe from easy@yax.im for georg@yax.im Dec 08 17:20:33 yax.im:presence debug outbound presence unsubscribed from georg@yax.im for easy@yax.im

  2. Zash on

    https://hg.prosody.im/trunk/rev/62e7d6a73c72 claims to have fixed this. Tried to produce a scanison test script but didn't manage to make one that consistently failed and then succeed with the fix.

    Changes
    • owner Zash
    • tags Status-Fixed
  3. Zash on

    Changes
    • tags Milestone-0.11

New comment

Not published. Used for spam prevention and optional update notifications.