Commit 1c0e06e7 authored by Tiago Cunha's avatar Tiago Cunha

Log if error logs to firebase. Should help

parent b5cf7b21
...@@ -95,10 +95,10 @@ dependencies { ...@@ -95,10 +95,10 @@ dependencies {
} }
compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-core:10.0.0' compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-crash:10.0.0' compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.google.android.gms:play-services-gcm:10.0.0' compile 'com.google.android.gms:play-services-gcm:10.2.0'
compile rootProject.ext.okhttp3 compile rootProject.ext.okhttp3
......
...@@ -14,7 +14,7 @@ import chat.rocket.android.api.MethodCallHelper; ...@@ -14,7 +14,7 @@ import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.fragment.chatroom.HomeFragment; import chat.rocket.android.fragment.chatroom.HomeFragment;
import chat.rocket.android.fragment.chatroom.RoomFragment; import chat.rocket.android.fragment.chatroom.RoomFragment;
import chat.rocket.android.fragment.sidebar.SidebarMainFragment; import chat.rocket.android.fragment.sidebar.SidebarMainFragment;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.core.interactors.CanCreateRoomInteractor; import chat.rocket.core.interactors.CanCreateRoomInteractor;
import chat.rocket.core.interactors.RoomInteractor; import chat.rocket.core.interactors.RoomInteractor;
import chat.rocket.core.interactors.SessionInteractor; import chat.rocket.core.interactors.SessionInteractor;
...@@ -91,14 +91,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract ...@@ -91,14 +91,14 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
private void setUserOnlineIfServerAvailable() { private void setUserOnlineIfServerAvailable() {
if (hostname != null) { if (hostname != null) {
new MethodCallHelper(this, hostname).setUserPresence(User.STATUS_ONLINE) new MethodCallHelper(this, hostname).setUserPresence(User.STATUS_ONLINE)
.continueWith(new LogcatIfError()); .continueWith(new LogIfError());
} }
} }
private void setUserAwayIfServerAvailable() { private void setUserAwayIfServerAvailable() {
if (hostname != null) { if (hostname != null) {
new MethodCallHelper(this, hostname).setUserPresence(User.STATUS_AWAY) new MethodCallHelper(this, hostname).setUserPresence(User.STATUS_AWAY)
.continueWith(new LogcatIfError()); .continueWith(new LogIfError());
} }
} }
......
...@@ -6,7 +6,7 @@ import android.support.v4.util.Pair; ...@@ -6,7 +6,7 @@ import android.support.v4.util.Pair;
import chat.rocket.android.BackgroundLooper; import chat.rocket.android.BackgroundLooper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.shared.BasePresenter; import chat.rocket.android.shared.BasePresenter;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
import chat.rocket.core.interactors.MessageInteractor; import chat.rocket.core.interactors.MessageInteractor;
...@@ -153,7 +153,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View> ...@@ -153,7 +153,7 @@ public class RoomPresenter extends BasePresenter<RoomContract.View>
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe( .subscribe(
room -> methodCallHelper.readMessages(room.getRoomId()) room -> methodCallHelper.readMessages(room.getRoomId())
.continueWith(new LogcatIfError()) .continueWith(new LogIfError())
); );
addSubscription(subscription); addSubscription(subscription);
......
...@@ -14,7 +14,7 @@ import org.json.JSONObject; ...@@ -14,7 +14,7 @@ import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import chat.rocket.android.R; import chat.rocket.android.R;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.layouthelper.chatroom.dialog.RoomUserAdapter; import chat.rocket.android.layouthelper.chatroom.dialog.RoomUserAdapter;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
...@@ -92,7 +92,7 @@ public class UsersOfRoomDialogFragment extends AbstractChatRoomDialogFragment { ...@@ -92,7 +92,7 @@ public class UsersOfRoomDialogFragment extends AbstractChatRoomDialogFragment {
ConnectivityManager.getInstance(getContext().getApplicationContext()) ConnectivityManager.getInstance(getContext().getApplicationContext())
.keepAliveServer(); .keepAliveServer();
return task; return task;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
@Override @Override
......
...@@ -12,7 +12,7 @@ import org.json.JSONObject; ...@@ -12,7 +12,7 @@ import org.json.JSONObject;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.fragment.AbstractWebViewFragment; import chat.rocket.android.fragment.AbstractWebViewFragment;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.persistence.realm.models.ddp.RealmMeteorLoginServiceConfiguration; import chat.rocket.persistence.realm.models.ddp.RealmMeteorLoginServiceConfiguration;
import chat.rocket.persistence.realm.RealmStore; import chat.rocket.persistence.realm.RealmStore;
...@@ -111,7 +111,7 @@ public abstract class AbstractOAuthFragment extends AbstractWebViewFragment { ...@@ -111,7 +111,7 @@ public abstract class AbstractOAuthFragment extends AbstractWebViewFragment {
private void handleOAuthCallback(final String credentialToken, final String credentialSecret) { private void handleOAuthCallback(final String credentialToken, final String credentialSecret) {
new MethodCallHelper(getContext(), hostname) new MethodCallHelper(getContext(), hostname)
.loginWithOAuth(credentialToken, credentialSecret) .loginWithOAuth(credentialToken, credentialSecret)
.continueWith(new LogcatIfError()); .continueWith(new LogIfError());
} }
protected void onOAuthCompleted() { protected void onOAuthCompleted() {
......
...@@ -4,7 +4,7 @@ import android.support.annotation.NonNull; ...@@ -4,7 +4,7 @@ import android.support.annotation.NonNull;
import chat.rocket.android.BackgroundLooper; import chat.rocket.android.BackgroundLooper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.helper.TextUtils; import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.shared.BasePresenter; import chat.rocket.android.shared.BasePresenter;
import chat.rocket.core.interactors.RoomInteractor; import chat.rocket.core.interactors.RoomInteractor;
...@@ -67,7 +67,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View ...@@ -67,7 +67,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
@Override @Override
public void onLogout() { public void onLogout() {
if (methodCallHelper != null) { if (methodCallHelper != null) {
methodCallHelper.logout().continueWith(new LogcatIfError()); methodCallHelper.logout().continueWith(new LogIfError());
} }
} }
...@@ -95,7 +95,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View ...@@ -95,7 +95,7 @@ public class SidebarMainPresenter extends BasePresenter<SidebarMainContract.View
private void updateCurrentUserStatus(String status) { private void updateCurrentUserStatus(String status) {
if (methodCallHelper != null) { if (methodCallHelper != null) {
methodCallHelper.setUserStatus(status).continueWith(new LogcatIfError()); methodCallHelper.setUserStatus(status).continueWith(new LogIfError());
} }
} }
} }
...@@ -74,7 +74,7 @@ public class FileUploadHelper { ...@@ -74,7 +74,7 @@ public class FileUploadHelper {
.put(FileUploading.ROOM_ID, roomId) .put(FileUploading.ROOM_ID, roomId)
.put(FileUploading.ERROR, JSONObject.NULL) .put(FileUploading.ERROR, JSONObject.NULL)
) )
).continueWith(new LogcatIfError()); ).continueWith(new LogIfError());
return uplId; return uplId;
} }
......
package chat.rocket.android.helper; package chat.rocket.android.helper;
import com.google.firebase.crash.FirebaseCrash;
import bolts.Continuation; import bolts.Continuation;
import bolts.Task; import bolts.Task;
import chat.rocket.android.BuildConfig;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
/** /**
* Bolts-Task continuation for just logging if error occurred. * Bolts-Task continuation for just logging if error occurred.
*/ */
public class LogcatIfError implements Continuation { public class LogIfError implements Continuation {
@Override @Override
public Object then(Task task) throws Exception { public Object then(Task task) throws Exception {
if (task.isFaulted()) { if (task.isFaulted()) {
RCLog.w(task.getError()); if (BuildConfig.DEBUG) {
RCLog.w(task.getError());
}
FirebaseCrash.report(task.getError());
} }
return task; return task;
} }
......
...@@ -11,7 +11,7 @@ import java.util.Iterator; ...@@ -11,7 +11,7 @@ import java.util.Iterator;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.DDPClientWrapper; import chat.rocket.android.api.DDPClientWrapper;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.helper.TextUtils; import chat.rocket.android.helper.TextUtils;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.core.models.ServerInfo; import chat.rocket.core.models.ServerInfo;
...@@ -135,7 +135,7 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -135,7 +135,7 @@ public class RocketChatWebSocketThread extends HandlerThread {
session.setError(null); session.setError(null);
} }
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
/** /**
......
...@@ -9,7 +9,7 @@ import org.json.JSONException; ...@@ -9,7 +9,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.Iterator; import java.util.Iterator;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.persistence.realm.RealmHelper; import chat.rocket.persistence.realm.RealmHelper;
import chat.rocket.android.service.DDPClientRef; import chat.rocket.android.service.DDPClientRef;
...@@ -68,7 +68,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -68,7 +68,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
ddpClientRef.get().subscribe(getSubscriptionName(), params).onSuccess(task -> { ddpClientRef.get().subscribe(getSubscriptionName(), params).onSuccess(task -> {
if (isUnsubscribed) { if (isUnsubscribed) {
ddpClientRef.get().unsubscribe(task.getResult().id).continueWith(new LogcatIfError()); ddpClientRef.get().unsubscribe(task.getResult().id).continueWith(new LogIfError());
} else { } else {
subscriptionId = task.getResult().id; subscriptionId = task.getResult().id;
} }
...@@ -87,7 +87,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -87,7 +87,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
}).onSuccess(task -> { }).onSuccess(task -> {
rxSubscription = subscribe(); rxSubscription = subscribe();
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} else { } else {
rxSubscription = subscribe(); rxSubscription = subscribe();
} }
...@@ -122,7 +122,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -122,7 +122,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
realmHelper.executeTransaction(realm -> { realmHelper.executeTransaction(realm -> {
onDocumentAdded(realm, docEvent); onDocumentAdded(realm, docEvent);
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
private void onDocumentAdded(Realm realm, DDPSubscription.Added docEvent) throws JSONException { private void onDocumentAdded(Realm realm, DDPSubscription.Added docEvent) throws JSONException {
...@@ -136,7 +136,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -136,7 +136,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
realmHelper.executeTransaction(realm -> { realmHelper.executeTransaction(realm -> {
onDocumentChanged(realm, docEvent); onDocumentChanged(realm, docEvent);
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
private void onDocumentChanged(Realm realm, DDPSubscription.Changed docEvent) private void onDocumentChanged(Realm realm, DDPSubscription.Changed docEvent)
...@@ -157,7 +157,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -157,7 +157,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
realmHelper.executeTransaction(realm -> { realmHelper.executeTransaction(realm -> {
onDocumentRemoved(realm, docEvent); onDocumentRemoved(realm, docEvent);
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
private void onDocumentRemoved(Realm realm, DDPSubscription.Removed docEvent) private void onDocumentRemoved(Realm realm, DDPSubscription.Removed docEvent)
...@@ -182,7 +182,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable { ...@@ -182,7 +182,7 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
rxSubscription.unsubscribe(); rxSubscription.unsubscribe();
} }
if (!TextUtils.isEmpty(subscriptionId)) { if (!TextUtils.isEmpty(subscriptionId)) {
ddpClientRef.get().unsubscribe(subscriptionId).continueWith(new LogcatIfError()); ddpClientRef.get().unsubscribe(subscriptionId).continueWith(new LogIfError());
} }
} }
} }
...@@ -5,7 +5,7 @@ import org.json.JSONArray; ...@@ -5,7 +5,7 @@ import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.persistence.realm.RealmHelper; import chat.rocket.persistence.realm.RealmHelper;
import chat.rocket.android.service.DDPClientRef; import chat.rocket.android.service.DDPClientRef;
...@@ -69,11 +69,11 @@ abstract class AbstractStreamNotifyEventSubscriber extends AbstractDDPDocEventSu ...@@ -69,11 +69,11 @@ abstract class AbstractStreamNotifyEventSubscriber extends AbstractDDPDocEventSu
realm.where(getModelClass()) realm.where(getModelClass())
.equalTo(getPrimaryKeyForModel(), target.getString(getPrimaryKeyForModel())) .equalTo(getPrimaryKeyForModel(), target.getString(getPrimaryKeyForModel()))
.findAll().deleteAllFromRealm() .findAll().deleteAllFromRealm()
).continueWith(new LogcatIfError()); ).continueWith(new LogIfError());
} else { //inserted, updated } else { //inserted, updated
realmHelper.executeTransaction(realm -> realmHelper.executeTransaction(realm ->
realm.createOrUpdateObjectFromJson(getModelClass(), customizeFieldJson(target)) realm.createOrUpdateObjectFromJson(getModelClass(), customizeFieldJson(target))
).continueWith(new LogcatIfError()); ).continueWith(new LogIfError());
} }
} }
} }
...@@ -7,7 +7,7 @@ import io.realm.RealmResults; ...@@ -7,7 +7,7 @@ import io.realm.RealmResults;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.persistence.realm.models.ddp.RealmUser; import chat.rocket.persistence.realm.models.ddp.RealmUser;
import chat.rocket.persistence.realm.RealmHelper; import chat.rocket.persistence.realm.RealmHelper;
import chat.rocket.android.service.DDPClientRef; import chat.rocket.android.service.DDPClientRef;
...@@ -67,7 +67,7 @@ public class CurrentUserObserver extends AbstractModelObserver<RealmUser> { ...@@ -67,7 +67,7 @@ public class CurrentUserObserver extends AbstractModelObserver<RealmUser> {
listeners.add(listener); listeners.add(listener);
} }
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
@DebugLog @DebugLog
......
...@@ -12,7 +12,7 @@ import java.io.InputStream; ...@@ -12,7 +12,7 @@ import java.io.InputStream;
import java.util.List; import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.FileUploadingHelper; import chat.rocket.android.api.FileUploadingHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.helper.OkHttpHelper; import chat.rocket.android.helper.OkHttpHelper;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
...@@ -59,7 +59,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi ...@@ -59,7 +59,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi
.equalTo(FileUploading.STORAGE_TYPE, FileUploading.STORAGE_TYPE_S3) .equalTo(FileUploading.STORAGE_TYPE, FileUploading.STORAGE_TYPE_S3)
.findAll().deleteAllFromRealm(); .findAll().deleteAllFromRealm();
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
@Override @Override
...@@ -137,7 +137,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi ...@@ -137,7 +137,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi
realm.createOrUpdateObjectFromJson(FileUploading.class, new JSONObject() realm.createOrUpdateObjectFromJson(FileUploading.class, new JSONObject()
.put(FileUploading.ID, uplId) .put(FileUploading.ID, uplId)
.put(FileUploading.UPLOADED_SIZE, numBytes))) .put(FileUploading.UPLOADED_SIZE, numBytes)))
.continueWith(new LogcatIfError()); .continueWith(new LogIfError());
} }
} }
} }
......
...@@ -10,7 +10,7 @@ import java.io.InputStream; ...@@ -10,7 +10,7 @@ import java.io.InputStream;
import java.util.List; import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.api.FileUploadingHelper; import chat.rocket.android.api.FileUploadingHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.helper.OkHttpHelper; import chat.rocket.android.helper.OkHttpHelper;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
...@@ -63,7 +63,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo ...@@ -63,7 +63,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo
.endGroup() .endGroup()
.findAll().deleteAllFromRealm(); .findAll().deleteAllFromRealm();
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
@Override @Override
......
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
import bolts.Task; import bolts.Task;
import chat.rocket.android.RocketChatCache; import chat.rocket.android.RocketChatCache;
import chat.rocket.android.api.RaixPushHelper; import chat.rocket.android.api.RaixPushHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
import chat.rocket.persistence.realm.models.ddp.RealmPublicSetting; import chat.rocket.persistence.realm.models.ddp.RealmPublicSetting;
import chat.rocket.core.PublicSettingsConstants; import chat.rocket.core.PublicSettingsConstants;
...@@ -59,7 +59,7 @@ public class GcmPushRegistrationObserver extends AbstractModelObserver<GcmPushRe ...@@ -59,7 +59,7 @@ public class GcmPushRegistrationObserver extends AbstractModelObserver<GcmPushRe
realmHelper.executeTransaction(realm -> { realmHelper.executeTransaction(realm -> {
GcmPushRegistration.queryDefault(realm).findFirst().setSyncState(SyncState.FAILED); GcmPushRegistration.queryDefault(realm).findFirst().setSyncState(SyncState.FAILED);
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
return null; return null;
}); });
......
...@@ -7,7 +7,7 @@ import org.json.JSONObject; ...@@ -7,7 +7,7 @@ import org.json.JSONObject;
import java.util.List; import java.util.List;
import chat.rocket.android.helper.CheckSum; import chat.rocket.android.helper.CheckSum;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
import chat.rocket.persistence.realm.models.internal.MethodCall; import chat.rocket.persistence.realm.models.internal.MethodCall;
import chat.rocket.persistence.realm.RealmHelper; import chat.rocket.persistence.realm.RealmHelper;
...@@ -45,7 +45,7 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> { ...@@ -45,7 +45,7 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> {
.endGroup() .endGroup()
.findAll().deleteAllFromRealm(); .findAll().deleteAllFromRealm();
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
@Override @Override
...@@ -120,6 +120,6 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> { ...@@ -120,6 +120,6 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> {
}); });
} }
return task; return task;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
} }
...@@ -7,7 +7,7 @@ import org.json.JSONObject; ...@@ -7,7 +7,7 @@ import org.json.JSONObject;
import java.util.List; import java.util.List;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.android.log.RCLog; import chat.rocket.android.log.RCLog;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
import chat.rocket.persistence.realm.models.ddp.RealmMessage; import chat.rocket.persistence.realm.models.ddp.RealmMessage;
...@@ -36,7 +36,7 @@ public class NewMessageObserver extends AbstractModelObserver<RealmMessage> { ...@@ -36,7 +36,7 @@ public class NewMessageObserver extends AbstractModelObserver<RealmMessage> {
} }
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
@Override @Override
......
...@@ -7,7 +7,7 @@ import io.realm.RealmResults; ...@@ -7,7 +7,7 @@ import io.realm.RealmResults;
import java.util.List; import java.util.List;
import chat.rocket.android.RocketChatCache; import chat.rocket.android.RocketChatCache;
import chat.rocket.android.api.RaixPushHelper; import chat.rocket.android.api.RaixPushHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.persistence.realm.models.internal.GetUsersOfRoomsProcedure; import chat.rocket.persistence.realm.models.internal.GetUsersOfRoomsProcedure;
import chat.rocket.persistence.realm.models.internal.LoadMessageProcedure; import chat.rocket.persistence.realm.models.internal.LoadMessageProcedure;
import chat.rocket.persistence.realm.models.internal.MethodCall; import chat.rocket.persistence.realm.models.internal.MethodCall;
...@@ -73,7 +73,7 @@ public class SessionObserver extends AbstractModelObserver<RealmSession> { ...@@ -73,7 +73,7 @@ public class SessionObserver extends AbstractModelObserver<RealmSession> {
// update push info // update push info
pushHelper pushHelper
.pushSetUser(RocketChatCache.getOrCreatePushId(context)) .pushSetUser(RocketChatCache.getOrCreatePushId(context))
.continueWith(new LogcatIfError()); .continueWith(new LogIfError());
} }
@DebugLog @DebugLog
...@@ -86,6 +86,6 @@ public class SessionObserver extends AbstractModelObserver<RealmSession> { ...@@ -86,6 +86,6 @@ public class SessionObserver extends AbstractModelObserver<RealmSession> {
realm.delete(LoadMessageProcedure.class); realm.delete(LoadMessageProcedure.class);
realm.delete(GetUsersOfRoomsProcedure.class); realm.delete(GetUsersOfRoomsProcedure.class);
return null; return null;
}).continueWith(new LogcatIfError()); }).continueWith(new LogIfError());
} }
} }
...@@ -6,7 +6,7 @@ import io.realm.RealmResults; ...@@ -6,7 +6,7 @@ import io.realm.RealmResults;
import java.util.List; import java.util.List;
import chat.rocket.android.api.MethodCallHelper; import chat.rocket.android.api.MethodCallHelper;
import chat.rocket.android.helper.LogcatIfError; import chat.rocket.android.helper.LogIfError;
import chat.rocket.persistence.realm.models.internal.RealmSession; import chat.rocket.persistence.realm.models.internal.RealmSession;
import chat.rocket.persistence.realm.RealmHelper; import chat.rocket.persistence.realm.RealmHelper;
import chat.rocket.android.service.DDPClientRef; import chat.rocket.android.service.DDPClientRef;
...@@ -37,6 +37,6 @@ public class TokenLoginObserver extends AbstractModelObserver<RealmSession> { ...@@ -37,6 +37,6 @@ public class TokenLoginObserver extends AbstractModelObserver<RealmSession> {
} }
RealmSession session = results.get(0); RealmSession session = results.get(0);
methodCall.loginWithToken(session.getToken()).continueWith(new LogcatIfError()); methodCall.loginWithToken(session.getToken()).continueWith(new LogIfError());
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment