Hello.
The problem: new sync client is created each time when the synchronization is turned on in Browser.
Steps to reproduce:
1. Create new account
2. Enable synchronization for it
3. Go to browser://sync-internals/ make sure that there is only one device in "Sync Node Browser/device_info".
4. Disable the synchronization
5. Enable sync to the same account
6. Go to browser://sync-internals/ - there will be already two devices in "Sync Node Browser/device_info"
This is because the client identifies itself by GUID, which is generated anew each time the database is created (GenerateCacheGUID in DirectoryBackingStore::CreateTables method).
The most correct would be to use the unique device ID, which would never be changed. However, it is almost impossible to get such an ID, so more or less acceptable solution would be to generate cache_guid once and remember it in the preferences - this guarantees that clients will not duplicating until the preferences will not be wiped.
We made this change in our fork of Chromium and it works. But it seems that identifier stored in the settings is enough, and the identifier stored in the database is redundant.
Does it make sense in this case to store the cache_guid in the DB? For what purpose the cache_guid is generated randomly in all implementations/instances of DirectoryBackingStore now?