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

Wallet - refresh activity after sending a transaction #19984

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

J-Son89
Copy link
Member

@J-Son89 J-Son89 commented May 10, 2024

fixes: #19981, #19519

This pr does a few things

  • corrects the navigation for MVP, i.e after confirming a transaction it goes directly to account view and shows the activity tab

  • refreshes activity after sending a transaction

  • this in turn refreshes the recent transactions tab in the select address page of sending flows.

  • to make this work I had to update the tabs component to be controllable, as such we should check other pages with tabs are working alright.

Screen.Recording.2024-05-10.at.18.28.24.mov

@status-im-auto
Copy link
Member

status-im-auto commented May 10, 2024

Jenkins Builds

Click to see older builds (32)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7904672 #1 2024-05-10 17:42:11 ~4 min tests 📄log
✔️ 7904672 #1 2024-05-10 17:47:04 ~9 min ios 📱ipa 📲
✔️ 7904672 #1 2024-05-10 17:47:54 ~10 min android-e2e 🤖apk 📲
✔️ 7904672 #1 2024-05-10 17:48:03 ~10 min android 🤖apk 📲
4ba54ed #2 2024-05-15 07:46:50 ~2 min tests 📄log
✔️ 4ba54ed #2 2024-05-15 07:52:17 ~8 min android-e2e 🤖apk 📲
✔️ 4ba54ed #2 2024-05-15 07:52:20 ~8 min android 🤖apk 📲
✔️ 4ba54ed #2 2024-05-15 07:53:40 ~9 min ios 📱ipa 📲
82bc6d5 #4 2024-05-21 00:14:23 ~2 min tests 📄log
✔️ 82bc6d5 #4 2024-05-21 00:18:31 ~6 min android-e2e 🤖apk 📲
✔️ 82bc6d5 #4 2024-05-21 00:21:25 ~9 min ios 📱ipa 📲
✔️ 82bc6d5 #4 2024-05-21 00:21:50 ~10 min android 🤖apk 📲
c98c966 #5 2024-05-21 13:03:00 ~4 min tests 📄log
✔️ c98c966 #5 2024-05-21 13:08:23 ~9 min android 🤖apk 📲
✔️ c98c966 #5 2024-05-21 13:08:28 ~9 min android-e2e 🤖apk 📲
✔️ c98c966 #5 2024-05-21 13:09:11 ~10 min ios 📱ipa 📲
✔️ 8d1934c #6 2024-05-21 17:32:24 ~9 min ios 📱ipa 📲
✔️ 8d1934c #6 2024-05-21 17:33:35 ~10 min android 🤖apk 📲
✔️ 8d1934c #6 2024-05-21 17:33:35 ~10 min android-e2e 🤖apk 📲
✔️ 8d1934c #7 2024-05-21 18:13:01 ~3 min tests 📄log
✔️ 21e527a #8 2024-05-23 21:00:00 ~3 min tests 📄log
✔️ 21e527a #7 2024-05-23 21:05:48 ~9 min ios 📱ipa 📲
✔️ 21e527a #7 2024-05-23 21:06:52 ~10 min android-e2e 🤖apk 📲
✔️ 21e527a #7 2024-05-23 21:07:00 ~10 min android 🤖apk 📲
✔️ d503f86 #9 2024-05-23 22:37:37 ~3 min tests 📄log
✔️ d503f86 #8 2024-05-23 22:43:13 ~9 min ios 📱ipa 📲
✔️ d503f86 #8 2024-05-23 22:44:31 ~10 min android-e2e 🤖apk 📲
✔️ d503f86 #8 2024-05-23 22:44:33 ~10 min android 🤖apk 📲
✔️ 6a88d9e #9 2024-05-27 11:17:44 ~6 min android-e2e 🤖apk 📲
✔️ 6a88d9e #10 2024-05-27 11:19:07 ~7 min tests 📄log
✔️ 6a88d9e #9 2024-05-27 11:21:40 ~10 min ios 📱ipa 📲
✔️ 6a88d9e #9 2024-05-27 11:24:26 ~12 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f6d134d #11 2024-05-28 11:18:13 ~4 min tests 📄log
✔️ f6d134d #10 2024-05-28 11:24:14 ~10 min android-e2e 🤖apk 📲
✔️ f6d134d #10 2024-05-28 11:24:27 ~10 min android 🤖apk 📲
✔️ f6d134d #10 2024-05-28 11:24:47 ~11 min ios 📱ipa 📲
✔️ 812a590 #12 2024-06-05 22:44:32 ~4 min tests 📄log
✔️ 812a590 #11 2024-06-05 22:48:27 ~8 min android 🤖apk 📲
✔️ 812a590 #11 2024-06-05 22:48:31 ~8 min android-e2e 🤖apk 📲
✔️ 812a590 #11 2024-06-05 22:50:37 ~10 min ios 📱ipa 📲

@J-Son89 J-Son89 force-pushed the jc/refresh-activity-after-send branch from 7904672 to 4ba54ed Compare May 15, 2024 07:43
@J-Son89 J-Son89 force-pushed the jc/refresh-activity-after-send branch from 4ba54ed to e7c911f Compare May 21, 2024 00:10
@J-Son89 J-Son89 marked this pull request as ready for review May 21, 2024 12:58
@J-Son89 J-Son89 force-pushed the jc/refresh-activity-after-send branch from c98c966 to 8d1934c Compare May 21, 2024 17:22
- `scroll-on-press?` When non-nil, clicking on a tag centers it the middle
(with animation enabled).
"
(defn view-internal
Copy link
Member Author

Choose a reason for hiding this comment

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

added a malli schema and removed doc string

Copy link
Member

Choose a reason for hiding this comment

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

defn- view-internal

[{:keys [default-active data fade-end-percentage fade-end? on-change on-scroll scroll-on-press?
scrollable? style container-style size blur? in-scroll-view? customization-color]
scrollable? style container-style size blur? in-scroll-view? customization-color
active-tab-id]
Copy link
Member Author

Choose a reason for hiding this comment

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

tabs component now is controllable from outside with a prop for value.

:customization-color customization-color
:label (i18n/label :t/jump-to)}}
style/shell-button]]))))
(let [selected-tab (or (rf/sub [:wallet/account-tab]) first-tab-id)
Copy link
Member Author

Choose a reason for hiding this comment

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

selected tab is stored in the reframe db so we can go to the right tab after certain actions (e.g complete transaction)

- `scroll-on-press?` When non-nil, clicking on a tag centers it the middle
(with animation enabled).
"
(defn view-internal
Copy link
Member

Choose a reason for hiding this comment

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

defn- view-internal

Comment on lines -413 to +451
[:wallet/wizard-navigate-forward
{:current-screen :screen/wallet.transaction-confirmation
:flow-id :wallet-send-flow}]]]})))
[:wallet/end-transaction-flow]]]})))
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we update the flow_config of bridge and send?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes good point, I'll double check that. I see you had it in the similar pr so will check with that too 🙏

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.

LGTM 🚀

@@ -0,0 +1,32 @@
(ns quo.components.tabs.tabs.schema)

(def ^:private ?data-schema
Copy link
Contributor

Choose a reason for hiding this comment

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

The question mark prefix should be enough to tell ?data is a schema.

:default-active first-tab-id
:active-tab-id selected-tab
:data (tabs-data watch-only?)
:on-change #(rf/dispatch [:wallet/select-account-tab %])
Copy link
Contributor

Choose a reason for hiding this comment

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

The handler can be extracted to a var because it doesn't close over values.

@@ -52,6 +56,7 @@
(rf/reg-event-fx :wallet/close-account-page
(fn [_]
{:fx [[:dispatch [:wallet/clean-current-viewing-account]]
[:dispatch [:wallet/select-account-tab nil]]
Copy link
Contributor

Choose a reason for hiding this comment

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

A minor suggestion, but I'd have a separate event to deselect the account tab instead of relying on nil.

(rf/reg-event-fx :wallet/deselect-account-tab
 (fn [{:keys [db]} _]
   {:db (update-in db [:wallet :ui :account-page] dissoc :active-tab)}))

Copy link
Member Author

Choose a reason for hiding this comment

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

done

[:sequential
[:maybe
[:map
[:id [:maybe :keyword]]
Copy link
Contributor

Choose a reason for hiding this comment

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

About the :maybe here, wouldn't it be a bug to have a tab item without an ID? Seems really odd to rely on a nil ID, but maybe that's how it already is and the schema is just explicitly telling us now this oddity?

[:catn
[:props
[:map
[:default-active {:optional true} [:maybe :keyword]]
Copy link
Contributor

Choose a reason for hiding this comment

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

When opening the AC, the schema fails because we pass :default-active as a number, not as a keyword.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot about AC, will update

@J-Son89 J-Son89 force-pushed the jc/refresh-activity-after-send branch 2 times, most recently from 21e527a to d503f86 Compare May 23, 2024 22:33
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.

PR LGTM! And thanks for adding schemas to the complex tabs component 👏🏼

@J-Son89 J-Son89 force-pushed the jc/refresh-activity-after-send branch from d503f86 to 6a88d9e Compare May 27, 2024 11:11
@J-Son89 J-Son89 moved this from REVIEW to E2E Tests in Pipeline for QA May 27, 2024
@status-im-auto
Copy link
Member

85% of end-end tests have passed

Total executed tests: 52
Failed tests: 5
Expected to fail tests: 3
Passed tests: 44
IDs of failed tests: 727230,702733,702783,727229,727232 
IDs of expected to fail tests: 703495,703503,702807 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    critical/test_wallet.py:119: in test_wallet_send_asset_from_drawer
        self.wallet_view.navigate_back_to_wallet_view()
     'TestWalletMultipleDevice' object has no attribute 'wallet_view'
    



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

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Tap on found: Button
    Device 1: Getting PN by 'DELETE ME'

    critical/chats/test_1_1_public_chats.py:520: in test_1_1_chat_text_message_delete_push_disappear
        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 status was not changed to 'Delivered' after 60 s
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

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

    critical/chats/test_1_1_public_chats.py:614: in test_1_1_chat_is_shown_message_sent_delivered_from_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))]))
     Message status was not changed to Delivered, it's Sent after back up online!
    



    Device sessions

    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:213: 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'
    



    Device sessions

    Expected to fail tests (3)

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

    Passed tests (44)

    Click to expand

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

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

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_edit_message, id: 702855
    Device sessions

    5. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    6. test_1_1_chat_pin_messages, id: 702731
    Device sessions

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

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

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

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    @VolodLytvynenko VolodLytvynenko self-assigned this May 28, 2024
    @VolodLytvynenko VolodLytvynenko moved this from E2E Tests to IN TESTING in Pipeline for QA May 28, 2024
    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented May 28, 2024

    hi @J-Son89 thank you for PR. Take a look at found issue

    PR_ISSUE 1: "Invalid argument 2: json can't unmarshal.." error is shown after transaction confirmation when a universal scanner is used

    Description:

    After confirming a transaction, an error toast "Invalid argument 2: json can't unmarshal.." is displayed when the universal scanner is used during sending flow. Additionally, the user is navigated to the main wallet page instead of the activity tab. However, the transaction is actually confirmed successfully, and there is no issue with the transaction itself.

    Steps:

    1. Go to the main wallet page
    2. Scan wallet QR of the receiver user using universal scanner
    3. Confirm the transaction

    Actual result:

    • "Invalid argument 2: json can't unmarshal.." toast with error is shown
    • user is navigated to main wallet page instead of activity tab

    image

    Expected result:

    • No error toast is shown
    • user is navigated to activity tab

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro max

    Logs

    Status-debug-logs.zip

    @VolodLytvynenko
    Copy link
    Contributor

    PR_ISSUE 2: Confirmation page remains stuck when attempting to send a collectible

    Steps:

    1. Open any collectible (ERC721 or ERC1155) on the wallet main page.
    2. Tap the 'send' button.
    3. Confirm the transaction.

    Actual result:

    The confirmation page remains stuck.

    collectible.mp4

    Expected result:

    The user should be navigated to the activity tab after confirming the transaction.

    OS:

    IOS, Android

    Devices:

    • Pixel 7a, Android 13
    • iPhone 11 Pro Max, IOS 17

    Logs

    Status-debug-logs (1).zip

    @VolodLytvynenko VolodLytvynenko moved this from IN TESTING to CONTRIBUTOR in Pipeline for QA May 29, 2024
    @J-Son89
    Copy link
    Member Author

    J-Son89 commented May 30, 2024

    @VolodLytvynenko - when trying to fix the issues you raised I found some navigation issues related to sending. To fix the issues you mentioned I have to address these here too. I will be off tomorrow and Monday so probably won't have these fixes until next week. Will update you when I have them in place, but also this means it will probably have to have another round of dev code review 👍

    @VolodLytvynenko
    Copy link
    Contributor

    @VolodLytvynenko - when trying to fix the issues you raised I found some navigation issues related to sending. To fix the issues you mentioned I have to address these here too. I will be off tomorrow and Monday so probably won't have these fixes until next week. Will update you when I have them in place, but also this means it will probably have to have another round of dev code review 👍

    @J-Son89 got it. Thank you for update

    @J-Son89 J-Son89 force-pushed the jc/refresh-activity-after-send branch from f6d134d to 812a590 Compare June 5, 2024 22:39
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Pipeline for QA
      
    CONTRIBUTOR
    Status: IN TESTING
    Development

    Successfully merging this pull request may close these issues.

    Wallet- Update Activity After Sending a transaction
    7 participants