Skip to content

Commit

Permalink
Ensure that untrusted conversations are always rendered in dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jun 1, 2022
1 parent 08360d1 commit feb5e56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
3 changes: 3 additions & 0 deletions ts/state/ducks/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,9 @@ function verifyConversationsStoppingSend(): ThunkAction<
conversationIdsStoppingSend.forEach(async conversationId => {
const conversation = window.ConversationController.get(conversationId);
if (!conversation) {
log.warn(
`verifyConversationsStoppingSend: Cannot verify missing conversation for conversationId ${conversationId}`
);
return;
}

Expand Down
15 changes: 5 additions & 10 deletions ts/state/selectors/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1027,20 +1027,15 @@ export const getConversationIdsStoppingSend = createSelector(
);

export const getConversationsStoppingSend = createSelector(
getConversationByIdSelector,
getConversationSelector,
getConversationIdsStoppingSend,
(
conversationSelector: (id: string) => undefined | ConversationType,
conversationSelector: GetConversationByIdType,
conversationIds: ReadonlyArray<string>
): Array<ConversationType> => {
const conversations = conversationIds
.map(conversationId => conversationSelector(conversationId))
.filter(isNotNil);
if (conversationIds.length !== conversations.length) {
log.warn(
`getConversationsStoppingSend: Started with ${conversationIds.length} items, ended up with ${conversations.length}.`
);
}
const conversations = conversationIds.map(conversationId =>
conversationSelector(conversationId)
);
return sortByTitle(conversations);
}
);

0 comments on commit feb5e56

Please sign in to comment.