I don't think this really happens in Chrome in practice, but this definitely happens in tests.
The issue is that the AccountReconcilor is supposed to sometimes revoke secondary tokens:
- If the user cleared their Google cookies
- in some cases if the main token is in error state
However the AccountReconcilor should never revoke the main token.
It happens in tests:
- reconcilor starts when there is no main account, AccountReconcilor::primary_account_ is empty. A call to ListAccounts is started.
- the test does a signin, but does not set any cookies
- ListAccounts returns, and sees that there is a token but no cookies. AccountReconcilor decides to clear the secondary tokens.
- since AccountReconcilor::primary_account_ is empty, the account reconcilor thinks the token is a secondary token and revokes it.
- the user is signed out
This is happening on the bots:
https://logs.chromium.org/v/?s=chromium%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8951346925631062368%2F%2B%2Fsteps%2Fsync_integration_tests__with_patch_%2F0%2Flogs%2FSingleClientBookmarksSyncTest.Sanity%2F0
Comment 1 by bugdroid1@chromium.org
, Mar 28 2018