New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 774657 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Proj-Servicification



Sign in to add a comment

Ash preferences users need awareness of pref service syncing changes

Project Member Reported by msw@chromium.org, Oct 13 2017

Issue description

Ash preferences users need awareness of pref service syncing changes

There are a number of Ash features that rely on knowing when preference syncing has completed.
For example, shelf alignment & auto-hide prefs are init with synced values the first time a user signs in.
(Users have per-device shelf prefs, but new devices start with the latest values synced from other devices)
This is implemented by initializing the local values with synced values the first time sync occurs.
(See ChromeLauncherPrefsObserver or ChromeLauncherController::OnIsSyncingChanged.)

Ash PrefService instances are currently not PrefServiceSyncable, so Ash can't observe OnIsSyncingChanged.
(See SessionObserver::OnActiveUserPrefServiceChanged and SessionController::Get*PrefService*)

Chrome-side init is problematic, because Ash's foreign prefs may not be registered before OnIsSyncingChanged.
Moving these Ash-owned prefs to Chrome is possible, but seems like a bad pattern and causes other fallout.

This might affect other areas soon, OnIsSyncingChanged is used by other chrome/browser/chromeos features.
Advice/help/triage is appreciated. I have a WIP CL to try to make shelf prefs init more reliable:
https://chromium-review.googlesource.com/c/chromium/src/+/717476
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 16 2017

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

commit 7e440443c0dd5d86061c4084e0964605c8724c2b
Author: Mike Wasserman <msw@chromium.org>
Date: Mon Oct 16 16:59:11 2017

ash: Make local shelf pref init more reliable on first sign-in.

Nix ChromeLauncherPrefsObserver; it usually wasn't created, afaict.
Ash prefs were usually registered with chrome too late in local tests.
(they are available on first sign-in for some unknown timing reason)

Inline behavior in ChromeLauncherController::OnIsSyncingChanged.
Wait for OnIsSyncingChanged to check for pref registration and init.
Timing still isn't guaranteed, but this moves the needle in our favor.

TODO: Init prefs in Ash for guaranteed ordering - crbug.com/774657

Bug: 753823,774657
Change-Id: Ia9a0e4a8a512d50a414b331f39ad72194d1357f6
Reviewed-on: https://chromium-review.googlesource.com/717476
Commit-Queue: Michael Wasserman <msw@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509079}
[modify] https://crrev.com/7e440443c0dd5d86061c4084e0964605c8724c2b/ash/shelf/shelf_controller.cc
[modify] https://crrev.com/7e440443c0dd5d86061c4084e0964605c8724c2b/chrome/browser/ui/ash/chrome_launcher_prefs.cc
[modify] https://crrev.com/7e440443c0dd5d86061c4084e0964605c8724c2b/chrome/browser/ui/ash/chrome_launcher_prefs.h
[modify] https://crrev.com/7e440443c0dd5d86061c4084e0964605c8724c2b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
[modify] https://crrev.com/7e440443c0dd5d86061c4084e0964605c8724c2b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h

Cc: msw@chromium.org
Status: Started (was: Untriaged)
Is this still in need of further attention?

Comment 3 by msw@chromium.org, Nov 15 2017

Status: Available (was: Started)
Yes, my CL above only made the shelf pref init problems less likely to occur.
Remote mojo PrefService users should be notified when pref syncing has started.
See my first comment that explains the issue in more detail.
Help from someone that knows prefs/sync well is appreciated!

Comment 4 by vadimt@chromium.org, Nov 27 2017

Labels: Not-Touch-Friendly-Launcher
Labels: Sync-Triaged
Owner: tschumann@chromium.org
Status: Assigned (was: Available)
Components: Internals>Services>Ash
Labels: -Proj-Mustash-Mash

Comment 8 by dxie@chromium.org, May 30 2018

Labels: Hotlist-KnownIssue
The mojo PrefService's client has the concept of a local write-through cache as part of the client. https://docs.google.com/document/d/1JU8QUWxMEXWMqgkvFUumKSxr7Z-nfq0YvreSJTkMVmU/edit#heading=h.h4s95ei8yxde

Is there anything missing from the sync side to support those use cases?

Comment 10 by msw@chromium.org, Jun 20 2018

This bug is specifically about mojo apps knowing when pref values have been obtained from sync.
ie. on first sign-in, local shelf prefs are initialized from synced values; Ash should do that, not Chrome.
See the original comment for additional details, any help here would be much appreciated.
Owner: ----
Status: Available (was: Assigned)
I'm not familiar enough with the mojo PrefService design. But if that's a valid use case, then exposing functionality like PrefServiceSyncable::IsPrioritySyncing() or PrefServiceSyncable::IsPrefSynced() sounds like a solution.

I'm unassigning myself as this looks like a prefservice feature request and less of a sync feature request (if it's correct that PrefServiceSyncable has the required functionality).


sync-triage ping: this issue in quite old and doesn't have an owner, maybe it should be P3?
FWIW, it's still relevant and would be nice to fix.
Components: -Services>Sync
about Comment12: I don't think this is a sync service issue (sync-triage shouldn't apply here). Removing Services > Sync component.
Owner: manucornet@chromium.org
Components: -UI>Shell>Shelf
Owner: ----

Sign in to add a comment