mirror of https://github.com/zulip/zulip.git
hipchat import: Fix bug w/rogue UserMessage records.
This bug was introduced very recently and is an aliasing bug. It caused extra UserMessage rows to be created as we inadvertently updated the underlying subscriber_map sets for multiple messages. This probably mostly affected PMs. It's doubtful the bug ever got out into the field.
This commit is contained in:
parent
9b0265452f
commit
fe6df1c222
|
@ -626,8 +626,8 @@ def make_user_messages(zerver_message: List[ZerverFieldsT],
|
||||||
recipient_id = message['recipient']
|
recipient_id = message['recipient']
|
||||||
sender_id = message['sender']
|
sender_id = message['sender']
|
||||||
mention_user_ids = mention_map[message_id]
|
mention_user_ids = mention_map[message_id]
|
||||||
user_ids = subscriber_map.get(recipient_id, set())
|
subscriber_ids = subscriber_map.get(recipient_id, set())
|
||||||
user_ids.add(sender_id)
|
user_ids = subscriber_ids | {sender_id}
|
||||||
|
|
||||||
for user_id in user_ids:
|
for user_id in user_ids:
|
||||||
is_mentioned = user_id in mention_user_ids
|
is_mentioned = user_id in mention_user_ids
|
||||||
|
|
Loading…
Reference in New Issue