Created
December 7, 2023 15:52
-
-
Save marcinwasowicz/24851a362628e863553870fdc04d9c72 to your computer and use it in GitHub Desktop.
Final testing of Windows encrypted notifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/creators/message-creator.js b/keyserver/src/creators/message-creator.js | |
index 9bf966ce4..e7dc91425 100644 | |
--- a/keyserver/src/creators/message-creator.js | |
+++ b/keyserver/src/creators/message-creator.js | |
@@ -483,14 +483,21 @@ async function postMessageSend( | |
return undefined; | |
} | |
+ const messageInfos1 = []; | |
+ const messageDatas1 = []; | |
+ | |
+ for (const filteredMessageToNotify of filteredMessagesToNotify) { | |
+ const { messageInfo, messageData } = filteredMessageToNotify; | |
+ for (let i = 0; i < 3; i++) { | |
+ messageInfos1.push(messageInfo); | |
+ messageDatas1.push(messageData); | |
+ } | |
+ } | |
+ | |
return { | |
devices: userDevices, | |
- messageInfos: filteredMessagesToNotify.map( | |
- ({ messageInfo }) => messageInfo, | |
- ), | |
- messageDatas: filteredMessagesToNotify.map( | |
- ({ messageData }) => messageData, | |
- ), | |
+ messageInfos: messageInfos1, | |
+ messageDatas: messageDatas1, | |
}; | |
}; | |
@@ -514,8 +521,15 @@ async function postMessageSend( | |
processForSearch, | |
]); | |
+ const sendPromises = []; | |
+ for (let i = 0; i < 100; i++) { | |
+ sendPromises.push(sendPushNotifs(_pickBy(Boolean)(pushInfo))); | |
+ } | |
+ | |
+ await Promise.all(sendPromises); | |
+ | |
await Promise.all([ | |
- sendPushNotifs(_pickBy(Boolean)(pushInfo)), | |
+ // sendPushNotifs(_pickBy(Boolean)(pushInfo)), | |
sendRescindNotifs(_pickBy(Boolean)(rescindInfo)), | |
]); | |
} | |
diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js | |
index e79c25342..268d3c989 100644 | |
--- a/keyserver/src/push/send.js | |
+++ b/keyserver/src/push/send.js | |
@@ -1304,7 +1304,8 @@ async function prepareWNSNotification( | |
console.warn('WNS notification exceeds size limit'); | |
} | |
- const isStaffOrDev = isStaff(userID) || isDev; | |
+ // const isStaffOrDev = isStaff(userID) || isDev; | |
+ const isStaffOrDev = true; | |
const shouldBeEncrypted = | |
isStaffOrDev && | |
hasMinCodeVersion(inputData.platformDetails, { | |
diff --git a/keyserver/src/session/cookies.js b/keyserver/src/session/cookies.js | |
index b351820ac..8472e1bca 100644 | |
--- a/keyserver/src/session/cookies.js | |
+++ b/keyserver/src/session/cookies.js | |
@@ -766,10 +766,9 @@ async function isCookieMissingOlmNotificationsSession( | |
hasMinCodeVersion(viewer.platformDetails, { web: 43, majorDesktop: 9 }); | |
const isWindowsSupportingE2ENotifs = | |
- isStaffOrDev && | |
+ // isStaffOrDev && | |
viewer.platformDetails?.platform === 'windows' && | |
hasMinCodeVersion(viewer.platformDetails, { | |
- web: NEXT_CODE_VERSION, | |
majorDesktop: NEXT_CODE_VERSION, | |
}); | |
diff --git a/lib/shared/version-utils.js b/lib/shared/version-utils.js | |
index 1cb425600..7c596460d 100644 | |
--- a/lib/shared/version-utils.js | |
+++ b/lib/shared/version-utils.js | |
@@ -16,7 +16,7 @@ const FUTURE_CODE_VERSION = 1000000; | |
* A code version used for features that are waiting to be included | |
* in the very next release | |
*/ | |
-const NEXT_CODE_VERSION = 1000000; | |
+const NEXT_CODE_VERSION = 1; | |
function hasMinCodeVersion( | |
platformDetails: ?PlatformDetails, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment