Page MenuHomePhabricator

D13271.diff
No OneTemporary

D13271.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
@@ -777,7 +777,9 @@
async function fetchNotifUserInfos(
serverThreadInfos: { +[threadID: string]: ServerThreadInfo },
- usersToCollapsableNotifInfo: { +[userID: string]: CollapsableNotifInfo[] },
+ usersToCollapsableNotifInfo: {
+ +[userID: string]: $ReadOnlyArray<CollapsableNotifInfo>,
+ },
) {
const missingUserIDs = new Set<string>();
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
@@ -94,7 +94,7 @@
};
export type FetchCollapsableNotifsResult = {
- [userID: string]: CollapsableNotifInfo[],
+ +[userID: string]: $ReadOnlyArray<CollapsableNotifInfo>,
};
function identityPlatformDetailsToPlatformDetails(
@@ -302,9 +302,11 @@
function pushInfoToCollapsableNotifInfo(pushInfo: PushInfo): {
+usersToCollapseKeysToInfo: {
- [string]: { [string]: CollapsableNotifInfo },
+ +[string]: { +[string]: CollapsableNotifInfo },
+ },
+ +usersToCollapsableNotifInfo: {
+ +[string]: $ReadOnlyArray<CollapsableNotifInfo>,
},
- +usersToCollapsableNotifInfo: { [string]: Array<CollapsableNotifInfo> },
} {
const usersToCollapseKeysToInfo: {
[string]: { [string]: CollapsableNotifInfo },
@@ -348,13 +350,23 @@
function mergeUserToCollapsableInfo(
usersToCollapseKeysToInfo: {
- [string]: { [string]: CollapsableNotifInfo },
+ +[string]: { +[string]: CollapsableNotifInfo },
+ },
+ usersToCollapsableNotifInfo: {
+ +[string]: $ReadOnlyArray<CollapsableNotifInfo>,
},
- usersToCollapsableNotifInfo: { [string]: Array<CollapsableNotifInfo> },
-): { [string]: Array<CollapsableNotifInfo> } {
- const mergedUsersToCollapsableInfo = { ...usersToCollapsableNotifInfo };
+): { +[string]: $ReadOnlyArray<CollapsableNotifInfo> } {
+ const mergedUsersToCollapsableInfo: {
+ [string]: Array<CollapsableNotifInfo>,
+ } = {};
+
for (const userID in usersToCollapseKeysToInfo) {
const collapseKeysToInfo = usersToCollapseKeysToInfo[userID];
+
+ mergedUsersToCollapsableInfo[userID] = [
+ ...usersToCollapsableNotifInfo[userID],
+ ];
+
for (const collapseKey in collapseKeysToInfo) {
const info = collapseKeysToInfo[collapseKey];
mergedUsersToCollapsableInfo[userID].push({

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 9:11 PM (21 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2689116
Default Alt Text
D13271.diff (2 KB)

Event Timeline