status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.91k stars 984 forks source link

[#21439] fix: close swap flow after confirmation #21466

Closed mohsen-ghafouri closed 1 month ago

mohsen-ghafouri commented 1 month ago

fixes #21439

Summary

Swap confirmation page remains open after transaction confirmation if swap flow starts from asset long tapping

Areas that maybe impacted

Steps to test

  1. Recover user with available assets to be swapped
  2. Go to wallet main page or open any wallet account
  3. Long tap the asset -> swap
  4. Perform swap transaction

Result

https://github.com/user-attachments/assets/703e6009-5f46-4ca8-a816-a8a60d24ccb6

status: ready

status-im-auto commented 1 month ago

Jenkins Builds

Click to see older builds (8) | :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| | :heavy_check_mark: | ff15f4c4 | [#1](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21466/1/) | 2024-10-18 15:32:31 | ~4 min | `tests` | [:page_facing_up:`log`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241018-152742-ff15f4-pr21466-tests.log) | | :heavy_check_mark: | ff15f4c4 | [#1](https://ci.status.im/job/status-mobile/job/prs/job/android/job/PR-21466/1/) | 2024-10-18 15:34:54 | ~7 min | `android` | [:robot:`apk`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241018-152742-ff15f4-pr21466-arm64-v8a.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fstatus-im-mobile-prs.ams3.cdn.digitaloceanspaces.com%2FStatusIm-Mobile-241018-152742-ff15f4-pr21466-arm64-v8a.apk)| | :heavy_check_mark: | ff15f4c4 | [#1](https://ci.status.im/job/status-mobile/job/prs/job/android-e2e/job/PR-21466/1/) | 2024-10-18 15:35:31 | ~7 min | `android-e2e` | [:robot:`apk`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241018-152737-ff15f4-pr21466-x86_64.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fstatus-im-mobile-prs.ams3.cdn.digitaloceanspaces.com%2FStatusIm-Mobile-241018-152737-ff15f4-pr21466-x86_64.apk)| | :heavy_check_mark: | ff15f4c4 | [#1](https://ci.status.im/job/status-mobile/job/prs/job/ios/job/PR-21466/1/) | 2024-10-18 15:37:42 | ~9 min | `ios` | [:iphone:`ipa`](https://i.diawi.com/9XrHbs) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fi.diawi.com%2F9XrHbs)| | | | | | | | | | :heavy_check_mark: | 858d91e3 | [#2](https://ci.status.im/job/status-mobile/job/prs/job/tests/job/PR-21466/2/) | 2024-10-18 16:22:32 | ~4 min | `tests` | [:page_facing_up:`log`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241018-161806-858d91-pr21466-tests.log) | | :heavy_check_mark: | 858d91e3 | [#2](https://ci.status.im/job/status-mobile/job/prs/job/android/job/PR-21466/2/) | 2024-10-18 16:25:00 | ~6 min | `android` | [:robot:`apk`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241018-161806-858d91-pr21466-arm64-v8a.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fstatus-im-mobile-prs.ams3.cdn.digitaloceanspaces.com%2FStatusIm-Mobile-241018-161806-858d91-pr21466-arm64-v8a.apk)| | :heavy_check_mark: | 858d91e3 | [#2](https://ci.status.im/job/status-mobile/job/prs/job/android-e2e/job/PR-21466/2/) | 2024-10-18 16:25:30 | ~7 min | `android-e2e` | [:robot:`apk`](https://status-im-mobile-prs.ams3.cdn.digitaloceanspaces.com/StatusIm-Mobile-241018-161802-858d91-pr21466-x86_64.apk) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fstatus-im-mobile-prs.ams3.cdn.digitaloceanspaces.com%2FStatusIm-Mobile-241018-161802-858d91-pr21466-x86_64.apk)| | :heavy_check_mark: | 858d91e3 | [#2](https://ci.status.im/job/status-mobile/job/prs/job/ios/job/PR-21466/2/) | 2024-10-18 16:27:54 | ~9 min | `ios` | [:iphone:`ipa`](https://i.diawi.com/DWAACx) [:calling:](https://chart.apis.google.com/chart?cht=qr&chs=400x400&chld=L%7C%0A1&chl=https%3A%2F%2Fi.diawi.com%2FDWAACx)|
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: ce6795a0 #6 2024-10-22 18:14:08 ~4 min tests :page_facing_up:log
:heavy_check_mark: ce6795a0 #6 2024-10-22 18:18:14 ~9 min android-e2e :robot:apk :calling:
:heavy_check_mark: ce6795a0 #6 2024-10-22 18:18:44 ~9 min android :robot:apk :calling:
:heavy_check_mark: ce6795a0 #6 2024-10-22 18:19:14 ~10 min ios :iphone:ipa :calling:
:heavy_check_mark: 73a44278 #7 2024-10-23 14:34:20 ~4 min tests :page_facing_up:log
:heavy_check_mark: 73a44278 #7 2024-10-23 14:37:41 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: 73a44278 #7 2024-10-23 14:39:15 ~9 min android :robot:apk :calling:
:heavy_check_mark: 73a44278 #7 2024-10-23 14:41:27 ~11 min ios :iphone:ipa :calling:
status-im-auto commented 1 month ago

75% of end-end tests have passed

Total executed tests: 8
Failed tests: 2
Expected to fail tests: 0
Passed tests: 6
IDs of failed tests: 740490,702843 

Failed tests (2)

Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]`
    Device 2: Wait for element `Button` for max 120s and click when it is available

    ``` Test setup failed: critical/chats/test_public_chat_browsing.py:350: in prepare_devices self.community_2.join_community() ../views/chat_view.py:420: in join_community self.join_button.wait_and_click(120) ../views/base_element.py:100: in wait_and_click self.wait_for_visibility_of_element(sec) ../views/base_element.py:147: in wait_for_visibility_of_element raise TimeoutException( Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element ```

    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_balance_mainnet, id: 740490

    Device 1: Find `Button` by `accessibility id`: `network-dropdown`
    Device 1: Tap on found: Button

    ``` critical/test_wallet.py:249: in test_wallet_balance_mainnet self.errors.verify_no_errors() base_test_case.py:192: in verify_no_errors pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))])) For the Ether the wrong value 0.0051 is shown, expected 0.0052 in total E For the Uniswap the wrong value 0.127 is shown, expected 0.627 in total E For the Ether the wrong value 0.0 is shown, expected 0.0001 on Arbitrum E For the Uniswap the wrong value 0.0 is shown, expected 0.5 on Arbitrum ```

    Passed tests (6)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    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

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229
    Horupa-Olena commented 1 month ago

    @mohsen-ghafouri Thanks for your PR.

    Can you please check whether the following issue is related to the PR or not?

    ISSUE 1: Wallet buttons become unresponsive after confirming a swap initiated from the long-tap menu

    Steps:

    1. Recover user with available assets to be swapped
    2. Go to wallet main page or open any wallet account
    3. Long tap the asset -> swap
    4. Perform swap transaction
    5. After the confirmation, attempt to click the following buttons in the wallet interface: Send, Receive, Swap, Bridge,
    6. Return to main wallet screen and try to click on Profile, Notifications, Scan, and Share buttons.

    Expected Result: All wallet buttons should remain functional after confirming a swap, and clicking them should initiate the appropriate actions.

    Actual Result: Certain buttons in the wallet become unresponsive after confirming the swap. Clicking them does not trigger any actions. IMG_0017 IMG_0018

    Additional Information:

    1. The issue occurs only when using the long-tap menu to initiate the swap.
    2. Restarting the app restores button functionality.
    briansztamfater commented 1 month ago

    I think the real issue is that when long-taping the screen is not opened as a modal. That's why :dismiss-modal is not working in this case.

    https://github.com/status-im/status-mobile/blob/6a26ebafa3ba386fca896131e2a8ad07e4c2362e/src/status_im/contexts/wallet/swap/events.cljs#L38

    I think just changing this line to [:open-modal :screen/wallet.setup-swap] should fix the issue.

    smohamedjavid commented 1 month ago

    @briansztamfater - Since Mohsen is off this week. Could we make this quick update/fix to this PR and include it in 2.31? It seems a bit of an important fix for Swaps. WDYT?

    cc @shivekkhurana

    briansztamfater commented 1 month ago

    @smohamedjavid We can do it. Let me know if you'd prefer to push the changes yourself, or I can do it as well. I'm sure @mohsen-ghafouri won't mind!

    smohamedjavid commented 1 month ago

    Great. Feel free to push the changes as you are more familiar with the swap part 👍

    briansztamfater commented 1 month ago

    @smohamedjavid @mohsen-ghafouri just pushed the changes :)

    @Horupa-Olena feel free to retest and let me know the results :)

    Horupa-Olena commented 1 month ago

    @briansztamfater Thanks for your fixes! All looks good, you can merge this PR!

    mohsen-ghafouri commented 1 month ago

    Hello , sorry i couldn't manage to finish it on time. Thank you for handling it, much appreciate it 🙏 @briansztamfater @smohamedjavid @Horupa-Olena