buddy_data: Check conversation_participants against legacy data.

We expect to remove this check once we've confirmed the logic is
correct.
This commit is contained in:
Aman Agrawal
2024-12-13 11:51:31 +05:30
committed by Tim Abbott
parent 63584f3076
commit 3e93bec936
2 changed files with 20 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
import _ from "lodash";
import assert from "minimalistic-assert";
import * as blueslip from "./blueslip.ts";
import {ConversationParticipants} from "./conversation_participants.ts";
import * as hash_util from "./hash_util.ts";
import {$t} from "./i18n.ts";
import * as message_lists from "./message_lists.ts";
@@ -464,6 +467,15 @@ export function get_conversation_participants(): Set<number> {
participant_ids_set.add(message.sender_id);
}
}
const conversation_participants = new ConversationParticipants(
message_lists.current.all_messages(),
).visible();
if (!_.isEqual(participant_ids_set, conversation_participants)) {
blueslip.error("Participants calculations disagree", {
participant_ids_set,
conversation_participants,
});
}
return participant_ids_set;
}