Defect #32382

Unreliable User mention feature with PostgreSQL

Added by Kenta Kogumasaka 3 months ago. Updated 2 months ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:-
Resolution: Affected version:3.4.11

Description

Our Redmine system has been migrated to the new instance with PostgreSQL / Ubuntu 18, but we now observe that the User mention feature is unreliable.
The symptom is that accounts consisted of lowercase characters only can be found and mentioned, but ones with uppercase characters only / the combination of uppercase and lowercase cannot be mentioned. Both cases were fine with MySQL before migration.

Environment:
  Redmine version                3.4.11.stable
  Ruby version                   2.4.6-p354 (2019-04-01) [x86_64-linux]
  Rails version                  4.2.11.1
  Environment                    production
  Database adapter               PostgreSQL

Thank you for your help!


Related issues

Related to Redmine - Defect #26892: Link to user in wiki syntax only works when login is writ... Closed

History

#1 Updated by Go MAEDA 3 months ago

The current version of Redmine does not have a mentioning feature. Are you talking about a plugin that provides the feature?

#2 Updated by Kenta Kogumasaka 3 months ago

Hello Maeda San!

I don't think we've installed any plugin such as https://www.redmine.org/plugins/redmine-mentions. I found #4179#note-41 and #13919#note-37 that you have already been in a loop, and both patches look already implemented for master.
(See https://github.com/redmine/redmine/blob/master/app/helpers/application_helper.rb#L1134)

That's why I thought the feature has been already in production. What do you think?

#3 Updated by Go MAEDA 3 months ago

Kenta Kogumasaka wrote:

I don't think we've installed any plugin such as https://www.redmine.org/plugins/redmine-mentions. I found #4179#note-41 and #13919#note-37 that you have already been in a loop, and both patches look already implemented for master.
(See https://github.com/redmine/redmine/blob/master/app/helpers/application_helper.rb#L1134)

Thank you for the detailed information. I understood. My understanding is that "mention" means the link to user feature (#4179) and you cannot make a link to a user if you use uppercase characters. Is it correct?

#4 Updated by Kenta Kogumasaka 3 months ago

Yes, it's more or less correct. Strictly speaking, we cannot make a link to a user account that has uppercase character(s). Here is some examples:

Full name Redmine Account
(case-sensitive)
Try Result
Yamada, Taro tyamada
(all are lowercases)
@tyamada Linked
@TYamada NG
@TYAMADA
Yamada, Hanako HYamada
(H and Y are uppercases)
@HYamada NG
@hyamada
@HYAMADA
John Smith JSMITH
(all are uppercases)
@jsmith NG
@JSMITH
@JSMith

The accounts that consist of lowercases only can be linked if using @<username> with lowercases.
Thousands of accounts in our Redmine have been imported with LDAP Sync, and I don't feel it would be practical to replace all uppercases to lowercases in the "users" table.

#5 Updated by Holger Just 3 months ago

Instead of User.visible.where(:login => name, :type => 'User').first, we should probably use User.visible.find_by_login(name) to find the user in ApplictionHelper#parse_redmine_links. Here, we already perform a fallback to a case-insensitive match if necessary.

Let me check if that does it...

#6 Updated by Kenta Kogumasaka 2 months ago

Danke schön, Holger!

#7 Updated by Mischa The Evil 2 months ago

  • Related to Defect #26892: Link to user in wiki syntax only works when login is written in lower case added

#8 Updated by Marius BALTEANU 2 months ago

  • Status changed from New to Needs feedback

@Kenta Kogumasaka, this problem was fixed in Redmine 4.0, please see #26892 for more details.

Not being a very big change, maybe you can apply the fix on your instance.

Also available in: Atom PDF