Fixed a super sad bug with how message batches were handled, added crittercism logging of some handled sync exceptions

pull/14/head
Sam Bosley 11 years ago
parent 82a5eb3fd5
commit c6e7bc852e

@ -313,8 +313,10 @@ public class ActFmSyncThread {
}
}
if (payload.length() == 0)
if (payload.length() == 0) {
messageBatch.clear();
continue;
}
try {
JSONObject response = actFmInvoker.postSync(payload, entity, token);
@ -361,7 +363,7 @@ public class ActFmSyncThread {
}
}
messageBatch = new LinkedList<ClientToServerMessage<?>>();
messageBatch.clear();
}
}
} catch (Exception e) {

@ -14,6 +14,7 @@ import org.json.JSONObject;
import android.text.TextUtils;
import android.util.Log;
import com.crittercism.app.Crittercism;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.Property.PropertyVisitor;
import com.todoroo.andlib.data.TodorooCursor;
@ -172,6 +173,7 @@ public class ChangesHappened<TYPE extends RemoteModel, OE extends OutstandingEnt
array.put(changeJson);
} catch (JSONException e) {
Log.e(ERROR_TAG, "Error writing change to JSON", e);
Crittercism.logHandledException(e);
}
}
return array;

@ -4,6 +4,7 @@ import org.apache.http.entity.mime.MultipartEntity;
import org.json.JSONException;
import org.json.JSONObject;
import com.crittercism.app.Crittercism;
import com.todoroo.andlib.data.AbstractModel;
import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.utility.DateUtilities;
@ -75,6 +76,7 @@ public abstract class ClientToServerMessage<TYPE extends RemoteModel> {
else
return null;
} catch (JSONException e) {
Crittercism.logHandledException(e);
return null;
}
}

Loading…
Cancel
Save