Type |
Bug
|
Priority |
Minor
|
Assignee | |
RedmineID |
2118
|
Version |
tigase-server-7.1.0
|
Spent time |
6h
|
Issue Votes (0)
Watchers (0)
Type |
Bug
|
Priority |
Minor
|
Assignee | |
RedmineID |
2118
|
Version |
tigase-server-7.1.0
|
Spent time |
6h
|
Hi:
I am not very sure if it is a problem.Below is test case:
Precondition:
There are two user:user1 and user2.
Test step:
1.user1 add roster:user1 add user2 as his contact:
request:
response:
2.user1 update roster:change the name of user2 to empty:
request:
response:
See,the contact's name is still "user2" other than expeced empty.
There are this sentence in RFC6121(http://xmpp.org/rfcs/rfc6121.html#roster-update):_Implementation Note: Including an empty 'name' attribute is equivalent to including no 'name' attribute; both actions set the name to the empty string._
So I think if user want to modify his contact name to empty,tigase server should also push empty name rather than "previous name".
I also have found the reason of this issue(if it is):In RosterFlat#addBuddy(XMPPResourceConnection, JID, String, String[], String) about line 191:
The relem is cached in memory of session scope.It's retrived in RosterFlat#getUserRoster(XMPPResourceConnection):roster = (Map<BareJID, RosterElement>) session.getCommonSessionData(ROSTER) and updated in RosterFlat#saveUserRoster(XMPPResourceConnection):session.setData(null, ROSTER, sb.toString());
If name in request of updating roster is empty,relem won't set the name to empty and previous name would be sent to client.