• James Cook's avatar
    Sync updates for SYNCABLE_OS_PREFS back to old clients · f7ffd7d2
    James Cook authored
    We rely on sync to provide the user's OS settings when setting
    up a new Chromebook. However, new devices are not guaranteed
    to be running the latest version of Chrome before the user's
    first login (it's a poor experience to have to wait to download
    a large OS update before being allowed to sign in).
    
    As part of go/split-settings-sync we are migrating OS prefs to
    new sync ModelTypes OS_PREFERENCES and OS_PRIORITY_PREFERENCES.
    We need to ensure that old clients still get synced updates for
    these preferences.
    
    When split sync is disabled, register OS pref names with the
    browser pref ModelTypes. This makes sync work just like it did
    before the split, and allows OS prefs to always be registered
    as SYNCABLE_OS_PREF, without conditionals on the flag.
    
    When split sync is enabled, register OS pref names with the
    PrefModelAssociators for both the new ModelType and the old
    ModelType. When a pref is changed locally, this sends updates
    to the sync server under both ModelTypes.
    
    However, when a sync change is received from the server we
    only apply the update if the change is for the new ModelType.
    We made a product decision not to sync updates from old clients
    to new clients. This helps avoid ping-pong updates between old
    and new clients.
    
    Bug: 1013466
    Test: added to components_unittests
    Test: manually verified that new client with flag enabled
      sends updates to old client (M78), but old client changes
      are ignored on new client.
      updates
    Test: manually verified that client with flag disabled
      syncs updates in both directions with old client (M78).
    
    Change-Id: I04c494938d3526c57b8eb2f9c689acb0d4b0a3ed
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865662
    Commit-Queue: James Cook <jamescook@chromium.org>
    Auto-Submit: James Cook <jamescook@chromium.org>
    Reviewed-by: default avatarMarc Treib <treib@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#708442}
    f7ffd7d2
pref_service_syncable.cc 10.7 KB