diff --git a/lib/push/send-utils.js b/lib/push/send-utils.js --- a/lib/push/send-utils.js +++ b/lib/push/send-utils.js @@ -1,5 +1,6 @@ // @flow +import invariant from 'invariant'; import _pickBy from 'lodash/fp/pickBy.js'; import uuidv4 from 'uuid/v4.js'; @@ -134,6 +135,12 @@ for (const threadID of threadsToMessageIndices.keys()) { const threadInfo = rawThreadInfos[threadID]; for (const memberInfo of threadInfo.members) { + // TODO: `getPushUserInfo` needs to be typed to + // only accept `ThickRawThreadInfo`. + invariant( + memberInfo && memberInfo.permissions, + 'memberInfo must be set in getPushUserInfo', + ); if ( !isMemberActive(memberInfo) || !hasPermission(memberInfo.permissions, 'visible') || diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -85,7 +85,6 @@ ThickMemberInfo, UserProfileThreadInfo, MixedRawThreadInfos, - LegacyMemberInfo, LegacyThinRawThreadInfo, } from '../types/thread-types.js'; import { updateTypes } from '../types/update-types-enum.js';