Skip to content

Commit

Permalink
Remove OldParentID attribute since it is removed from upstream.
Browse files Browse the repository at this point in the history
Chromium client side change for removing old_parent_id field in sync.proto:
https://source.chromium.org/chromium/chromium/src/+/32ff0a993dc3cab32c721d769497a9abc18a937e
  • Loading branch information
yrliou committed Sep 1, 2020
1 parent 2b1197f commit b53cd74
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
6 changes: 0 additions & 6 deletions datastore/sync_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type SyncEntity struct {
ClientID string
ID string
ParentID *string `dynamodbav:",omitempty"`
OldParentID *string `dynamodbav:",omitempty"`
Version *int64
Mtime *int64
Ctime *int64
Expand Down Expand Up @@ -281,9 +280,6 @@ func (dynamo *Dynamo) UpdateSyncEntity(entity *SyncEntity) (bool, bool, error) {
if entity.ParentID != nil {
update = update.Set(expression.Name("ParentID"), expression.Value(entity.ParentID))
}
if entity.OldParentID != nil {
update = update.Set(expression.Name("OldParentID"), expression.Value(entity.OldParentID))
}
if entity.Name != nil {
update = update.Set(expression.Name("Name"), expression.Value(entity.Name))
}
Expand Down Expand Up @@ -570,7 +566,6 @@ func CreateDBSyncEntity(entity *sync_pb.SyncEntity, cacheGUID *string, clientID
ClientID: clientID,
ID: id,
ParentID: entity.ParentIdString,
OldParentID: entity.OldParentId,
Version: entity.Version,
Ctime: cTime,
Mtime: now,
Expand All @@ -594,7 +589,6 @@ func CreatePBSyncEntity(entity *SyncEntity) (*sync_pb.SyncEntity, error) {
pbEntity := &sync_pb.SyncEntity{
IdString: &entity.ID,
ParentIdString: entity.ParentID,
OldParentId: entity.OldParentID,
Version: entity.Version,
Mtime: entity.Mtime,
Ctime: entity.Ctime,
Expand Down
5 changes: 0 additions & 5 deletions datastore/sync_entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ func (suite *SyncEntityTestSuite) TestUpdateSyncEntity_Basic() {
updateEntity2.Folder = aws.Bool(false)
updateEntity2.UniquePosition = []byte{5, 6}
updateEntity2.ParentID = aws.String("parentID")
updateEntity2.OldParentID = aws.String("oldParentID")
updateEntity2.Name = aws.String("name")
updateEntity2.NonUniqueName = aws.String("non_unique_name")
conflict, delete, err = suite.dynamo.UpdateSyncEntity(&updateEntity2)
Expand Down Expand Up @@ -525,7 +524,6 @@ func (suite *SyncEntityTestSuite) TestCreateDBSyncEntity() {
pbEntity := sync_pb.SyncEntity{
IdString: aws.String("client_item_id"),
ParentIdString: aws.String("parent_id"),
OldParentId: aws.String("old_parent_id"),
Version: aws.Int64(0),
Name: aws.String("name"),
NonUniqueName: aws.String("non_unique_name"),
Expand All @@ -539,7 +537,6 @@ func (suite *SyncEntityTestSuite) TestCreateDBSyncEntity() {
expectedDBEntity := datastore.SyncEntity{
ClientID: "client1",
ParentID: pbEntity.ParentIdString,
OldParentID: pbEntity.OldParentId,
Version: pbEntity.Version,
Name: pbEntity.Name,
NonUniqueName: pbEntity.NonUniqueName,
Expand Down Expand Up @@ -637,7 +634,6 @@ func (suite *SyncEntityTestSuite) TestCreatePBSyncEntity() {
ClientID: "client1",
ID: "id1",
ParentID: aws.String("parent_id"),
OldParentID: aws.String("old_parent_id"),
Version: aws.Int64(10),
Mtime: aws.Int64(12345678),
Ctime: aws.Int64(12345678),
Expand All @@ -657,7 +653,6 @@ func (suite *SyncEntityTestSuite) TestCreatePBSyncEntity() {
expectedPBEntity := sync_pb.SyncEntity{
IdString: &dbEntity.ID,
ParentIdString: dbEntity.ParentID,
OldParentId: dbEntity.OldParentID,
Version: dbEntity.Version,
Mtime: dbEntity.Mtime,
Ctime: dbEntity.Ctime,
Expand Down

0 comments on commit b53cd74

Please sign in to comment.