[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.
- Check if the auth doesn't start for authenticated keyserver - ashoatKeyserverID
- Check if the auth starts for unauth keyserver
- 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
- 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