Roster removeUser makes user go offline instead of removing #186

Closed
stephenwoodford opened this Issue May 8, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

stephenwoodford commented May 8, 2013

When User A deletes User B from their roster, I have User B is still showing up on User A's roster as Offline. The protocol says that it is normal for User A to still show up on User B's roster so I remove User A from User B's roster using removeUser when User B receives a 'unsubscribed' stanza.

From what I can tell, I think the 'unavailable' presence being sent by the server from User B to User A is keeping User B on the roster. User B is not listed on User A's roster on the server (ejabberd), so it is specific to the framework or the way my app handles removing users. This all gets cleared up after the app is restarted, but calling fetchRoster and reloading the tableView does not fix the issue.

I can provide more information if necessary.

Collaborator

ObjColumnist commented May 8, 2013

Could you provide the SEND and RECV logs to help identify what part of the code logic is failing?

Contributor

andrewtj commented May 8, 2013

@ObjColumnist from @woodfors description, I think the problem is that when a presence stanza is received, both the memory and coredata roster storage modules create a user if one can't be found regardless of the presence type being "unavailable".

Collaborator

ObjColumnist commented May 8, 2013

That code certainly looks dodgy, a good way for @woodfors to test is to comment out that code.

Contributor

stephenwoodford commented May 8, 2013

Thanks for all the input guys. As @ObjColumnist suggested, I commented out the following line in XMPPRosterCoreDataStorage.m:

user = [XMPPUserCoreDataStorageObject insertInManagedObjectContext:moc
withJID:[presence from]
streamBareJidStr:streamBareJidStr];

And the issue seems to have resolved itself. I don't use rosterlessOperation mode so I don't think I should have any issues with the commenting out but is there a nicer way to fix this than commenting it out? Would adding a condition checking if the presence type is 'unavailable' work?

Thanks for the help again guys.

Collaborator

ObjColumnist commented May 8, 2013

I will change the code so that the user is only created if the XMPPRoster has allowRosterlessOperation set to YES.

Let me know if you find any reason why you wouldn't want this to happen.

@davidchiles davidchiles pushed a commit to davidchiles/XMPPFramework that referenced this issue Jan 26, 2016

@ObjColumnist ObjColumnist XMPPRosterStorage should only create users from presence if XMPPRoste…
…r allowRosterlessOperation is YES


Fixes #186
47eb470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment