Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 286934 - [xmpp] Disconnected users with resource IDs not removed from roster
Summary: [xmpp] Disconnected users with resource IDs not removed from roster
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.providers (show other bugs)
Version: 3.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: ecf.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-18 08:29 EDT by Jörg Rathlev CLA
Modified: 2009-08-24 06:05 EDT (History)
1 user (show)

See Also:


Attachments
Test case (3.91 KB, patch)
2009-08-18 08:29 EDT, Jörg Rathlev CLA
no flags Details | Diff
Test case (5.30 KB, patch)
2009-08-19 07:36 EDT, Jörg Rathlev CLA
slewis: iplog+
Details | Diff
Proposed patch (4.64 KB, patch)
2009-08-19 07:50 EDT, Jörg Rathlev CLA
slewis: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Rathlev CLA 2009-08-18 08:29:37 EDT
Created attachment 144809 [details]
Test case

Steps To Reproduce:
1. Connect a user with a resource ID (user@host/resource).
2. Disconnect the user.
3. Connect the same user with a different resource ID (user@host/resource2).

=> The user now appears twice in the roster, once with the old and once with the new resource. If resource IDs are generated randomly, this causes disconnected entries to be never removed.

The attached patch contains a new test case that fails due to this problem.
Comment 1 Jörg Rathlev CLA 2009-08-19 07:36:11 EDT
Created attachment 144944 [details]
Test case

Updated the test to include an additional test case where the same user connects twice with different resource names.
Comment 2 Jörg Rathlev CLA 2009-08-19 07:50:53 EDT
Created attachment 144945 [details]
Proposed patch

This is a patch that fixes the problem. Essentially, this restores some code from an earlier CVS revision (XMPPContainerPresenceHelper.java, 1.39) which removes the entry from the roster if a user disconnects but is still connected with some other resource.
Comment 3 Scott Lewis CLA 2009-08-20 14:41:00 EDT
(In reply to comment #2)
> Created an attachment (id=144945) [details]
> Proposed patch
> 
> This is a patch that fixes the problem. Essentially, this restores some code
> from an earlier CVS revision (XMPPContainerPresenceHelper.java, 1.39) which
> removes the entry from the roster if a user disconnects but is still connected
> with some other resource.
> 

Hi Jorg.  First, thanks for the patch/fix and test case...it all looks good and I've applied/tested and released both patches to HEAD.  I'll resolve this bug as fixed.

Have you had occasion to test this against more than one xmpp server/service?  The reason I ask is that I believe xmpp servers are sometimes inconsistent in how/when they specify jids (i.e. with/without resource identifiers, etc).  I'm frankly not sure whether there is something unspecified/ambiguous about XMPP or whether implementations just differ, but it could be an issue.

Thanks.
Comment 4 Jörg Rathlev CLA 2009-08-24 06:05:29 EDT
> Have you had occasion to test this against more than one xmpp server/service?

No, unfortunately not. I have tested only with the Openfire server.