Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3509201
D7000.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
D7000.diff
View Options
diff --git a/keyserver/src/cron/compare-users.js b/keyserver/src/cron/compare-users.js
--- a/keyserver/src/cron/compare-users.js
+++ b/keyserver/src/cron/compare-users.js
@@ -2,7 +2,7 @@
import { getRustAPI } from 'rust-node-addon';
import { deleteCookies } from '../deleters/cookie-deleters.js';
-import { fetchNativeCookieIDsForUserIDs } from '../fetchers/cookie-fetchers.js';
+import { fetchCookieIDsToInvalidateToPopulateIdentityService } from '../fetchers/cookie-fetchers.js';
import { fetchAllUserIDs } from '../fetchers/user-fetchers.js';
async function compareMySQLUsersToIdentityService(): Promise<void> {
@@ -23,7 +23,7 @@
if (usersMissingFromIdentity.length === 0) {
return;
}
- const cookieIDs = await fetchNativeCookieIDsForUserIDs(
+ const cookieIDs = await fetchCookieIDsToInvalidateToPopulateIdentityService(
usersMissingFromIdentity,
);
if (cookieIDs.length === 0) {
diff --git a/keyserver/src/fetchers/cookie-fetchers.js b/keyserver/src/fetchers/cookie-fetchers.js
--- a/keyserver/src/fetchers/cookie-fetchers.js
+++ b/keyserver/src/fetchers/cookie-fetchers.js
@@ -1,7 +1,5 @@
// @flow
-import { deviceTypes } from 'lib/types/device-types.js';
-
import { dbQuery, SQL } from '../database/database.js';
// This function is used for invalidating native sessions so that we can trigger
@@ -10,16 +8,23 @@
// password on the keyserver to populate the identity service. We only
// invalidate native sessions because web sessions don't cache the user's
// password, and we don't want any user-visible issues to result from this.
-async function fetchNativeCookieIDsForUserIDs(
+async function fetchCookieIDsToInvalidateToPopulateIdentityService(
userIDs: $ReadOnlyArray<string>,
): Promise<string[]> {
+ // Native clients before codeVersion 193 don't provide the info necessary to
+ // call the identity service, so there's no point to invalidating their
+ // sessions. On Android, builds 193/194 have a bug that breaks log-in, so we
+ // don't want to invalidate their sessions.
const query = SQL`
SELECT id
FROM cookies
- WHERE platform IN (${deviceTypes}) AND user IN (${userIDs})
+ WHERE user IN (${userIDs}) AND (
+ (platform = 'ios' AND JSON_EXTRACT(versions, '$.codeVersion') > 192) OR
+ (platform = 'android' AND JSON_EXTRACT(versions, '$.codeVersion') > 194)
+ )
`;
const [result] = await dbQuery(query);
return result.map(({ id }) => id.toString());
}
-export { fetchNativeCookieIDsForUserIDs };
+export { fetchCookieIDsToInvalidateToPopulateIdentityService };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 2:20 AM (20 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690208
Default Alt Text
D7000.diff (2 KB)
Attached To
Mode
D7000: [keyserver] Don't invalidate cookies for identity DDB population if codeVersion doesn't provide necessary info
Attached
Detach File
Event Timeline
Log In to Comment