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 b7644cd7a..269c2c3d8 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -431,14 +431,7 @@ public final class ActFmSyncService { } if (sharing) { - JSONArray abTestInfo = abTestEventReportingService.getTestsWithVariantsArray(); - try { - for (int i = 0; i < abTestInfo.length(); i++) { - params.add("ab_variants[]"); params.add(abTestInfo.getString(i)); - } - } catch (JSONException e) { - Log.e("Error parsing AB test info", abTestInfo.toString(), e); - } + addAbTestEventInfo(params); } if(Flags.checkAndClear(Flags.TAGS_CHANGED) || newlyCreated) { @@ -499,6 +492,17 @@ public final class ActFmSyncService { taskDao.saveExistingWithSqlConstraintCheck(task); } + private void addAbTestEventInfo(List params) { + JSONArray abTestInfo = abTestEventReportingService.getTestsWithVariantsArray(); + try { + for (int i = 0; i < abTestInfo.length(); i++) { + params.add("ab_variants[]"); params.add(abTestInfo.getString(i)); + } + } catch (JSONException e) { + Log.e("Error parsing AB test info", abTestInfo.toString(), e); + } + } + /** * Synchronize complete task with server * @param task id @@ -590,6 +594,9 @@ public final class ActFmSyncService { } params.add(array); } + + addAbTestEventInfo(params); + } catch (JSONException e) { throw new RuntimeException(e); }