Properly handle comparison of JIDs (#33)
Closed
Andrzej Wójcik (Tigase) opened 8 years ago
Due Date
2016-10-25
Andrzej Wójcik (Tigase) commented 8 years ago

I changed jid comparison logic to use hash of lowercased JID for comparison and not to lowercase original JID stored in database.

Only exception from this rule is Postgres schema as PostgreSQL allows creation of index of lowercased values of table columns - this provides us same feature with better performance as we do not need to calculate hash of lowercased JID.

I applied changes to UA schema and implementations as MA and UA schemas share tables.

wojciech.kapcia@tigase.net commented 8 years ago

I've reviewed the changes and they look OK. A couple of comments:

  • database/derby-message-archiving-schema-1.3.0.sql contains this line which updates the tables jid instead hashed filed:
update tig_ma_jids set jid = LOWER(jid), "domain" = LOWER("domain") where jid <> LOWER(jid) or "domain" <> LOWER("domain");
  • the tests seem to use UUID, which don't test case comparison/storing/retrieval.
Andrzej Wójcik (Tigase) commented 8 years ago

I removed this update statement and added separate test for jid comparison to AbstractMessageArchiveRepositoryTest class.

wojciech.kapcia@tigase.net commented 8 years ago

Works correctly now.

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