From 1c63c782a43e40fe51c2d40e89995741e9b2cb0a Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Mon, 4 Nov 2019 14:41:18 +0100 Subject: [PATCH] Dont use network info but only rely on peers count for mailservers Signed-off-by: Andrea Maria Piana --- src/status_im/mailserver/core.cljs | 10 ---------- src/status_im/network/net_info.cljs | 3 +-- test/appium/tests/atomic/chats/test_one_to_one.py | 2 +- test/appium/views/base_element.py | 11 +++++++++++ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/status_im/mailserver/core.cljs b/src/status_im/mailserver/core.cljs index d08f1d5114..2a5e379774 100644 --- a/src/status_im/mailserver/core.cljs +++ b/src/status_im/mailserver/core.cljs @@ -472,16 +472,6 @@ [{:keys [db]}] {:db (dissoc db :mailserver/request-to)}) -(fx/defn network-connection-status-changed - "when host reconnects, reset request-to and - reconnect to mailserver" - [{:keys [db] :as cofx} is-connected?] - (when (and (multiaccounts.model/logged-in? cofx) - is-connected?) - (fx/merge cofx - (reset-request-to) - (connect-to-mailserver)))) - (fx/defn remove-gaps [{:keys [db] :as cofx} chat-id] (fx/merge cofx diff --git a/src/status_im/network/net_info.cljs b/src/status_im/network/net_info.cljs index 0a61c93ff3..3c50309283 100644 --- a/src/status_im/network/net_info.cljs +++ b/src/status_im/network/net_info.cljs @@ -16,8 +16,7 @@ {:db (assoc db :network-status (if is-connected? :online :offline))} (when is-connected? (if-not (= (count (get-in db [:wallet :accounts])) (count (get-in db [:multiaccount :accounts]))) - (wallet/update-balances nil))) - (mailserver/network-connection-status-changed is-connected?))) + (wallet/update-balances nil))))) (fx/defn change-network-type [{:keys [db] :as cofx} old-network-type network-type expensive?] diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index 0333619472..492d7cd89d 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -72,7 +72,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): chat_2.connection_status.wait_for_invisibility_of_element(60) message_2 = 'one more message' chat_2.chat_message_input.send_keys(message_2) - chat_2.send_message_button.click() + chat_2.send_message_button.click_until_absense_of_element(chat_2.send_message_button) home_1.toggle_airplane_mode() # turning on WiFi connection on primary device diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index ea1976d5cc..e9fc6f31e4 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -280,3 +280,14 @@ class BaseButton(BaseElement): return self.navigate() except (NoSuchElementException, TimeoutException): counter += 1 + + def click_until_absense_of_element(self, desired_element, attempts=3): + counter = 0 + while desired_element.is_element_present(1) and counter <= attempts: + try: + self.driver.info('Tap on %s' % self.name) + self.find_element().click() + self.driver.info('Wait for %s' % desired_element.name) + counter += 1 + except (NoSuchElementException, TimeoutException): + return self.navigate()