diff --git a/api/src/com/todoroo/astrid/sync/SyncProvider.java b/api/src/com/todoroo/astrid/sync/SyncProvider.java index 08dcd98b0..53cded1d1 100644 --- a/api/src/com/todoroo/astrid/sync/SyncProvider.java +++ b/api/src/com/todoroo/astrid/sync/SyncProvider.java @@ -347,6 +347,7 @@ public abstract class SyncProvider { * whether to display a dialog */ protected void handleException(String tag, Exception e, boolean displayError) { + //TODO: When Crittercism supports it, report error to them final Context context = ContextManager.getContext(); getUtilities().setLastError(e.toString()); diff --git a/astrid/AndroidManifest.xml b/astrid/AndroidManifest.xml index d64293c7c..e528d20f4 100644 --- a/astrid/AndroidManifest.xml +++ b/astrid/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionName="3.8.5" + android:versionCode="200"> diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncProvider.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncProvider.java index 1e2b7ee5f..cdf80e3e5 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncProvider.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncProvider.java @@ -93,7 +93,7 @@ public class ActFmSyncProvider extends SyncProvider { } catch (IllegalStateException e) { // occurs when application was closed } catch (Exception e) { - handleException("actfm-authenticate", e, true); + handleException("actfm-authenticate", e, false); } finally { actFmPreferenceService.stopOngoing(); } @@ -152,7 +152,7 @@ public class ActFmSyncProvider extends SyncProvider { } catch (IllegalStateException e) { // occurs when application was closed } catch (Exception e) { - handleException("actfm-sync", e, true); //$NON-NLS-1$ + handleException("actfm-sync", e, false); //$NON-NLS-1$ } finally { StatisticsService.reportEvent(StatisticsConstants.ACTFM_SYNC_FINISHED, "success", Boolean.toString(syncSuccess)); //$NON-NLS-1$ diff --git a/astrid/src/com/todoroo/astrid/activity/FilterListActivity.java b/astrid/src/com/todoroo/astrid/activity/FilterListActivity.java index 6ccf4177b..3e7c9798f 100644 --- a/astrid/src/com/todoroo/astrid/activity/FilterListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/FilterListActivity.java @@ -453,21 +453,23 @@ public class FilterListActivity extends ExpandableListActivity { @Override public void run() { try { + Preferences.setLong(LAST_TAG_REFRESH_KEY, DateUtilities.now()); actFmSyncService.fetchTags(0); runOnUiThread(new Runnable() { @Override public void run() { - Preferences.setLong(LAST_TAG_REFRESH_KEY, DateUtilities.now()); adapter.clear(); adapter.getLists(); } }); } catch (IOException e) { - exceptionService.displayAndReportError(FilterListActivity.this, "refresh-tags-io", e); + if (manual) + exceptionService.displayAndReportError(FilterListActivity.this, "refresh-tags-io", e); } catch (JSONException e) { - exceptionService.displayAndReportError(FilterListActivity.this, "refresh-tags-json", e); + if (manual) + exceptionService.displayAndReportError(FilterListActivity.this, "refresh-tags-json", e); } finally { if (manual) DialogUtilities.dismissDialog(FilterListActivity.this, progressDialog); diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 545a50733..7a8d33da1 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -156,6 +156,8 @@ public class TaskListActivity extends ListActivity implements OnScrollListener, /** token for indicating source of TLA launch */ public static final String TOKEN_SOURCE = "source"; //$NON-NLS-1$ + private static final String LAST_AUTOSYNC_ATTEMPT = "last-autosync"; //$NON-NLS-1$ + // --- instance variables @Autowired ExceptionService exceptionService; @@ -473,11 +475,15 @@ public class TaskListActivity extends ListActivity implements OnScrollListener, private void initiateAutomaticSync() { if (!actFmPreferenceService.isLoggedIn()) return; long lastFetchDate = actFmPreferenceService.getLastSyncDate(); - if(DateUtilities.now() < lastFetchDate + 300000L) + long lastAutosyncAttempt = Preferences.getLong(LAST_AUTOSYNC_ATTEMPT, 0); + + long lastTry = Math.max(lastFetchDate, lastAutosyncAttempt); + if(DateUtilities.now() < lastTry + 300000L) return; new Thread() { @Override public void run() { + Preferences.setLong(LAST_AUTOSYNC_ATTEMPT, DateUtilities.now()); new ActFmSyncProvider().synchronize(TaskListActivity.this); } }.start(); diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java index 6ab3a139e..68583c91a 100644 --- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java +++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java @@ -40,6 +40,8 @@ import com.todoroo.astrid.utility.AstridPreferences; public final class UpgradeService { + public static final int V3_8_5 = 200; + public static final int V3_8_4_4 = 199; public static final int V3_8_4_3 = 198; public static final int V3_8_4_2 = 197; public static final int V3_8_4_1 = 196; @@ -158,6 +160,16 @@ public final class UpgradeService { StringBuilder changeLog = new StringBuilder(); // current message + if (from < V3_8_5) { + newVersionString(changeLog, "3.8.5 (10/27/11)", new String[] { + "All new reminders and nudges!", + "Share lists and tasks with iPhone users!", + "Better sync with Chrome App and Astrid.com", + "Numerous bugs destroyed", + "Have a spectacular day!", + }); + } + if (from >= V3_8_4 && from < V3_8_4_3) { newVersionString(changeLog, "3.8.4.3 (10/05/11)", new String[] { "Additional fixes to Google Tasks API, and added better error messages to " +