processone / processone/ejabberd

Module Shared Roster removes subscription instead of updating groups

Open
#2,960 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Kind:Bug To reconsider
Dominant language
Erlang
Stars
6.7k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Hello !

I've opened a JSXC issue that explains this issue if you want to have a look : https://github.com/jsxc/jsxc/issues/793

It seems, after investigations, that this is a server-side issue according to the XMPP specifications (https://tools.ietf.org/html/rfc6121#section-2.1.6 page 22).

When a contact is removed from a shared roster where we are but still here in another shared roster where we also are, Ejabberd should send this kind of request (from specs) :

The user who has this item in her roster might want to add the item
   to another group.

   C: <iq from='juliet@example.com/balcony'
          id='di43b2x9'
          type='set'>
        <query xmlns='jabber:iq:roster'>
          <item jid='romeo@example.net'
                name='Romeo'>
            <group>Friends</group>
            <group>Lovers</group>
          </item>
        </query>
      </iq>

   Sometime later, the user might want to remove the item from the
   original group.

   C: <iq from='juliet@example.com/balcony'
          id='lf72v157'
          type='set'>
        <query xmlns='jabber:iq:roster'>
          <item jid='romeo@example.net'
                name='Romeo'>
            <group>Lovers</group>
          </item>
        </query>
      </iq>

But instead, Ejabberd sends a subscription="remove" request (from my implementation) :

<item xmlns="jabber:iq:roster" subscription="both" jid="smassonnat@gofast-comm-internal.ceo-vision.com">
    <group>**4_Group**</group>
    <group>**5_Orga**</group>
</item>
.......
<iq xmlns="jabber:client" to="jleman@gofast-comm-internal.ceo-vision.com/jsxc-d4c069ff" from="jleman@gofast-comm-internal.ceo-vision.com" type="set" id="push14351270947443124645">
    <query xmlns="jabber:iq:roster">
        <item subscription="remove" jid="smassonnat@gofast-comm-internal.ceo-vision.com">
            <group>**5_Orga**</group>
        </item>
    </query>
</iq>

Instead of sending a remove request on 5_Orga, ejabberd should send a set request on 4_Groups in this case.

Thanks in advance !

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the shared-roster scenario described in the issue, then trace the server-side XMPP roster update handling while comparing the expected RFC 6121 behavior and the linked JSXC report. Done means removing a contact from one shared roster preserves it in another by sending an updated roster set rather than subscription="remove".

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.