Page MenuHomePhabricator

D10151.id34187.diff
No OneTemporary

D10151.id34187.diff

diff --git a/keyserver/src/creators/message-creator.js b/keyserver/src/creators/message-creator.js
--- a/keyserver/src/creators/message-creator.js
+++ b/keyserver/src/creators/message-creator.js
@@ -385,7 +385,7 @@
cookieID: cookieID.toString(),
codeVersion: versions ? versions.codeVersion : null,
stateVersion: versions ? versions.stateVersion : null,
- majorDesktopVersion: versions ? versions.desktopCodeVersion : null,
+ majorDesktopVersion: versions ? versions.majorDesktopVersion : null,
});
}
thisUserInfo.threadIDs.add(threadID);
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
@@ -811,7 +811,7 @@
+stateVersion: number,
+majorDesktopVersion?: number,
};
-const versionKeyRegex: RegExp = new RegExp(/^-?\d+\|-?\d+$/);
+const versionKeyRegex: RegExp = new RegExp(/^-?\d+\|-?\d+(\|-?\d+)?$/);
function versionKeyToString(versionKey: VersionKey): string {
const baseStringVersionKey = `${versionKey.codeVersion}|${versionKey.stateVersion}`;
if (!versionKey.majorDesktopVersion) {
diff --git a/keyserver/src/session/cookies.js b/keyserver/src/session/cookies.js
--- a/keyserver/src/session/cookies.js
+++ b/keyserver/src/session/cookies.js
@@ -109,9 +109,10 @@
}
const cookieRow = result[0];
- let platformDetails = null;
+ let platformDetails;
+ let versions = null;
if (cookieRow.versions) {
- const versions = JSON.parse(cookieRow.versions);
+ versions = JSON.parse(cookieRow.versions);
platformDetails = {
platform: cookieRow.platform,
codeVersion: versions.codeVersion,
@@ -120,6 +121,14 @@
} else {
platformDetails = { platform: cookieRow.platform };
}
+
+ if (versions && versions.majorDesktopVersion) {
+ platformDetails = {
+ ...platformDetails,
+ majorDesktopVersion: versions.majorDesktopVersion,
+ };
+ }
+
const deviceToken = cookieRow.device_token;
const cookieHash = cookieRow.hash;
@@ -195,8 +204,9 @@
const cookieRow = result[0];
let platformDetails = null;
+ let versions = null;
if (cookieRow.platform && cookieRow.versions) {
- const versions = JSON.parse(cookieRow.versions);
+ versions = JSON.parse(cookieRow.versions);
platformDetails = {
platform: cookieRow.platform,
codeVersion: versions.codeVersion,
@@ -205,6 +215,14 @@
} else if (cookieRow.platform) {
platformDetails = { platform: cookieRow.platform };
}
+
+ if (platformDetails && versions && versions.majorDesktopVersion) {
+ platformDetails = {
+ ...platformDetails,
+ majorDesktopVersion: versions.majorDesktopVersion,
+ };
+ }
+
const deviceToken = cookieRow.device_token;
const cookieHash = cookieRow.hash;

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 5:01 AM (13 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2560024
Default Alt Text
D10151.id34187.diff (2 KB)

Event Timeline