Ignore 404 when fetching list updates

pull/996/head
Alex Baker 6 years ago
parent fb4b241c55
commit d6aa21c4f9

@ -204,6 +204,10 @@ public class GoogleTaskSynchronizer {
} }
for (GoogleTaskList list : for (GoogleTaskList list :
googleTaskListDao.getByRemoteId(transform(gtaskLists, TaskList::getId))) { googleTaskListDao.getByRemoteId(transform(gtaskLists, TaskList::getId))) {
if (Strings.isNullOrEmpty(list.getRemoteId())) {
tracker.reportException(new RuntimeException("Empty remote id"));
continue;
}
fetchAndApplyRemoteChanges(gtasksInvoker, list); fetchAndApplyRemoteChanges(gtasksInvoker, list);
if (!preferences.isPositionHackEnabled()) { if (!preferences.isPositionHackEnabled()) {
googleTaskDao.reposition(list.getRemoteId()); googleTaskDao.reposition(list.getRemoteId());
@ -389,8 +393,14 @@ public class GoogleTaskSynchronizer {
List<com.google.api.services.tasks.model.Task> tasks = new ArrayList<>(); List<com.google.api.services.tasks.model.Task> tasks = new ArrayList<>();
String nextPageToken = null; String nextPageToken = null;
do { do {
Tasks taskList = Tasks taskList;
try {
taskList =
gtasksInvoker.getAllGtasksFromListId(listId, lastSyncDate + 1000L, nextPageToken); gtasksInvoker.getAllGtasksFromListId(listId, lastSyncDate + 1000L, nextPageToken);
} catch (HttpNotFoundException e) {
tracker.reportException(e);
return;
}
if (taskList == null) { if (taskList == null) {
break; break;
} }

Loading…
Cancel
Save