Skip to content

Handle old usernames that are substrings of new usernames

Carla Drago requested to merge 413623-bug-fix-2 into master

What does this MR do and why?

This change addresses the bug whereby the gsub! method originally used replaced matching substrings with the new username resulting in incorrect new username display.

For example, with the following username mapping:

'bob' => 'alice-gdk',
'alice' => 'bob-gdk'

Any instances of @bob would be replaced with @alice-gdk but then the alice part of @alice-gdk would be replaced with bob-gdk resulting in @bob-gdk-gdk.

Fun times 😄

The change uses a regex to instead match exact strings, while accommodating punctuation.

Specs have been added.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #413623 (closed)

Merge request reports