Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3507547
D13271.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13271.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13271: Fix input types from D13050
Attached
Detach File
Event Timeline
Log In to Comment