Added users do not request presence subscription (#31)
Closed
Daniel Wisnewski opened 7 years ago
Due Date
2017-04-11

Adding other users to roster from application works OK. When other users add user on iOS application, presence subscription is not requested from other users, and is not updated on application. Below is the XML stream from the requesting entity (in this case zaner@xmppexample.dynu.com). The Application does not request presence subscription.

<presence type="subscribe" to="iosuser@xmppexample.dynu.com">
<nick xmlns="http://jabber.org/protocol/nick">zander</nick>
</presence>


<iq type="set" to="zander@xmppexample.dynu.com/PC" id="rsttig4">
<query xmlns="jabber:iq:roster" ver="">
<item subscription="none" name="iosuser" jid="iosuser@xmppexample.dynu.com"/>
</query>
</iq>


<iq type="result" id="rsttig4"/>


<iq type="result" to="zander@xmppexample.dynu.com/PC" id="aabfa"/>


<iq type="set" to="zander@xmppexample.dynu.com/PC" id="rsttig5">
<query xmlns="jabber:iq:roster" ver="">
<item subscription="none" ask="subscribe" name="iosuser" jid="iosuser@xmppexample.dynu.com"/>
</query>
</iq>


<iq type="result" id="rsttig5"/>


<presence from="iosuser@xmppexample.dynu.com" type="subscribed" to="zander@xmppexample.dynu.com"/>


<iq type="set" to="zander@xmppexample.dynu.com/PC" id="rsttig6">
<query xmlns="jabber:iq:roster" ver="">
<item subscription="to" name="iosuser" jid="iosuser@xmppexample.dynu.com"/>
</query>
</iq>


<iq type="result" id="rsttig6"/>


<presence from="iosuser@xmppexample.dynu.com/iPad" to="zander@xmppexample.dynu.com">
<c xmlns="http://jabber.org/protocol/caps" node="http://tigase.org/TigaseSwiftX" ver="lAaIceFKTDJeIFtVD+bOfZXi+gk=" hash="sha-1"/>
<priority>5</priority>
<status>away</status>
</presence>

<pre>
Andrzej Wójcik (Tigase) commented 7 years ago

If I got this right, application do not send presence subscription to user which sent presence subscription to application and was accepted. Am I correct?

If so, then question is why application should do that? Even if it should be done, then user should be asked if he/she wishes to subscribe to presence of this contact.

Now it should be possible to edit newly added contact and toggle button to request subscription from remote user, which would result in sending presence-subscribe request.

Daniel Wisnewski commented 7 years ago

Yes, application received subscription request and I clicked approve. Requesting user does see presence changes, but the ipad does not request presence back.

I can add the user in the application afterwards and request presence that way and I can now see presence changes.

I feel this is expected behavior for most XMPP clients to ask if you want to get presence request from another user, and removes a manual step for having users add a mobile client to the roster.

Artur Hefczyc commented 7 years ago

I agree with Daniel on this. From the end-user perspective some more automation and leading a user by application would be expected. So, when a subscription request is received, application should ask if a user wants to add the user to the roster and also ask if subscription request should be sent to the contact. So, no additional editing of the contact is required.

Actually most of mobile clients, assume that when a user accepts subscription request he also wants to automatically send subscription request to the contact, so not additional questions are asked and I think this is a good approach.

Andrzej Wójcik (Tigase) commented 7 years ago

Added this feature and make it configurable in settings. By default it does automatic subscription of contacts presence when we accept presence subscription requests.

Daniel Wisnewski commented 7 years ago

this seems to be fixed, adding new users starts the two way communication. Although two things noticed:

  1. If user on ipad is already on added users' roster, ipad does not respond (or display) any re-request of authorization.

  2. application does not appear to respond to any manual authorization stanzas like below.

<presence type="subscribed" to="iosuser@xmppexample.dynu.com"/>


<presence type="subscribe" to="iosuser@xmppexample.dynu.com">
<nick xmlns="http://jabber.org/protocol/nick">IOS</nick>
</presence>
Andrzej Wójcik (Tigase) commented 7 years ago

Daniel Wisnewski wrote:

this seems to be fixed, adding new users starts the two way communication. Although two things noticed:

  1. If user on ipad is already on added users' roster, ipad does not respond (or display) any re-request of authorization.

Could you clarify this a bit? If user on ipad is already on added users roster then this means that at the same time added user must already be in ipad users roster. This is how XMPP behaves, so in fact you are not adding new user but editing existing one. I cannnot tell what subscription state was between this 2 users before and it may happen that XMPP server will decide that this "releation" already exists and will not do any thing (and will not forward this presence subscription to client as it is already subscribed).

  1. application does not appear to respond to any manual authorization stanzas like below.

[...]

This may be filtered by XMPP server due to existing subscription state. I cannot tell if this happened in this case. What was subscription state between users before you sent this presences?

Daniel Wisnewski commented 7 years ago

I guess it would be better in reverse.

for 2. Subscription state did not exist. Ipad did not have any users on roster (empty roster). User1 had ipad on roster outside application but is unsubscribed. This scenario may exist when ipad removes user1 from roster (but user1 does not remove ipad from roster).

Attempting to re-establish subscription by User1 is what happens in example 2.

When adding user1 to ipad roster, subscription request is sent to user1, but it's not reciprocated.

Andrzej Wójcik (Tigase) commented 7 years ago

I just verified behaviour and I do not see issues you mentioned.

I tried to replicate both issues:

  • Issues with manually sent presences

Tigase XMPP Server ignores type=subscribed presence as it was delivered to user which was not requesting subscription - packet is dropped.

In second case I see subscription request in Messenger. Steps used to replicate:

  • On iPad (@tigase.im@) I removed my contact at sure.im

  • Verified in Psi+ that on sure.im I have contact of andrzej.wojcik@tigase.im in roster with subscription none

  • Sent presence type=subscribe and got response from XMPP server

<presence type="subscribe" to="andrzej.wojcik@tigase.im">
  <nick xmlns="http://jabber.org/protool/nick">Andrzej - Sure.IM</nick>
</presence>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig7">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="none" ask="subscribe" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig7"/>
  • Got subscription request on iPad and I accepted it

  • Got updated subscription and subscription request from iPad in Psi+

<presence from="andrzej.wojcik@tigase.im/MacBook Pro (Andrzej).local" to="andrzej.wojcik@sure.im">
  <c xmlns="http://jabber.org/protocol/caps" node="http://tigase.org/TigaseSwiftX" ver="gEIO8fkNSdFoA8eQmTSztzYzlrM=" hash="sha-1"/>
  <priority>5</priority>
  <status/>
</presence>

<presence from="andrzej.wojcik@tigase.im" type="subscribed" to="andrzej.wojcik@sure.im"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig8">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="to" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig8"/>

<presence from="andrzej.wojcik@tigase.im" type="subscribe" to="andrzej.wojcik@sure.im"/>

<iq type="set" id="aacaa">
  <query xmlns="jabber:iq:roster">
    <item name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>
  • I've accepted subscription request from iPad on Psi+ (Psi decided to send subscribe and @subscribed@)
<presence type="subscribe" to="andrzej.wojcik@tigase.im">
  <nick xmlns="http://jabber.org/protocol/nick">Andrzej</nick>
</presence>

<presence type="subscribed" to="andrzej.wojcik@tigase.im"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig9">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="to" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig9"/>

<iq type="result" id="aacaa" to="andrzej.wojcik@sure.im/587989001-tigase-2136"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig10">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="both" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig10"/>
  • I verified that I see presence of both accounts on both ends and subscription is set to both in both cases.

  • Testing adding Psi+ account as a contact on iPad

Steps used to replicate:

  • On iPad (@tigase.im@) I removed my contact at sure.im

  • Verified in Psi+ that on sure.im I have contact of andrzej.wojcik@tigase.im in roster with subscription none

  • Added contact on iPad with both toggles related to subscription set to on

  • Psi+ received subscription request

<presence from="andrzej.wojcik@tigase.im" type="subscribe" to="andrzej.wojcik@sure.im"/>

<iq type="set" id="aacda">
  <query xmlns="jabber:iq:roster">
    <item name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>
  • After accepting subscription request Psi+ responded with:
<presence type="subscribe" to="andrzej.wojcik@tigase.im">
  <nick xmlns="http://jabber.org/protocol/nick">Andrzej</nick>
</presence>

<presence type="subscribed" to="andrzej.wojcik@tigase.im"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig13">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="none" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig13"/>

<iq type="result" id="aacda" to="andrzej.wojcik@sure.im/587989001-tigase-2136"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig14">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="none" ask="subscribe" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig14"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig15">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="from" ask="subscribe" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig15"/>
  • At this point at got subscription request confirmation on iPad and after accepting it Psi+ got:
<presence from="andrzej.wojcik@tigase.im/MacBook Pro (Andrzej).local" to="andrzej.wojcik@sure.im">
  <c xmlns="http://jabber.org/protocol/caps" node="http://tigase.org/TigaseSwiftX" ver="gEIO8fkNSdFoA8eQmTSztzYzlrM=" hash="sha-1"/>
  <priority>5</priority>
  <status/>
</presence>

<presence from="andrzej.wojcik@tigase.im" type="subscribed" to="andrzej.wojcik@sure.im"/>

<iq type="set" to="andrzej.wojcik@sure.im/587989001-tigase-2136" id="rsttig16">
  <query xmlns="jabber:iq:roster" ver="7b5e7bfad9f4dd1ddb333982e823c1b3">
    <item subscription="both" name="Me@Tigase.IM" jid="andrzej.wojcik@tigase.im"/>
  </query>
</iq>

<iq type="result" id="rsttig16"/>
  • I verified that on both ends I have subscription of type both

Daniel, as you can is it worked for me just fine using Tigase iOS Messenger, Psi+ and accounts on sure.im installation (one in sure.im and second in @tigase.im@). Please look into steps I just posted and let me know if you did anything which would be different and could impact this process (ie. like 2 clients connected to same account)

Artur Hefczyc commented 7 years ago

How is it going? I am planning to publish the client for public tests by the end of the week.

Daniel Wisnewski commented 7 years ago

I retested the behavior with both ipad and iphone, and I too could not replicate the issue, so I am closing issue as the initial issue is resolved.

issue 1 of 1
Type
Bug
Priority
Major
Assignee
RedmineID
5210
Version
Public testflight version.
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/siskin-im#31
Please wait...
Page is in error, reload to recover