Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roster removeUser makes user go offline instead of removing #186

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

Comments

@stephenwoodford
Copy link
Contributor

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.

@ObjColumnist
Copy link
Collaborator

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

@andrewtj
Copy link
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".

@ObjColumnist
Copy link
Collaborator

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

@stephenwoodford
Copy link
Contributor Author

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.

@ObjColumnist
Copy link
Collaborator

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 pushed a commit to davidchiles/XMPPFramework that referenced this issue Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants