Projects tigase _server tigase-mongodb Issues #21
Properly handle comparison of JIDs (#21)
Andrzej Wójcik (Tigase) opened 8 years ago
Due Date
2016-10-20

Local part of JID and domain part of JID needs to be compared in case insensitive way. We need to verify code and update it if required.

Andrzej Wójcik (Tigase) commented 8 years ago

I updated code to work with lowercased JIDs on database side to properly compare JID.

However this change requires update of MongoDB database, so that existing jids are also lowercased and hashes of JIDs are updated with hashes of lowercased jids. For that I prepared updateSchema method in every repository which needs to be converted and created MongoSchemaUpdater class with main method which allows to run schema update from command line.

%wojtek Anything else I should do? If not then please close this task.

wojciech.kapcia@tigase.net commented 8 years ago

After the discussion it was decided we should use:

  • sha1 columns for the purpose of querying data;

  • maintain JID case in JID column.

This way it will be in line with specification and Tigase JID/BareJID implementation (maintaining JID case while performing case insensitive comparison).

Andrzej Wójcik (Tigase) commented 8 years ago

I improved support for JID comparison in Mongo DB implementation by usage of JID hashes for lookup and storing original JID value as well.

Andrzej Wójcik (Tigase) commented 8 years ago

MongoDB schema is updated but in case of Mongo we use SHA-256 hashing algorithm.

For schemas for other databases and hosted in different projects I created separate tasks.

wojciech.kapcia@tigase.net commented 8 years ago

I've reviewed the changes and they look good.

issue 1 of 1
Type
Task
Priority
Normal
Assignee
RedmineID
4646
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-mongodb#21
Please wait...
Page is in error, reload to recover