Commit 5ea3a3d5 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Bumped timeout from 4000 to 20000 ms as it seems a more reasonable

threshold.

Also updating a sending message's sync state to SyncState.SYNCED at Realm
in case a sending message is successfully sent.
This sync status update fix is related to issue
https://github.com/RocketChat/Rocket.Chat.Android/issues/268
parent 841593bc
......@@ -36,7 +36,7 @@ import hugo.weaving.DebugLog;
*/
public class MethodCallHelper {
protected static final long TIMEOUT_MS = 4000;
protected static final long TIMEOUT_MS = 20000;
protected static final Continuation<String, Task<JSONObject>> CONVERT_TO_JSON_OBJECT =
task -> Task.forResult(new JSONObject(task.getResult()));
protected static final Continuation<String, Task<JSONArray>> CONVERT_TO_JSON_ARRAY =
......
......@@ -72,6 +72,11 @@ public class NewMessageObserver extends AbstractModelObserver<RealmMessage> {
realm.createOrUpdateObjectFromJson(RealmMessage.class, new JSONObject()
.put(RealmMessage.ID, messageId)
.put(RealmMessage.SYNC_STATE, SyncState.FAILED)));
} else {
realmHelper.executeTransaction(realm ->
realm.createOrUpdateObjectFromJson(RealmMessage.class, new JSONObject()
.put(RealmMessage.ID, messageId)
.put(RealmMessage.SYNC_STATE, SyncState.SYNCED)));
}
return null;
});
......
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