From c90e399003b8eed9e5ac4c8b96eea699b4f17c6e Mon Sep 17 00:00:00 2001 From: Selase Krakani <849886+s3lase@users.noreply.github.com> Date: Thu, 20 Jul 2023 11:22:43 +0000 Subject: [PATCH] FIX: `user_id` arg override in Slack import (#22713) Fixes `user_id` arg override during mention parsing. --- script/import_scripts/slack.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/import_scripts/slack.rb b/script/import_scripts/slack.rb index dc6989f2b2b..f9559804988 100644 --- a/script/import_scripts/slack.rb +++ b/script/import_scripts/slack.rb @@ -252,9 +252,9 @@ class ImportScripts::Slack < ImportScripts::Base # Mentions text.gsub!(/<@(\w+)>/) do - user_id = $1 - username = @lookup.find_username_by_import_id(user_id) - username ? "@#{username}" : "`@#{user_id}`" + mentioned_user_id = $1 + username = @lookup.find_username_by_import_id(mentioned_user_id) + username ? "@#{username}" : "`@#{mentioned_user_id}`" end # Links