open-build-service icon indicating copy to clipboard operation
open-build-service copied to clipboard

Impossible to reference users with "+" in their username

Open kraptor opened this issue 1 year ago • 3 comments

Issue Description

If a user has the symbol "+", when being referenced by @, then the link is incorrect. Example:

image

It's impossible to reference user "anag+factory", and the link is created only for @anag. This is a parsing error.

Expected Result

A link to the proper user is created (and hopefully, a email notifications are sent to that user, too).

How to Reproduce

  1. Go to any comment field.
  2. Try to create a reference to "anag+factory".
  3. Save the comment.
  4. The link is created to user "anag" instead.

Example: https://build.opensuse.org/request/show/1145598#comment-1887503

Further Information

  • A link to an OBS instance showing the issue: https://build.opensuse.org/request/show/1145598#comment-1887503

kraptor avatar Feb 10 '24 19:02 kraptor

FWIW I'm happy as workaround to rename my user to anag_factory or ana_factory ;)

ana avatar Feb 14 '24 19:02 ana

FWIW I'm happy as workaround to rename my user to anag_factory or ana_factory ;)

That's hardly a solution, instead the code for generating those links is right here, it just needs to be updated with better regex https://github.com/openSUSE/open-build-service/blob/master/src%2Fapi%2Flib%2Fobsapi%2Fmarkdown_renderer.rb#L16

hellcp-work avatar Feb 14 '24 21:02 hellcp-work

FWIW I'm happy as workaround to rename my user to anag_factory or ana_factory ;)

That's hardly a solution, instead the code for generating those links is right here, it just needs to be updated with better regex https://github.com/openSUSE/open-build-service/blob/master/src%2Fapi%2Flib%2Fobsapi%2Fmarkdown_renderer.rb#L16

I guess the emoticon wasn't marking enough this was a joke. But in any case, I'm not sure the plus sign are common in the usernames and the fact I ended up with a '+' is because IDP doesn't allow to rename users and other many things.

ana avatar Feb 15 '24 20:02 ana