New issue
Advanced search Search tips

Issue 908412 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 30
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocked on:
issue 908410

Blocking:
issue 883318



Sign in to add a comment

Remove |is_valid| param from IdentityManager::Observer::OnRefreshTokenUpdatedForAccount()

Project Member Reported by blundell@chromium.org, Nov 26

Issue description

It is confusing for people in practice: many people want to check is_valid in cases where they shouldn't. I introduced it to avoid adding the ability to query the persistent error state to the IdentityManager API (for Sync's use case of detecting the refresh token being set to the invalid token). However, avoiding adding that API is no longer a priority. Let's get rid of this parameter altogether, replacing the one legitimate use case with querying GetPersistentErrorStateOfRefreshTokenForAccount(). 
 
Owner: blundell@chromium.org
Status: Assigned (was: Available)
Taking this one to do some pair-programming with Lowell.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 29

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

commit 32a34bfffe6313f31c0d8b601a8f3fcf771dc9bf
Author: Colin Blundell <blundell@chromium.org>
Date: Thu Nov 29 09:53:49 2018

Change SyncAuthManager to explicitly check error state of refresh token

When SyncAuthManager receives an OnRefreshTokenUpdatedForAccount()
observer callback from IdentityManager, it queries the value of the
|is_valid| parameter. However, we are going to be removing that
parameter altogether as it is confusing for the common case where
consumers *shouldn't* check it.

This CL changes SyncAuthManager to compute the validity internally by
querying the error state of the refresh token via IdentityManager.
There should be no functional change.

The logic of the computation of whether the refresh token is valid is
taken from the internal computation of the |is_valid| parameter that
IdentityManager does. As a followup, we can consider re-hiding that
logic inside IdentityManager via a helper method to reduce fragility.

Bug:  908412 
Change-Id: I4842652dc63bea7169e4e915b5f4382e9291a0ea
Reviewed-on: https://chromium-review.googlesource.com/c/1350888
Commit-Queue: Marc Treib <treib@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612120}
[modify] https://crrev.com/32a34bfffe6313f31c0d8b601a8f3fcf771dc9bf/components/browser_sync/sync_auth_manager.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 30

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

commit 18f3980bcca17bddab76104b2aa00e3bd5329c4c
Author: Colin Blundell <blundell@chromium.org>
Date: Fri Nov 30 10:45:57 2018

Remove unnecessary check of token validity from dice_browsertest.cc

dice_browsertest.cc checks the |is_valid| param in its implementation of
IdentityManager::Observer::OnRefreshTokenUpdatedForAccount(). This param
is slated for removal (see bug), so we need to change this. Happily,
(or unhappily), the tests do not depend on this check; it can just be
removed.

Bug:  908412 
Change-Id: Id59c9370bf8258d077de689ee5ba55fd67d89f2e
Reviewed-on: https://chromium-review.googlesource.com/c/1353893
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612611}
[modify] https://crrev.com/18f3980bcca17bddab76104b2aa00e3bd5329c4c/chrome/browser/signin/dice_browsertest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 30

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

commit bc1d0fc31510d914bb085f7c8248991b2669509c
Author: Colin Blundell <blundell@chromium.org>
Date: Fri Nov 30 14:56:20 2018

IdentityManager: Remove is_valid from OnRefreshTokenUpdatedForAccount

|is_valid| is confusing for people in practice: many people want to
check is_valid in cases where they shouldn't. I introduced it to avoid
adding the ability to query the persistent error state to the
IdentityManager API (for Sync's use case of detecting the refresh token
being set to the invalid token). However, avoiding adding that API is no
longer a priority.

This CL gets rid of this parameter altogether; after precedent CLs, it
is not used by any consumer, so this is just stripping out the param.

TBR=sdefresne@chromium.org

Bug:  908412 
Change-Id: Idfa954b8d827312c88f2a93dab0e76a87e9ba147
Reviewed-on: https://chromium-review.googlesource.com/c/1350986
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612650}
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/chromeos/arc/auth/arc_auth_context.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/chromeos/arc/auth/arc_auth_context.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/chromeos/arc/policy/arc_android_management_checker.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/chromeos/arc/policy/arc_android_management_checker.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/chromeos/cryptauth/chrome_cryptauth_service.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/chromeos/cryptauth/chrome_cryptauth_service.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/extensions/api/identity/identity_api.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/extensions/api/identity/identity_api.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/metrics/desktop_session_duration/desktop_profile_session_durations_service.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/metrics/desktop_session_duration/desktop_profile_session_durations_service.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/policy/cloud/user_policy_signin_service.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/policy/cloud/user_policy_signin_service.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/profiles/profile_downloader.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/profiles/profile_downloader.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/chrome/browser/signin/dice_browsertest.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/components/browser_sync/sync_auth_manager.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/components/browser_sync/sync_auth_manager.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/components/gcm_driver/account_tracker.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/components/gcm_driver/account_tracker.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/components/invalidation/impl/profile_identity_provider.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/components/invalidation/impl/profile_identity_provider.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/google_apis/drive/auth_service.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/google_apis/drive/auth_service.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/ios/chrome/browser/signin/authentication_service_unittest.mm
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/cpp/identity_manager.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/cpp/identity_manager.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/cpp/identity_manager_unittest.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/cpp/identity_test_utils.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/cpp/primary_account_access_token_fetcher.cc
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/cpp/primary_account_access_token_fetcher.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/objc/identity_manager_observer_bridge.h
[modify] https://crrev.com/bc1d0fc31510d914bb085f7c8248991b2669509c/services/identity/public/objc/identity_manager_observer_bridge.mm

Status: Fixed (was: Assigned)

Sign in to add a comment