Page MenuHomePhabricator

[keyserver] update compare-user.js to get missing users by querying identity service
ClosedPublic

Authored by varun on Mar 7 2023, 10:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 1:08 AM
Unknown Object (File)
Thu, Dec 12, 10:45 PM
Unknown Object (File)
Wed, Dec 4, 6:49 AM
Unknown Object (File)
Wed, Dec 4, 6:49 AM
Unknown Object (File)
Wed, Dec 4, 6:48 AM
Unknown Object (File)
Wed, Dec 4, 6:48 AM
Unknown Object (File)
Wed, Dec 4, 6:28 AM
Unknown Object (File)
Nov 8 2024, 1:46 AM
Subscribers

Details

Summary

We get two lists of users, those in identity but not keyserver and vice versa. We log the users missing from keyserver (this probably means a delete call to identity failed). We delete all ios/android cookies for the users missing from identity to trigger a new login request on these users' devices (in the background).

This triggered request will then populate the identity service with the relevant user data.

Test Plan
  1. while disconnected from the identity service, i registered a new user on ios simulator
  2. logged in as this user on web
  3. spun up identity service, and when cronjob ran, my new user was added to the test ddb table
  4. my web cookie remained in mariadb the whole time, and i was never logged out on either client
  5. added a user to ddb manually, and it was logged by keyserver as missing, as expected

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

remove "// eslint-disable-next-line no-unused-vars"

Please address comments before landing

keyserver/src/cron/compare-users.js
9–10 ↗(On Diff #23517)

There is zero reason to wait for fetchAllUserIDs before calling getRustAPI. Try this

30 ↗(On Diff #23517)

Can you add a comment here explaining why we're doing this? Eg. explaining that it will trigger auto-log-in and we'll be able to access the password that way. And explaining why we only do it for native

This revision is now accepted and ready to land.Mar 7 2023, 10:55 AM