New issue
Advanced search Search tips

Issue 671211 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

SharedModelTypeProcessor should allow create/delete/create of an entity

Project Member Reported by olivierrobin@chromium.org, Dec 5 2016

Issue description

In 
ProcessorEntityTracker* SharedModelTypeProcessor::CreateEntity(
    const std::string& storage_key,
    const EntityData& data)

When creating an entity, there are 2 DCHECK to check that the entity does not already exist.

The first one checks that entities_ does not contain a similar entity, the second that storage_key_to_tag_hash_ does not contain the hash.

When calling processor->remove(), the entity is removed from entities_ in SharedModelTypeProcessor::OnCommitCompleted(

but storage_key_to_tag_hash_ is never cleaned.
This means that when doing

processor()->Put(key);
processor()->Delete(key);
processor()->Put(key);

the test on storage_key_to_tag_hash_ DCHECKS.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 6 2016

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

commit c26668deea2b1dbfcba8efc40d40f9598eed57c2
Author: pavely <pavely@chromium.org>
Date: Tue Dec 06 20:30:31 2016

[Sync] Remove entry from SMTP::storage_key_to_tag_hash_ when deleting tracker

The issue is that entry in storage_key_to_tag_hash_ is not erased when entity
tracker is removed from entities_. Because of this CreateEntry DCHECKs when
entity is deleted and then recreated.

BUG= 671211 
R=maxbogue@chromium.org

Review-Url: https://codereview.chromium.org/2557713004
Cr-Commit-Position: refs/heads/master@{#436696}

[modify] https://crrev.com/c26668deea2b1dbfcba8efc40d40f9598eed57c2/components/sync/model_impl/shared_model_type_processor.cc
[modify] https://crrev.com/c26668deea2b1dbfcba8efc40d40f9598eed57c2/components/sync/model_impl/shared_model_type_processor.h
[modify] https://crrev.com/c26668deea2b1dbfcba8efc40d40f9598eed57c2/components/sync/model_impl/shared_model_type_processor_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment