mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +00:00
rocketchat: Ignore reactions from non-existant users.
Not sure where those come from since we discovered this with production data. Somehow there were reactions with usernames that were old and no longer existed. Signed-off-by: Florian Pritz <bluewind@xinu.at>
This commit is contained in:
committed by
Tim Abbott
parent
26fe028534
commit
1cc2764d45
@@ -634,6 +634,11 @@ def process_messages(
|
|||||||
usernames = reactions[react_code]["usernames"]
|
usernames = reactions[react_code]["usernames"]
|
||||||
|
|
||||||
for username in usernames:
|
for username in usernames:
|
||||||
|
if username not in username_to_user_id_map: # nocoverage
|
||||||
|
# This can happen with production data when old user names no longer exist. We cannot do
|
||||||
|
# much about it here so we just ignore the unknown user name.
|
||||||
|
continue
|
||||||
|
|
||||||
rc_user_id = username_to_user_id_map[username]
|
rc_user_id = username_to_user_id_map[username]
|
||||||
user_id = user_id_mapper.get(rc_user_id)
|
user_id = user_id_mapper.get(rc_user_id)
|
||||||
reactions_list.append({"name": name, "user_id": user_id})
|
reactions_list.append({"name": name, "user_id": user_id})
|
||||||
|
|||||||
Reference in New Issue
Block a user