HomePhabricator
Diffusion Comm e2ac6ed1367a

[lib] Run the keyserver auth only when it isn't running and a user isn't…

Description

[lib] Run the keyserver auth only when it isn't running and a user isn't already authenticated

Summary:
Check if a user is logged in. Keep track of running auth and don't start it if it's already running.

Depends on D10830

Test Plan:
Add a sleep to the auth effect and some logs to its start and finish. Also make sure that store contains a keyserver to which we aren't authenticated.

  1. Check if the auth doesn't start for authenticated keyserver - ashoatKeyserverID
  2. Check if the auth starts for unauth keyserver
  3. Modify e.g. calendar query (a dependency of an effect) and check if it doesn't start a new auth before the previous is finished
  4. Modify it again after the timeout and check if auth restarts (if the previous failed)

Reviewers: varun, inka, kamil

Reviewed By: inka

Subscribers: marcin, ashoat

Differential Revision: https://phab.comm.dev/D10831

Details