Page MenuHomePhabricator

D6936.id23380.diff
No OneTemporary

D6936.id23380.diff

diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js
--- a/keyserver/src/push/send.js
+++ b/keyserver/src/push/send.js
@@ -166,6 +166,9 @@
notifTargetUserInfo,
getENSNames,
);
+ if (!notifTexts) {
+ continue;
+ }
const dbID = dbIDs.shift();
invariant(dbID, 'should have sufficient DB IDs');
diff --git a/lib/shared/messages/message-spec.js b/lib/shared/messages/message-spec.js
--- a/lib/shared/messages/message-spec.js
+++ b/lib/shared/messages/message-spec.js
@@ -47,7 +47,7 @@
+notificationTexts: (
messageInfos: $ReadOnlyArray<MessageInfo>,
threadInfo: ThreadInfo,
- ) => Promise<NotifTexts>,
+ ) => Promise<?NotifTexts>,
+notifTargetUserInfo: UserInfo,
};
@@ -99,7 +99,7 @@
messageInfos: $ReadOnlyArray<MessageInfo>,
threadInfo: ThreadInfo,
params: NotificationTextsParams,
- ) => Promise<NotifTexts>,
+ ) => Promise<?NotifTexts>,
+notificationCollapseKey?: (
rawMessageInfo: RawInfo,
messageData: Data,
diff --git a/lib/shared/notif-utils.js b/lib/shared/notif-utils.js
--- a/lib/shared/notif-utils.js
+++ b/lib/shared/notif-utils.js
@@ -32,13 +32,16 @@
threadInfo: ThreadInfo,
notifTargetUserInfo: UserInfo,
getENSNames: ?GetENSNames,
-): Promise<ResolvedNotifTexts> {
+): Promise<?ResolvedNotifTexts> {
const fullNotifTexts = await fullNotifTextsForMessageInfo(
messageInfos,
threadInfo,
notifTargetUserInfo,
getENSNames,
);
+ if (!fullNotifTexts) {
+ return fullNotifTexts;
+ }
const merged = trimText(fullNotifTexts.merged, 300);
const body = trimText(fullNotifTexts.body, 300);
const title = trimText(fullNotifTexts.title, 100);
@@ -147,7 +150,7 @@
threadInfo: ThreadInfo,
notifTargetUserInfo: UserInfo,
getENSNames: ?GetENSNames,
-): Promise<ResolvedNotifTexts> {
+): Promise<?ResolvedNotifTexts> {
const mostRecentType = mostRecentMessageInfoType(messageInfos);
const messageSpec = messageSpecs[mostRecentType];
invariant(
@@ -169,6 +172,9 @@
threadInfo,
{ notifTargetUserInfo, notificationTexts: innerNotificationTexts },
);
+ if (!unresolvedNotifTexts) {
+ return unresolvedNotifTexts;
+ }
const resolveToString = async (
entityText: string | EntityText,

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 28, 8:52 PM (2 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2192206
Default Alt Text
D6936.id23380.diff (2 KB)

Event Timeline