Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: non supported network warning is shown on the bridge flow #20098

Merged
merged 1 commit into from
May 27, 2024

Conversation

briansztamfater
Copy link
Member

@briansztamfater briansztamfater commented May 19, 2024

fixes #20080

Summary

This PR fixes warning about non supported networks being shown in the bridge flow, and disables unavailable networks for token in the Bridge token to screen.

Platforms

  • Android
  • iOS

Areas that maybe impacted

Functional
  • wallet / transactions

Steps to test

  • Recover user with available assets on at least 2 networks.
  • Go to bridge flow.
  • Select any network to bridge.
  • Enter an assets amount equal to the total assets on both networks.
  • Disable some built networks in FROM section if step 4 didn't help.
  • Verify non supported network warning wasn't shown
  • Verify unsupported token network are disabled in the Bridge to... screen

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented May 19, 2024

Jenkins Builds

Click to see older builds (32)
Commit #️⃣ Finished (UTC) Duration Platform Result
c649e00 #1 2024-05-19 12:21:35 ~5 min tests 📄log
✔️ c649e00 #1 2024-05-19 12:24:34 ~8 min ios 📱ipa 📲
✔️ c649e00 #1 2024-05-19 12:28:14 ~12 min android-e2e 🤖apk 📲
✔️ c649e00 #1 2024-05-19 12:28:30 ~12 min android 🤖apk 📲
d94af4a #2 2024-05-19 23:47:42 ~4 min tests 📄log
✔️ d94af4a #2 2024-05-19 23:51:22 ~8 min ios 📱ipa 📲
✔️ d94af4a #2 2024-05-19 23:54:48 ~12 min android-e2e 🤖apk 📲
✔️ d94af4a #2 2024-05-19 23:54:57 ~12 min android 🤖apk 📲
✔️ 17be57b #4 2024-05-20 10:08:50 ~4 min tests 📄log
✔️ 17be57b #4 2024-05-20 10:13:15 ~8 min ios 📱ipa 📲
✔️ 17be57b #4 2024-05-20 10:15:15 ~10 min android-e2e 🤖apk 📲
✔️ 17be57b #4 2024-05-20 10:15:21 ~10 min android 🤖apk 📲
✔️ 7bd7278 #5 2024-05-20 10:35:31 ~7 min tests 📄log
✔️ 7bd7278 #5 2024-05-20 10:37:14 ~8 min ios 📱ipa 📲
✔️ 7bd7278 #5 2024-05-20 10:40:56 ~12 min android-e2e 🤖apk 📲
✔️ 7bd7278 #5 2024-05-20 10:41:01 ~12 min android 🤖apk 📲
✔️ 6d88b52 #8 2024-05-20 22:36:29 ~3 min tests 📄log
✔️ 6d88b52 #8 2024-05-20 22:41:06 ~8 min ios 📱ipa 📲
✔️ 6d88b52 #8 2024-05-20 22:43:31 ~10 min android-e2e 🤖apk 📲
✔️ 6d88b52 #8 2024-05-20 22:43:35 ~10 min android 🤖apk 📲
✔️ c7cf202 #9 2024-05-22 08:48:42 ~6 min tests 📄log
✔️ c7cf202 #9 2024-05-22 08:51:09 ~9 min ios 📱ipa 📲
✔️ c7cf202 #9 2024-05-22 08:54:31 ~12 min android-e2e 🤖apk 📲
✔️ c7cf202 #9 2024-05-22 08:54:36 ~12 min android 🤖apk 📲
✔️ 2093d44 #10 2024-05-23 13:36:46 ~7 min tests 📄log
✔️ 2093d44 #10 2024-05-23 13:38:18 ~8 min ios 📱ipa 📲
✔️ 2093d44 #10 2024-05-23 13:42:21 ~12 min android-e2e 🤖apk 📲
✔️ 2093d44 #10 2024-05-23 13:42:28 ~12 min android 🤖apk 📲
✔️ c0f02be #11 2024-05-24 12:03:11 ~6 min tests 📄log
✔️ c0f02be #11 2024-05-24 12:06:17 ~10 min ios 📱ipa 📲
✔️ c0f02be #11 2024-05-24 12:09:02 ~12 min android-e2e 🤖apk 📲
✔️ c0f02be #11 2024-05-24 12:09:02 ~12 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 96c9eae #12 2024-05-27 11:24:41 ~4 min tests 📄log
✔️ 96c9eae #12 2024-05-27 11:30:33 ~10 min ios 📱ipa 📲
✔️ 96c9eae #12 2024-05-27 11:31:58 ~11 min android-e2e 🤖apk 📲
✔️ 96c9eae #12 2024-05-27 11:32:06 ~11 min android 🤖apk 📲
✔️ 823ff32 #14 2024-05-27 11:49:15 ~5 min tests 📄log
✔️ 823ff32 #14 2024-05-27 11:50:33 ~6 min android-e2e 🤖apk 📲
✔️ 823ff32 #14 2024-05-27 11:51:03 ~7 min android 🤖apk 📲
✔️ 823ff32 #14 2024-05-27 11:53:16 ~9 min ios 📱ipa 📲

@briansztamfater briansztamfater force-pushed the fix/bridge-not-supported-network branch 3 times, most recently from 7bf2970 to 17be57b Compare May 20, 2024 10:04
@briansztamfater briansztamfater marked this pull request as ready for review May 20, 2024 10:16
@briansztamfater briansztamfater changed the title [WIP] fix: non supported network warning is shown on the bridge flow fix: non supported network warning is shown on the bridge flow May 20, 2024
[quo/network-list
{:label (name network-name)
{:theme theme
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to pass theme this way. The provider does it.

The problem in that component is the schema was not updated to remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the solely purpose of adding this change was to remove schema errors. I'll remove this and update the schema then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep for sure, but just as an FYI passing theme as a prop will actually do nothing because the component gets it from the context provider.
you'll have to remove in the respective component test too 👍

token-networks (network-utils/network-list token networks)
token-networks-ids (mapv #(:chain-id %) token-networks)
token-networks-ids-set (set token-networks-ids)
token-available-on-network? (contains? token-networks-ids-set chain-id)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you really need token-networks, token-networks-ids, token-networks-ids-set?

seems like this should all be done in the sub for token-available-on-network? ??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or at least a util for that 🤔

Copy link
Member

@OmarBasem OmarBasem May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo the let binding should just include the minimal data needed by the view's props. Other data can be taken out to utils or subs

Also this can help with allowing us to write tests for the underlying logic that prepares the props

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, simplified the approach

@briansztamfater briansztamfater force-pushed the fix/bridge-not-supported-network branch from 17be57b to 7bd7278 Compare May 20, 2024 10:28
Comment on lines 230 to 233
token-not-supported-in-receiver-networks? (and (not= tx-type :tx/bridge)
(every? #(= (:type %) :not-available)
(filter #(not= (:type %) :add)
receiver-network-values)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that every and filter operation can be simplified with threading for readability. What do you think?

 token-not-supported-in-receiver-networks? (and (not= tx-type :tx/bridge)
                                                (->> receiver-network-values
                                                     (remove #(= (:type %) :add))
                                                     (every? #(= (:type %) :not-available))))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, updated!

@briansztamfater briansztamfater force-pushed the fix/bridge-not-supported-network branch 3 times, most recently from 5f258ca to 6d88b52 Compare May 20, 2024 22:32
@briansztamfater briansztamfater moved this from REVIEW to E2E Tests in Pipeline for QA May 20, 2024
@status-im-auto
Copy link
Member

83% of end-end tests have passed

Total executed tests: 52
Failed tests: 8
Expected to fail tests: 1
Passed tests: 43
IDs of failed tests: 727230,702809,702859,727231,727229,703202,702807,727232 
IDs of expected to fail tests: 703503 

Failed tests (8)

Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202

    Device 1: Find `Button` by `accessibility id`: `authors-for-reaction-5`
    Device 1: Tap on found: Button

    critical/chats/test_group_chat.py:211: in test_group_chat_reactions
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Incorrect reactions count for user admin after changing the reactions
    



    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807

    Device 2: Find Text by xpath: //*[starts-with(@text,'Hey, admin!')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_group_chat.py:95: in test_group_chat_join_send_text_messages_push
        self.chats[1].chat_element_by_text(message_to_admin).wait_for_status_to_be('Delivered', timeout=120)
    ../views/chat_view.py:225: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's Sent
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_one_image_send_reply, id: 702859

    Device 2: Find EmojisNumber by xpath: //*[starts-with(@text,'reply to image')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-1']/android.widget.TextView[2]
    Device 2: Element EmojisNumber text is equal to 1

    critical/chats/test_public_chat_browsing.py:503: in test_community_one_image_send_reply
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Reply message was not received by the sender
    E    Image message reaction is not shown for the sender
    



    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    # STEP: Getting ETH amount in the wallet of the sender before transaction
    Device 1: Find WalletTab by accessibility id: wallet-stack-tab

    critical/test_wallet.py:119: in test_wallet_send_asset_from_drawer
        sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
    critical/test_wallet.py:41: in _get_balances_before_tx
        self.wallet_1.wallet_tab.click()
    ../views/base_element.py:90: in click
        element = self.find_element()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: WalletTab by accessibility id: `wallet-stack-tab` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    2. test_wallet_send_eth, id: 727229

    Device 1: Swiping right on element SlideButton
    Device 1: Find SlideButton by xpath: //*[@resource-id='slide-button-track']

    critical/test_wallet.py:111: in test_wallet_send_eth
        self.wallet_1.send_asset(address=self.receiver['address'], asset_name='Ether', amount=amount_to_send)
    ../views/wallet_view.py:100: in send_asset
        self.confirm_transaction()
    ../views/wallet_view.py:87: in confirm_transaction
        self.slide_and_confirm_with_password()
    ../views/wallet_view.py:81: in slide_and_confirm_with_password
        self.slide_button_track.slide()
    ../views/base_view.py:257: in slide
        self.swipe_right_on_element(width_percentage=1.3, start_x=100)
    ../views/base_element.py:308: in swipe_right_on_element
        location, size = self.get_element_coordinates()
    ../views/base_element.py:294: in get_element_coordinates
        element = self.find_element()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: SlideButton by xpath: `//*[@resource-id='slide-button-track']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809

    Device 1: Looking for a message by text: quote reply (one row)
    Device 2: Looking for a message by text: quote reply (one row)

    critical/chats/test_public_chat_browsing.py:981: in test_community_markdown_support
        self.errors.verify_no_errors()
    base_test_case.py:190: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     italic text in underscore is not displayed with markdown in 1-1 chat for the recipient (device 2)
    



    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    Device 1: Find Button by accessibility id: account-emoji
    Device 1: Find Button by accessibility id: share-account

    critical/test_wallet.py:154: in test_wallet_add_remove_regular_account
        self.wallet_view.share_address_button.click()
    ../views/base_element.py:90: in click
        element = self.find_element()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `share-account` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    2. test_wallet_add_remove_watch_only_account, id: 727232

    Device 1: Could not reach wallet view by pressing system back button
    Device 1: Find Button by accessibility id: add-account

    critical/test_wallet.py:193: in test_wallet_add_remove_watch_only_account
        self.wallet_view.add_watch_only_account(address=address_to_watch, account_name=new_account_name)
    ../views/wallet_view.py:118: in add_watch_only_account
        self.add_account_button.click()
    ../views/base_element.py:90: in click
        element = self.find_element()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `add-account` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Expected to fail tests (1)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Passed tests (43)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_mute_chat, id: 703495
    Device sessions

    3. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    4. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    4. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    5. test_1_1_chat_edit_message, id: 702855
    Device sessions

    6. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    7. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    8. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    5. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    8. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    3. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    2. test_community_mentions_push_notification, id: 702786
    Device sessions

    3. test_community_leave, id: 702845
    Device sessions

    4. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    @mariia-skrypnyk mariia-skrypnyk moved this from E2E Tests to IN TESTING in Pipeline for QA May 21, 2024
    @mariia-skrypnyk mariia-skrypnyk self-assigned this May 22, 2024
    @mariia-skrypnyk mariia-skrypnyk force-pushed the fix/bridge-not-supported-network branch from 6d88b52 to c7cf202 Compare May 22, 2024 08:41
    @mariia-skrypnyk mariia-skrypnyk moved this from IN TESTING to E2E Tests in Pipeline for QA May 23, 2024
    @mariia-skrypnyk mariia-skrypnyk removed their assignment May 23, 2024
    @briansztamfater briansztamfater force-pushed the fix/bridge-not-supported-network branch 2 times, most recently from 2093d44 to c0f02be Compare May 24, 2024 11:55
    @qoqobolo qoqobolo moved this from E2E Tests to IN TESTING in Pipeline for QA May 24, 2024
    @qoqobolo qoqobolo self-assigned this May 24, 2024
    @qoqobolo
    Copy link
    Contributor

    Hey @briansztamfater, thanks for the fix!
    Could you take a look at the issue pls, I couldn't reproduce it in develop:

    ISSUE 1: Cursor disappears from the amount field when you start typing

    It appears again if you set the focus on the field by tapping it

    Steps:

    1. Go to Bridge
    2. Start typing in the amount field
    3. Pay attention to the cursor

    Actual result (PR):

    video_2024-05-24_15-51-57.mp4

    Expected result (nightly):

    kekkekeke.mp4

    @briansztamfater
    Copy link
    Member Author

    Hey @qoqobolo thanks for testing! Does that only happens on Android or also on iOS?

    @ulisesmac
    Copy link
    Contributor

    Hey @qoqobolo thanks for testing! Does that only happens on Android or also on iOS?

    @briansztamfater Should we open an issue instead? seems this input has been changed and now is having problems

    @briansztamfater
    Copy link
    Member Author

    briansztamfater commented May 24, 2024

    Actually, I was able to reproduce it on develop on iOS Simulator. I think this was introduced after merging #20099. Can you please check @qoqobolo?

    If it a new issue, yes, we should log it and work on it separately @ulisesmac cc @J-Son89

    @qoqobolo
    Copy link
    Contributor

    Actually, I was able to reproduce it on develop on iOS Simulator. I think this was introduced after merging #20099. Can you please check @qoqobolo?

    If it a new issue, yes, we should log it and work on it separately @ulisesmac cc @J-Son89

    @briansztamfater yep, I can see this issue now on today's nightly, will log it separately.
    Thanks for the fix, PR can be merged.

    @qoqobolo qoqobolo moved this from IN TESTING to MERGE in Pipeline for QA May 27, 2024
    @briansztamfater briansztamfater force-pushed the fix/bridge-not-supported-network branch 2 times, most recently from 96c9eae to 08dac03 Compare May 27, 2024 11:35
    Signed-off-by: Brian Sztamfater <brian@status.im>
    @briansztamfater briansztamfater force-pushed the fix/bridge-not-supported-network branch from 08dac03 to 823ff32 Compare May 27, 2024 11:43
    @briansztamfater briansztamfater merged commit 52aaee0 into develop May 27, 2024
    6 checks passed
    Pipeline for QA automation moved this from MERGE to DONE May 27, 2024
    @briansztamfater briansztamfater deleted the fix/bridge-not-supported-network branch May 27, 2024 11:55
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: DONE
    8 participants