Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3529714
D9870.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
895 B
Referenced Files
None
Subscribers
None
D9870.diff
View Options
diff --git a/keyserver/src/utils/olm-utils.js b/keyserver/src/utils/olm-utils.js
--- a/keyserver/src/utils/olm-utils.js
+++ b/keyserver/src/utils/olm-utils.js
@@ -47,7 +47,10 @@
const currentDate = new Date();
const lastPrekeyPublishDate = getLastPrekeyPublishTime(account);
- return currentDate - lastPrekeyPublishDate >= maxPublishedPrekeyAge;
+ return (
+ currentDate.getTime() - lastPrekeyPublishDate.getTime() >=
+ maxPublishedPrekeyAge
+ );
}
function shouldForgetPrekey(account: OlmAccount): boolean {
@@ -60,7 +63,9 @@
const currentDate = new Date();
const lastPrekeyPublishDate = getLastPrekeyPublishTime(account);
- return currentDate - lastPrekeyPublishDate >= maxOldPrekeyAge;
+ return (
+ currentDate.getTime() - lastPrekeyPublishDate.getTime() >= maxOldPrekeyAge
+ );
}
async function createPickledOlmAccount(): Promise<PickledOlmAccount> {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:50 PM (1 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2703142
Default Alt Text
D9870.diff (895 B)
Attached To
Mode
D9870: [Flow202][keyserver][skip-ci] [21/x] Make Date subtraction explicit
Attached
Detach File
Event Timeline
Log In to Comment