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

[#20035] feat: import missing key pair by scanning QR code #20144

Merged
merged 4 commits into from
May 30, 2024

Conversation

mohsen-ghafouri
Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri commented May 22, 2024

fixes #20035

Summary

Implement the UI and UX flow inside the wallet settings for scanning a missing key pair's QR code.

Areas that maybe impacted

  • Import missing key pair by scan QR

Test note

To have a missing key pair on Device B, after you pair devices you can add new keypair on Device A and the on device B logout/login again. you will see missing keypair on device B

Steps to test

  • Have a paired device
  • Have a missing key pair on Device B
  • Open Wallet setting On Device B
  • Click on Import
  • Scan QR code of missing key pair on Device A

Result

2024-05-23.18.38.10.mp4

status: ready

@mohsen-ghafouri mohsen-ghafouri self-assigned this May 22, 2024
@status-github-bot status-github-bot bot added this to REVIEW in Pipeline for QA May 22, 2024
@status-im-auto
Copy link
Member

status-im-auto commented May 22, 2024

Jenkins Builds

Click to see older builds (64)
Commit #️⃣ Finished (UTC) Duration Platform Result
6932af2 #1 2024-05-22 10:38:54 ~2 min tests 📄log
✔️ 6932af2 #1 2024-05-22 10:42:46 ~6 min android 🤖apk 📲
✔️ 6932af2 #1 2024-05-22 10:42:51 ~6 min android-e2e 🤖apk 📲
✔️ 6932af2 #1 2024-05-22 10:45:12 ~8 min ios 📱ipa 📲
2c79af9 #2 2024-05-22 16:45:44 ~3 min tests 📄log
✔️ 2c79af9 #2 2024-05-22 16:48:35 ~6 min android-e2e 🤖apk 📲
✔️ 2c79af9 #2 2024-05-22 16:49:46 ~7 min android 🤖apk 📲
✔️ 2c79af9 #2 2024-05-22 16:51:01 ~8 min ios 📱ipa 📲
516d7e3 #3 2024-05-22 18:54:59 ~2 min tests 📄log
✔️ 516d7e3 #3 2024-05-22 19:00:42 ~8 min android-e2e 🤖apk 📲
✔️ 516d7e3 #3 2024-05-22 19:00:43 ~8 min android 🤖apk 📲
✔️ 516d7e3 #3 2024-05-22 19:00:53 ~8 min ios 📱ipa 📲
✔️ 45c446e #4 2024-05-22 19:06:15 ~4 min tests 📄log
✔️ 859a12b #6 2024-05-22 19:15:15 ~4 min tests 📄log
✔️ 859a12b #6 2024-05-22 19:17:18 ~6 min android-e2e 🤖apk 📲
✔️ 859a12b #6 2024-05-22 19:19:45 ~8 min android 🤖apk 📲
✔️ 859a12b #6 2024-05-22 19:19:46 ~8 min ios 📱ipa 📲
1ff4a34 #8 2024-05-23 15:41:40 ~2 min tests 📄log
✔️ 1ff4a34 #8 2024-05-23 15:46:11 ~7 min android-e2e 🤖apk 📲
✔️ 1ff4a34 #8 2024-05-23 15:46:21 ~7 min android 🤖apk 📲
✔️ 1ff4a34 #8 2024-05-23 15:47:17 ~8 min ios 📱ipa 📲
✔️ eb855e7 #9 2024-05-23 15:53:04 ~4 min tests 📄log
✔️ eb855e7 #9 2024-05-23 15:57:08 ~8 min android-e2e 🤖apk 📲
✔️ eb855e7 #9 2024-05-23 15:57:13 ~8 min android 🤖apk 📲
✔️ eb855e7 #9 2024-05-23 15:58:16 ~9 min ios 📱ipa 📲
✔️ 7a4c0cf #10 2024-05-28 10:55:45 ~5 min tests 📄log
✔️ 7a4c0cf #10 2024-05-28 10:56:42 ~5 min android-e2e 🤖apk 📲
✔️ 7a4c0cf #10 2024-05-28 10:59:25 ~8 min android 🤖apk 📲
✔️ 7a4c0cf #10 2024-05-28 10:59:35 ~8 min ios 📱ipa 📲
ae982ed #11 2024-05-28 21:51:45 ~2 min tests 📄log
✔️ ae982ed #11 2024-05-28 21:54:59 ~6 min android 🤖apk 📲
✔️ ae982ed #11 2024-05-28 21:55:56 ~7 min android-e2e 🤖apk 📲
✔️ ae982ed #11 2024-05-28 21:57:33 ~8 min ios 📱ipa 📲
10b649f #12 2024-05-28 22:04:03 ~2 min tests 📄log
✔️ 10b649f #12 2024-05-28 22:09:17 ~7 min android-e2e 🤖apk 📲
✔️ 10b649f #12 2024-05-28 22:09:19 ~7 min android 🤖apk 📲
✔️ 10b649f #12 2024-05-28 22:09:57 ~8 min ios 📱ipa 📲
✔️ 13cdc11 #13 2024-05-28 23:11:54 ~8 min android-e2e 🤖apk 📲
✔️ 13cdc11 #13 2024-05-28 23:11:58 ~8 min android 🤖apk 📲
✔️ 13cdc11 #13 2024-05-28 23:12:04 ~8 min ios 📱ipa 📲
efe5550 #14 2024-05-28 23:23:46 ~2 min tests 📄log
✔️ efe5550 #14 2024-05-28 23:28:58 ~7 min android-e2e 🤖apk 📲
✔️ efe5550 #14 2024-05-28 23:29:04 ~7 min android 🤖apk 📲
✔️ efe5550 #14 2024-05-28 23:30:19 ~9 min ios 📱ipa 📲
✔️ 3192cfb #15 2024-05-29 08:31:52 ~3 min tests 📄log
✔️ 3192cfb #15 2024-05-29 08:35:49 ~7 min android-e2e 🤖apk 📲
✔️ 3192cfb #15 2024-05-29 08:35:55 ~8 min android 🤖apk 📲
✔️ 3192cfb #15 2024-05-29 08:36:32 ~8 min ios 📱ipa 📲
✔️ 7b9cc07 #16 2024-05-29 17:01:20 ~4 min tests 📄log
✔️ 7b9cc07 #16 2024-05-29 17:04:21 ~7 min android-e2e 🤖apk 📲
✔️ 7b9cc07 #16 2024-05-29 17:04:24 ~7 min android 🤖apk 📲
✔️ 7b9cc07 #16 2024-05-29 17:08:57 ~11 min ios 📱ipa 📲
f6c38d0 #17 2024-05-29 20:45:10 ~4 min tests 📄log
✔️ f6c38d0 #17 2024-05-29 20:49:01 ~8 min android-e2e 🤖apk 📲
✔️ f6c38d0 #17 2024-05-29 20:49:01 ~8 min ios 📱ipa 📲
✔️ f6c38d0 #17 2024-05-29 20:49:05 ~8 min android 🤖apk 📲
✔️ ff4a73e #18 2024-05-30 09:25:55 ~3 min tests 📄log
✔️ ff4a73e #18 2024-05-30 09:28:59 ~7 min android-e2e 🤖apk 📲
✔️ ff4a73e #18 2024-05-30 09:29:57 ~8 min android 🤖apk 📲
✔️ ff4a73e #18 2024-05-30 09:31:20 ~9 min ios 📱ipa 📲
✔️ f76d0fd #19 2024-05-30 12:59:41 ~4 min tests 📄log
✔️ f76d0fd #19 2024-05-30 13:03:18 ~8 min android-e2e 🤖apk 📲
✔️ f76d0fd #19 2024-05-30 13:03:21 ~8 min ios 📱ipa 📲
✔️ f76d0fd #19 2024-05-30 13:03:25 ~8 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5d72f58 #20 2024-05-30 17:37:38 ~4 min tests 📄log
✔️ 5d72f58 #20 2024-05-30 17:40:26 ~7 min android 🤖apk 📲
✔️ 5d72f58 #20 2024-05-30 17:40:46 ~7 min android-e2e 🤖apk 📲
✔️ 5d72f58 #20 2024-05-30 17:42:39 ~9 min ios 📱ipa 📲
✔️ d08fede #21 2024-05-30 18:48:00 ~5 min tests 📄log
✔️ d08fede #21 2024-05-30 18:51:22 ~8 min android-e2e 🤖apk 📲
✔️ d08fede #21 2024-05-30 18:51:25 ~8 min ios 📱ipa 📲
✔️ d08fede #21 2024-05-30 18:52:21 ~9 min android 🤖apk 📲

@mohsen-ghafouri mohsen-ghafouri force-pushed the feat/import-missing-keypair branch 8 times, most recently from 1ff4a34 to eb855e7 Compare May 23, 2024 15:48
@mohsen-ghafouri mohsen-ghafouri marked this pull request as ready for review May 23, 2024 15:48
Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

Hey @mohsen-ghafouri. Thanks for adding me as a reviewer. I did a longer review this time.

Event or effect?

Events should be pure and return a map of effects or nil. Side-effects should not happen (our known exception is logging, which we think is acceptable). So for instance, the event :wallet/connection-string-for-key-pair-import doesn't return a map. Actually, the results happen inside the callback input-connection-string-for-importing-keypairs-keystores-callback. This tells us the entire event should be a re-frame effect instead and moved with it should go the function input-connection-string-for-importing-keypairs-keystores-callback.

Test coverage

We have a soft, but I'd say strong enough agreement across teams that non-trivial code, especially outside UI namespaces should be unit tested. This is the top recommendation from the re-frame author as well. That's one of the main goals of the re-frame architecture, to build a highly testable system composed mostly of pure functions (and pure functions are cheap to test). But not all events need to be tested, if we can at least test the ones with more conditionals, data processing, etc that's good. Events that just dispatch a JSON RPC call without doing much else may not need a test.

Please, don't take the current quality of the code as a standard. We started to test more events not long ago.

Just last week we had a thread about test coverage and the lack of tests in events resurfaces all the time. I think we could be more clear about quality in our docs. Something that I take as an action item, but of course anyone can do.

A few reasons why testing is important (generally speaking):

  • When untested code is merged, we make a disservice to the next developer in a future PR that will need to retest things manually if they change something.
  • We can be faster without tests in some cases (questionable), but the next developer might be slower, and the next one, and so on because the cost of not having tests is there "forever".
  • Untested code creates a negative incentive for other devs to refactor code because they will need to have the motivation, plus deal with a higher risk of regressions. This is especially important in a repository like ours with thousands of lines of code being churned all the time.
  • We rely too much on manual QA and manual dev-QA, but lots of branches and permutations of the code in this namespace (to give one example) can't be easily tested manually. It's also not a given that unit tests will cover them. For that we need to go beyond happy path tests and cover more or all of the permutations if we can (e.g. every if requires two assertions at least and permutations can grow exponentially). The events in this PR have a few conditions to test, so having only a happy path test per event won't cover much.
  • Without tests, as a reviewer, I can't easily recommend refactors. Many times I have to checkout the branch, capture real data, then armed with that understanding I can suggest improvements. This is expensive and me and others won't do as often as we could. The lack of example data creates a negative incentive to do higher quality reviews.
  • Without tests I have to approve the code by a leap of faith on the author and that QAs might catch potential problems, which, very often, is unrealistic to assume.

cc'ing @J-Son89 @vkjr so we can more easily spread the word

src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
@mohsen-ghafouri
Copy link
Contributor Author

Hey @ilmotta, Thank you for your invaluable feedbacks. I completely agree about the importance of tests. I’ll make sure to add sufficient integration and unit tests.

Copy link
Member

@seanstrom seanstrom left a comment

Choose a reason for hiding this comment

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

Looking good ✨
Left some comments about some potential refactors and small tweaks.
Lmk what you think 🙏

src/quo/components/wallet/missing_keypairs/view.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/status_im/contexts/settings/wallet/events.cljs Outdated Show resolved Hide resolved
src/native_module/core.cljs Outdated Show resolved Hide resolved
@mohsen-ghafouri mohsen-ghafouri force-pushed the feat/import-missing-keypair branch 6 times, most recently from efe5550 to 3192cfb Compare May 29, 2024 08:27
@mohsen-ghafouri
Copy link
Contributor Author

Hello @seanstrom @ilmotta Would you mind giving my PR another review? 🙌🏻

Copy link
Member

@seanstrom seanstrom left a comment

Choose a reason for hiding this comment

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

Looks good ✅
Thank you @mohsen-ghafouri 🙌

@status-im-auto
Copy link
Member

80% of end-end tests have passed

Total executed tests: 51
Failed tests: 6
Expected to fail tests: 4
Passed tests: 41
Not executed tests: 1
IDs of not executed tests: 702936 
IDs of failed tests: 727230,702948,702894,727229,702808,703629 
IDs of expected to fail tests: 703495,703503,702807,727232 

Not executed tests (1)

Click to expand
  • Rerun not executed tests
  • Failed tests (6)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'#cats')]`
    Device 2: Looking for a message by text: it is just a message text

    critical/chats/test_public_chat_browsing.py:1098: in test_community_hashtag_links_to_community_channels
        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))]))
     Message in community channel is not visible for user before join
    



    Device sessions

    2. test_community_join_when_node_owner_offline, id: 703629

    Device 2: Tap on found: Button
    Device 2: Looking for community: 'open community'

    critical/chats/test_public_chat_browsing.py:1184: in test_community_join_when_node_owner_offline
        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))]))
     not
    E    Joined status is not displayed
    E    open community is not listed inside Joined communities tab
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:326: in test_group_chat_offline_pn
        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))]))
     Messages PN was not fetched from offline
    E    message from old member if not shown for device 0
    E    message from new member if not shown for device 0
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894

    # STEP: Block user
    Device 1: Looking for a message by text: I should not be in chat

    critical/chats/test_public_chat_browsing.py:660: in test_community_contact_block_unblock_offline
        self.channel_1.chat_element_by_text(message_to_disappear).wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatElementByText by xpath:`//*[starts-with(@text,'I should not be in chat')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element
    



    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:120: 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
    



    Expected to fail tests (4)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495

    # STEP: Change device time so chat will be unmuted by timer
    Device 2: Long press on ChatElement

    critical/chats/test_group_chat.py:466: in test_group_chat_mute_chat
        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))]))
     Chat is still muted after timeout 
    

    [[Chat is not unmuted after expected time: https://github.com//issues/19627]]

    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:97: 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 
    

    [[Issue with a message status - Sent instead of Delivered, https://github.com//issues/20126]]

    Device sessions

    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]]

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_watch_only_account, id: 727232

    Device 1: Text is 0x8d2413447ff297d30bdc475f6d5cb00254685aae
    Device 1: Click system back button

    critical/test_wallet.py:214: in test_wallet_add_remove_watch_only_account
        self.home_view.driver.fail(
    base_test_case.py:178: in fail
        pytest.fail('Device %s: %s' % (self.number, text))
     Device 1: Incorrect address '0x8d2413447ff297d30bdc475f6d5cb00254685aae' is shown when swiping between accounts, expected one is '0x8d2413447ff297d30bdc475f6d5cb00254685aae' 
    

    [[Missing networks in account address, https://github.com//issues/20166]]

    Device sessions

    Passed tests (41)

    Click to expand

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_mark_all_messages_as_read, id: 703086
    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 TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    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_markdown_support, id: 702809
    Device sessions

    2. test_community_mentions_push_notification, id: 702786
    Device sessions

    3. test_community_leave, id: 702845
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    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 TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    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 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 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

    @mohsen-ghafouri
    Copy link
    Contributor Author

    @status-im/mobile-qa could you please check results? skiped manual QA as it's behind the feature flag

    [utils.security.core :as security]
    [utils.transforms :as transforms]))

    (rf/reg-fx :effects.connection-string/export-keypair
    Copy link
    Member

    Choose a reason for hiding this comment

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

    I'm not sure about having effects as a prefix.

    Additionally, these functions are part of sync/local-pairing features (connection-string is an arg), I would suggest naming them as syncing.effects/export-keypairs-keystores and syncing.effects/import-keypairs-keystores. WDYT?

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    @smohamedjavid, the prefix :effects is the convention nowadays. We can change in the future of course. Some effects are not yet following this convention, but most are.

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Right, my bad.

    I guess in that case effects.syncing/export-keypairs-keystores and effects.syncing/import-keypairs-keystores would be a good choice

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    I will rename it in my next PR related to import single missing keypair.

    src/status_im/contexts/settings/wallet/effects.cljs Outdated Show resolved Hide resolved
    src/status_im/contexts/settings/wallet/effects.cljs Outdated Show resolved Hide resolved
    connection-string
    config-map)
    (promesa/then (fn [res]
    (if-let [error (when (syncing-events/extract-error res)
    Copy link
    Member

    Choose a reason for hiding this comment

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

    if I'm not mistaken, this error extraction is already part of promesa:

    (defn- promisify-callback
    [res rej]
    (fn [result]
    (let [native-error (let [{:keys [error]} (types/json->clj result)]
    (when-not (string/blank? error)
    error))]
    (if native-error
    (rej (ex-info "Native module call error" {:error native-error}))
    (res result)))))
    (defn promisify-native-module-call
    [f & args]
    (promesa/create
    (fn [res rej]
    (->> [(promisify-callback res rej)]
    (concat args)
    (apply f)))))

    We can skip this whole check

    Copy link
    Member

    Choose a reason for hiding this comment

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

    cc @clauxx

    src/status_im/contexts/settings/wallet/effects.cljs Outdated Show resolved Hide resolved
    Copy link
    Member

    @smohamedjavid smohamedjavid left a comment

    Choose a reason for hiding this comment

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

    Nice work! 🚀 @mohsen-ghafouri 🙌

    @VolodLytvynenko
    Copy link
    Contributor

    Hi @mohsen-ghafouri. Thank you for the PR. I noticed a new commit (f6c38d0) added after running the e2e tests. Is this a rebase or new fixes? Also, I'm unsure about test case 702894; it seems like a delivery issue. I've rerun this case one more time

    @mohsen-ghafouri
    Copy link
    Contributor Author

    Hi @VolodLytvynenko, sry just some new feedbacks appears after I asked QA to check the result and have to resolve them. thanks

    @status-im-auto
    Copy link
    Member

    100% of end-end tests have passed

    Total executed tests: 1
    Failed tests: 0
    Expected to fail tests: 0
    Passed tests: 1
    

    Passed tests (1)

    Click to expand

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    @VolodLytvynenko VolodLytvynenko moved this from E2E Tests to IN TESTING in Pipeline for QA May 30, 2024
    @VolodLytvynenko VolodLytvynenko moved this from IN TESTING to E2E Tests in Pipeline for QA May 30, 2024
    @status-im-auto
    Copy link
    Member

    86% of end-end tests have passed

    Total executed tests: 51
    Failed tests: 3
    Expected to fail tests: 4
    Passed tests: 44
    Not executed tests: 1
    
    IDs of not executed tests: 702936 
    
    IDs of failed tests: 727230,727229,702958 
    
    IDs of expected to fail tests: 703495,703503,702807,727232 
    

    Not executed tests (1)

    Click to expand
  • Rerun not executed tests
  • Failed tests (3)

    Click to expand
  • Rerun failed tests

  • Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958

    Device 1: Tap on found: Button
    # STEP: Checking that community appeared on the list

    activity_center/test_activity_center.py:498: in test_activity_center_admin_notification_accept_swipe
        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))]))
     Community is not appeared in the list after accepting admin request from activity centre
    



    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:120: 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
    



    Expected to fail tests (4)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_watch_only_account, id: 727232

    Device 1: Text is 0x8d2413447ff297d30bdc475f6d5cb00254685aae
    Device 1: Click system back button

    critical/test_wallet.py:214: in test_wallet_add_remove_watch_only_account
        self.home_view.driver.fail(
    base_test_case.py:178: in fail
        pytest.fail('Device %s: %s' % (self.number, text))
     Device 1: Incorrect address '0x8d2413447ff297d30bdc475f6d5cb00254685aae' is shown when swiping between accounts, expected one is '0x8d2413447ff297d30bdc475f6d5cb00254685aae' 
    

    [[Missing networks in account address, https://github.com//issues/20166]]

    Device sessions

    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]]

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495

    # STEP: Change device time so chat will be unmuted by timer
    Device 2: Long press on ChatElement

    critical/chats/test_group_chat.py:466: in test_group_chat_mute_chat
        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))]))
     Chat is still muted after timeout 
    

    [[Chat is not unmuted after expected time: https://github.com//issues/19627]]

    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:97: 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 
    

    [[Issue with a message status - Sent instead of Delivered, https://github.com//issues/20126]]

    Device sessions

    Passed tests (44)

    Click to expand

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    4. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    5. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    6. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    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 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

    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 TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    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 TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    @mohsen-ghafouri
    Copy link
    Contributor Author

    @VolodLytvynenko I just rebased, if all good please let me know. thanks

    @VolodLytvynenko
    Copy link
    Contributor

    @mohsen-ghafouri sorry for delay. The e2e results are reviewed, the failed tests are not related to the PR.
    PR can proceed to the next stage.

    @VolodLytvynenko VolodLytvynenko moved this from E2E Tests to MERGE in Pipeline for QA May 30, 2024
    @mohsen-ghafouri mohsen-ghafouri merged commit e04c7f4 into develop May 30, 2024
    6 checks passed
    Pipeline for QA automation moved this from MERGE to DONE May 30, 2024
    @mohsen-ghafouri mohsen-ghafouri deleted the feat/import-missing-keypair branch May 30, 2024 19:07
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: DONE
    Development

    Successfully merging this pull request may close these issues.

    Import all missing key pairs by scanning QR code when inside wallet settings
    8 participants