New issue
Advanced search Search tips

Issue 749535 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 740117
issue 769621
issue 900590



Sign in to add a comment

Have SigninManagerBase internally guarantee that PO2TS::LoadCredentials() is always called

Project Member Reported by blundell@chromium.org, Jul 27 2017

Issue description

We had thought there was an invariant that PO2TS::OnRefreshTokensLoaded() was fired at startup on all platforms. However, it turns out that it's not fired in all cases on ChromeOS:

Instead, it's called only when the user explicitly signs in.
  - Invoked from here (trace the flow a bit up and down to see the complete flow): 
    https://cs.chromium.org/chromium/src/chrome/browser/chromeos/login/session/user_session_manager.cc?type=cs&l=1458

If the user is in consumer mode but not signed in (e.g., in guest mode), then the flow short-circuits out here: 
    https://cs.chromium.org/chromium/src/chrome/browser/chromeos/login/session/user_session_manager.cc?type=cs&l=556 

If the user is in managed mode, then the flow short-circuits out here:
    https://cs.chromium.org/chromium/src/chrome/browser/chromeos/login/session/user_session_manager.cc?type=cs&l=1139 (i.e., that conditional is not entered)

Either we should change these cases to fire PO2TS::OnRefreshTokensLoaded(), or I need to figure out another approach to the bug that is being blocked on this bug.
 
Cc: achuith@chromium.org
Note: The CL here: https://codereview.chromium.org/1523743003 seems to indicate that the intent was for PO2TS::OnRefreshTokensLoaded() to always be fired on ChromeOS, and thus that the above circumstances are a bug to be fixed. achuith@, does that seem right to you?
Blocking: 769621
Cc: xiy...@chromium.org
I am planning to have SigninManagerBase::Initialize() invoke PO2TS::LoadCredentials(), as SigninManager::Initialize() currently does. Complicating factor is that SigninManager::Initialize() invokes SigninManagerBase::Initialize() at the *beginning* of its flow and PO2TS::LoadCredentials() at the *end* of its flow, with state that can impact the latter invocation happening in between. Here is my complete plan:
- Have SigninManagerBase take in PO2TS
- Add SigninManagerBase::FinalizeInit(), which is meant to be called at the end of initialization of SigninManagerBase *as well as any subclass of it.*
- On CrOS, have SigninManagerBase::Initialize() call SigninManagerBase::FinalizeInit() directly as the last thing it does.
- On other platforms, have SigninManager::Initialize() call SigninManagerBase::FinalizeInit() as the last thing it does.
- Have SigninManagerBase::FinalizeInit() call PO2TS::LoadCredentials().

achuith@/xiyuan@, could you point me to the right reviewer for this change from the CrOS POV? knn@, who wrote the CL referenced in c#1, appears to no longer be working on Chrome. Thanks!
Labels: -Pri-3 OS-Chrome Pri-2
Xiyuan and I can review your CL.

Please test your Cl locally using a chromeos VM:
https://chromium.googlesource.com/chromiumos/docs/+/master/cros_vm.md
Thanks! Will let you know if I have any problems following the VM instructions.
Components: Services>SignIn
Blocking: 900590
Hi Kushagra! I would like to make this fix, but it's not a short-term priority as it's not blocking the conversion of the codebase to IdentityManager, which is our current focus. The easiest short-term fix would likely be to ensure that LoadCredentials() is called in the flow that you're going through in  crbug.com/900590 .
Owner: jochen@chromium.org
Hi Jochen,

We had talked about you potentially taking on ChromeOS-related corner cases that are tricky but not on the near-term critical path for IdentityManager. This is the biggest one. c#3 indicates the approach that I was planning on, with one step elided: When we move the call into PO2TS::LoadCredentials() into SigninManagerBase::FinalizeInit(), we should also remove all its explicit ChromeOS-specific callsites.

Is this something that could interest you? I would guess that getting it to stick might be bumpy, i.e., we might well uncover some really nice corner case after it lands and starts to roll out. All the more reason to start developing it well before it gets on any critical path :).
Summary: Have SigninManagerBase internally guarantee that PO2TS::LoadCredentials() is always called (was: Determine what to do wrt ProfileOAuth2TokenService::OnRefreshTokensLoaded() not being fired in all circumstances on ChromeOS)
 Issue 769621  has been merged into this issue.
Project Member

Comment 13 by bugdroid1@chromium.org, Dec 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b6cbd537b9a6de76d626f1d4e1956ef2eef0b65

commit 9b6cbd537b9a6de76d626f1d4e1956ef2eef0b65
Author: Kush Sinha <sinhak@chromium.org>
Date: Wed Dec 05 21:33:54 2018

Remove load credentials DCHECK from ChromeOSOAuth2TokenServiceDelegate

This DCHECK is impossible to guarantee right now. Please check the
attached bugs for context.

This has feature parity with the current token service delegate on
Chrome OS, which does not check this either : https://goo.gl/scLHhc

Bug:  900590 
Bug:  749535 
Change-Id: I02dd4ef9403f2f78863218ce2aacb647754e3854
Reviewed-on: https://chromium-review.googlesource.com/c/1363200
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614106}
[modify] https://crrev.com/9b6cbd537b9a6de76d626f1d4e1956ef2eef0b65/chrome/browser/chromeos/oauth2_token_service_delegate.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Dec 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bdf260ef72ba767a32b772aa34cac082381b2ec6

commit bdf260ef72ba767a32b772aa34cac082381b2ec6
Author: Jochen Eisinger <jochen@chromium.org>
Date: Wed Dec 19 18:55:20 2018

Have SigninManagerBase::Initialize guarantee to load refresh tokens

This will guarantee that we always fire OnRefreshTokensLoaded during profile
startup.

Previously, on Chrome OS, this wasn't always the case, e.g., for guest mode, or
managed users, this was not invoked.

BUG= 749535 ,740117,915628
R=blundell@chromium.org

Change-Id: Ibecad59e6eb40db85a2090af4d59940c3d79b54b
Reviewed-on: https://chromium-review.googlesource.com/c/1374985
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617896}
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/chromeos/arc/auth/arc_auth_service_browsertest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/chromeos/authpolicy/auth_policy_credentials_manager.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/download/notification/download_notification_interactive_uitest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/signin/fake_signin_manager_builder.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/browser/signin/signin_manager_factory.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/chrome/test/base/chrome_render_view_host_test_harness.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/search_provider_logos/logo_service_impl_unittest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/account_reconcilor_unittest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/fake_signin_manager.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/fake_signin_manager.h
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/signin_manager.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/signin_manager.h
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/signin_manager_base.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/signin_manager_base.h
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/components/signin/core/browser/signin_tracker_unittest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/identity_manager_impl_unittest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/public/cpp/accounts_mutator.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/public/cpp/accounts_mutator.h
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/public/cpp/accounts_mutator_unittest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/public/cpp/identity_manager.h
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/public/cpp/identity_manager_unittest.cc
[modify] https://crrev.com/bdf260ef72ba767a32b772aa34cac082381b2ec6/services/identity/public/cpp/identity_test_environment.cc

Status: Fixed (was: Assigned)
marking as fixed assuming it sticks
Project Member

Comment 16 by bugdroid1@chromium.org, Dec 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/11a9a05dbff5010b373489ed176d0992841c53eb

commit 11a9a05dbff5010b373489ed176d0992841c53eb
Author: CJ DiMeglio <lethalantidote@chromium.org>
Date: Wed Dec 19 21:24:43 2018

Revert "Have SigninManagerBase::Initialize guarantee to load refresh tokens"

This reverts commit bdf260ef72ba767a32b772aa34cac082381b2ec6.

Reason for revert: SigninInteractionControllerTestCase fails on chromium.mac/ios-slimnav (see  https://crbug.com/916731  )

Original change's description:
> Have SigninManagerBase::Initialize guarantee to load refresh tokens
> 
> This will guarantee that we always fire OnRefreshTokensLoaded during profile
> startup.
> 
> Previously, on Chrome OS, this wasn't always the case, e.g., for guest mode, or
> managed users, this was not invoked.
> 
> BUG= 749535 ,740117,915628
> R=​blundell@chromium.org
> 
> Change-Id: Ibecad59e6eb40db85a2090af4d59940c3d79b54b
> Reviewed-on: https://chromium-review.googlesource.com/c/1374985
> Commit-Queue: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
> Reviewed-by: Colin Blundell <blundell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#617896}

TBR=blundell@chromium.org,msarda@chromium.org,jochen@chromium.org

Change-Id: I32e10a4181cafd97b2f53f17e755b870ecdfc302
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  749535 , 740117, 915628
Reviewed-on: https://chromium-review.googlesource.com/c/1384640
Reviewed-by: CJ DiMeglio <lethalantidote@chromium.org>
Commit-Queue: CJ DiMeglio <lethalantidote@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617951}
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/chromeos/arc/auth/arc_auth_service_browsertest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/chromeos/authpolicy/auth_policy_credentials_manager.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/download/notification/download_notification_interactive_uitest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/signin/fake_signin_manager_builder.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/browser/signin/signin_manager_factory.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/chrome/test/base/chrome_render_view_host_test_harness.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/account_reconcilor_unittest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/fake_signin_manager.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/fake_signin_manager.h
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/signin_manager.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/signin_manager.h
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/signin_manager_base.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/signin_manager_base.h
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/components/signin/core/browser/signin_tracker_unittest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/identity_manager_impl_unittest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/public/cpp/accounts_mutator.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/public/cpp/accounts_mutator.h
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/public/cpp/accounts_mutator_unittest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/public/cpp/identity_manager.h
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/public/cpp/identity_manager_unittest.cc
[modify] https://crrev.com/11a9a05dbff5010b373489ed176d0992841c53eb/services/identity/public/cpp/identity_test_environment.cc

Status: Started (was: Fixed)
Project Member

Comment 18 by bugdroid1@chromium.org, Dec 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/19ee90e7fcaf8c82d346506e71133b7071df1ef6

commit 19ee90e7fcaf8c82d346506e71133b7071df1ef6
Author: Jochen Eisinger <jochen@chromium.org>
Date: Thu Dec 20 14:22:46 2018

Reland "Have SigninManagerBase::Initialize guarantee to load refresh tokens"

This reverts commit 11a9a05dbff5010b373489ed176d0992841c53eb.

Reason for revert: Unclear how the test failure should be related to this CL

Original change's description:
> Revert "Have SigninManagerBase::Initialize guarantee to load refresh tokens"
> 
> This reverts commit bdf260ef72ba767a32b772aa34cac082381b2ec6.
> 
> Reason for revert: SigninInteractionControllerTestCase fails on chromium.mac/ios-slimnav (see  https://crbug.com/916731  )
> 
> Original change's description:
> > Have SigninManagerBase::Initialize guarantee to load refresh tokens
> > 
> > This will guarantee that we always fire OnRefreshTokensLoaded during profile
> > startup.
> > 
> > Previously, on Chrome OS, this wasn't always the case, e.g., for guest mode, or
> > managed users, this was not invoked.
> > 
> > BUG= 749535 ,740117,915628
> > R=​blundell@chromium.org
> > 
> > Change-Id: Ibecad59e6eb40db85a2090af4d59940c3d79b54b
> > Reviewed-on: https://chromium-review.googlesource.com/c/1374985
> > Commit-Queue: Jochen Eisinger <jochen@chromium.org>
> > Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
> > Reviewed-by: Colin Blundell <blundell@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#617896}
> 
> TBR=blundell@chromium.org,msarda@chromium.org,jochen@chromium.org
> 
> Change-Id: I32e10a4181cafd97b2f53f17e755b870ecdfc302
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug:  749535 , 740117, 915628
> Reviewed-on: https://chromium-review.googlesource.com/c/1384640
> Reviewed-by: CJ DiMeglio <lethalantidote@chromium.org>
> Commit-Queue: CJ DiMeglio <lethalantidote@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#617951}

TBR=blundell@chromium.org,msarda@chromium.org,jochen@chromium.org,lethalantidote@chromium.org

Change-Id: Ie84f18559a192f516d11960d2c3047291d3687e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  749535 , 740117, 915628
Reviewed-on: https://chromium-review.googlesource.com/c/1386427
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618205}
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/chromeos/arc/auth/arc_auth_service_browsertest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/chromeos/authpolicy/auth_policy_credentials_manager.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/chromeos/login/session/user_session_manager.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/download/notification/download_notification_interactive_uitest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/signin/fake_signin_manager_builder.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/browser/signin/signin_manager_factory.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/chrome/test/base/chrome_render_view_host_test_harness.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/account_reconcilor_unittest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/fake_signin_manager.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/fake_signin_manager.h
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/signin_manager.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/signin_manager.h
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/signin_manager_base.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/signin_manager_base.h
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/components/signin/core/browser/signin_tracker_unittest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/identity_manager_impl_unittest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/public/cpp/accounts_mutator.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/public/cpp/accounts_mutator.h
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/public/cpp/accounts_mutator_unittest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/public/cpp/identity_manager.h
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/public/cpp/identity_manager_unittest.cc
[modify] https://crrev.com/19ee90e7fcaf8c82d346506e71133b7071df1ef6/services/identity/public/cpp/identity_test_environment.cc

Status: Fixed (was: Started)

Sign in to add a comment