diff --git a/pkg/modules/migration/todoist/todoist.go b/pkg/modules/migration/todoist/todoist.go index 7f2e8f84..111ac543 100644 --- a/pkg/modules/migration/todoist/todoist.go +++ b/pkg/modules/migration/todoist/todoist.go @@ -313,6 +313,18 @@ func convertTodoistToVikunja(sync *sync) (fullVikunjaHierachie []*models.Namespa } tasks[i.ParentID].RelatedTasks[models.RelationKindSubtask] = append(tasks[i.ParentID].RelatedTasks[models.RelationKindSubtask], tasks[i.ID]) + + // Remove the task from the top level structure, otherwise it is added twice + outer: + for _, list := range lists { + for in, t := range list.Tasks { + if t == tasks[i.ID] { + list.Tasks = append(list.Tasks[:in], list.Tasks[in+1:]...) + break outer + } + } + } + delete(tasks, i.ID) } // Task Notes -> Task Descriptions diff --git a/pkg/modules/migration/todoist/todoist_test.go b/pkg/modules/migration/todoist/todoist_test.go index 0d2c7cbc..a242b7b0 100644 --- a/pkg/modules/migration/todoist/todoist_test.go +++ b/pkg/modules/migration/todoist/todoist_test.go @@ -413,13 +413,6 @@ func TestConvertTodoistToVikunja(t *testing.T) { }, }, }, - { - Title: "Task with parent", - Done: false, - Priority: 2, - Created: time1, - DoneAt: nilTime, - }, { Title: "Task400000106", Done: true,