From cbd2d92c0e8acea59877e51164a93528b475dbd7 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 5 Nov 2012 12:44:26 -0800 Subject: [PATCH] Convert to local ordering before saving during sync --- .../com/todoroo/astrid/actfm/sync/ActFmSyncService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index c8038dd5a..e9c507f3e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -76,6 +76,7 @@ import com.todoroo.astrid.service.StatisticsService; import com.todoroo.astrid.service.TagDataService; import com.todoroo.astrid.service.TaskService; import com.todoroo.astrid.service.abtesting.ABTestEventReportingService; +import com.todoroo.astrid.subtasks.SubtasksHelper; import com.todoroo.astrid.subtasks.SubtasksUpdater; import com.todoroo.astrid.sync.SyncV2Provider.SyncExceptionHandler; import com.todoroo.astrid.tags.TagService; @@ -942,7 +943,8 @@ public final class ActFmSyncService { invokeFetchList("task", manual, handler, new TaskListItemProcessor(manual) { @Override protected void saveOrdering(JSONArray ordering) { - Preferences.setString(SubtasksUpdater.ACTIVE_TASKS_ORDER, ordering.toString()); + String localOrdering = SubtasksHelper.convertTreeToLocalIds(ordering.toString()); + Preferences.setString(SubtasksUpdater.ACTIVE_TASKS_ORDER, localOrdering); } }, done, "active_tasks"); } @@ -966,7 +968,8 @@ public final class ActFmSyncService { @Override protected void saveOrdering(JSONArray ordering) { - tagData.setValue(TagData.TAG_ORDERING, ordering.toString()); + String localOrdering = SubtasksHelper.convertTreeToLocalIds(ordering.toString()); + tagData.setValue(TagData.TAG_ORDERING, localOrdering); PluginServices.getTagDataService().save(tagData); } }, done, "tasks:" + tagData.getId(), "tag_id", tagData.getValue(TagData.REMOTE_ID));