Dont check `app-state` for `Android` when evaluating universal links routing (#15896)

* Dont check app-state for android before routing PN

On Android devices, right after account creation and before a log out, the :app-state value in reframe db is set to background. The value becomes active after a log out and then log in which causes tapping on push notifications to do nothing.

This behaviour breaks E2E and hence in this PR, I remove the checking of this case only for Android platforms.
More work should be done to figure out why the app state event handler is behaving this way on Android but for now I would like to unblock E2E.

* e2e: remove xfailed tests

---------

Co-authored-by: Churikova Tetiana <tatiana@status.im>
This commit is contained in:
Siddarth Kumar 2023-05-18 00:20:38 +05:30 committed by GitHub
parent 7efd1e5d6b
commit eea55b22d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -13,7 +13,8 @@
[status-im.wallet.choose-recipient.core :as choose-recipient]
[status-im2.navigation.events :as navigation]
[taoensso.timbre :as log]
[native-module.core :as native-module]))
[native-module.core :as native-module]
[react-native.platform :as platform]))
;; TODO(yenda) investigate why `handle-universal-link` event is
;; dispatched 7 times for the same link
@ -175,10 +176,15 @@
(rf/defn handle-url
"Store url in the database if the user is not logged in, to be processed
on login, otherwise just handle it"
on login, otherwise just handle it. On Android platform the app-state value
in db is `background` immediately after account creation, hence we avoid the
app-state check for android platforms to fix this e2e blocker :
https://github.com/status-im/status-mobile/issues/15859
"
{:events [:universal-links/handle-url]}
[{:keys [db] :as cofx} url]
(if (and (multiaccounts.model/logged-in? db) (= (:app-state db) "active"))
(if (and (multiaccounts.model/logged-in? db)
(or platform/android? (= (:app-state db) "active")))
(route-url cofx url)
(store-url-for-later cofx url)))

View File

@ -1065,7 +1065,6 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(702813)
@marks.xfail(reason="blocked by 15859")
def test_1_1_chat_push_emoji(self):
message_no_pn, message = 'No PN', 'Text push notification'

View File

@ -203,7 +203,6 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
self.chats[0].send_message(self.message_before_adding)
@marks.testrail_id(702807)
@marks.xfail(reason="blocked by 15859")
def test_group_chat_join_send_text_messages_push(self):
message_to_admin = self.message_to_admin
[self.homes[i].click_system_back_button_until_element_is_shown() for i in range(3)]

View File

@ -743,7 +743,6 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(702786)
@marks.xfail(reason="blocked by 15859")
def test_community_mentions_push_notification(self):
self.home_1.click_system_back_button_until_element_is_shown()
if not self.channel_2.chat_message_input.is_element_displayed():