Projects tigase _server server-core Issues #419
User id (#419)
Behnam Hatami opened 10 years ago
Due Date
2015-01-30

Hi,

I was migrating from mysql to postgre sql but i recognized a problem, mysql string comparison isn't case sensitive, so all the functionality for usernames with uppercase characters worked,

but when I moved to postgre sql, login and logout procedures don't work. is there any reason you keep usernames lowercase in the program and not in the database? and if you have this assumption that all usernames are lowercase, why when you trying to computing sha1 of a username you lower case the username?

Artur Hefczyc commented 10 years ago

Wojciech, please take a look at the PostgreSQL implementation in Tigase to fix the problem with login when migrating form MySQL to PostgreSQL.

Behnam, the XMPP specification (RFC) says that users can put either upper or lower case characters in the username or domain, however, the server must not be case sensitive when processing users' IDs. As a result we store in DB users' IDs the way they were entered by users but the logic is (or should be) case insensitive. It looks like the code works correctly for MySQL but it needs improvements for PostgreSQL.

wojciech.kapcia@tigase.net commented 10 years ago

Artur Hefczyc wrote:

Wojciech, please take a look at the PostgreSQL implementation in Tigase to fix the problem with login when migrating form MySQL to PostgreSQL.

Actually Login/Logoff in principle were working correctly. Only problem was with updating values of failed logins and online status, which are not always useful (issues with connectivity resulting in wrong values).

I've corrected the schema in those parts and also, for performance reasons, changed the main index to use lowercase @user_id@.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
2631
Estimation
1h
Spent time
4h 30m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#419
Please wait...
Page is in error, reload to recover