Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3333718
D10151.id34180.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
D10151.id34180.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 5:01 AM (14 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2560024
Default Alt Text
D10151.id34180.diff (2 KB)
Attached To
Mode
D10151: Read desktop code version during socket connection creation
Attached
Detach File
Event Timeline
Log In to Comment