From b53cd74d1fadc15438624c6406a485136ee72956 Mon Sep 17 00:00:00 2001 From: Jocelyn Liu Date: Tue, 1 Sep 2020 16:36:53 -0700 Subject: [PATCH] Remove OldParentID attribute since it is removed from upstream. Chromium client side change for removing old_parent_id field in sync.proto: https://source.chromium.org/chromium/chromium/src/+/32ff0a993dc3cab32c721d769497a9abc18a937e --- datastore/sync_entity.go | 6 ------ datastore/sync_entity_test.go | 5 ----- 2 files changed, 11 deletions(-) diff --git a/datastore/sync_entity.go b/datastore/sync_entity.go index 55cb3359..2b91651d 100644 --- a/datastore/sync_entity.go +++ b/datastore/sync_entity.go @@ -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 @@ -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)) } @@ -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, @@ -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, diff --git a/datastore/sync_entity_test.go b/datastore/sync_entity_test.go index c70789f5..3713b41f 100644 --- a/datastore/sync_entity_test.go +++ b/datastore/sync_entity_test.go @@ -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) @@ -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"), @@ -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, @@ -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), @@ -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,