In the following scenarion server id in commit is set incorrectly which triggers DCHECK in ProcessorEntityTracker::InitializeCommitRequestData:
- Model type creates local entity. Its entity data is cached in ProcessorEntityTracker.
- Syncer starts commit. Entity data is passed to ModelTypeWorker though ProcessorEntityTracker::InitializeCommitRequestData
- Model type modifies recently created entity. Its entity data with empty id is cached in ProcessorEntityTracker.
- Commit response comes in with updated server id (SharedModelTypeProcessor::OnCommitCompleted). Server id is preserved in entity tracker's metadata, but cached EntityData still has empty id.
- Syncer starts next commit. SMTP::GetLocalChanges collects commit request with empty id with results in new item being created on the server.
The fix should be to update server id from metadata right before passing it to worker in GetLocalChanges. The problem is that currently EntityData is kept as ProtoValuePtr in ProcessorEntityTracker, the value is immutable.
Comment 1 by pav...@chromium.org
, Nov 15 2017