status-mobile icon indicating copy to clipboard operation
status-mobile copied to clipboard

fix: no routes are found in case of valid amount in fiat is entered

Open briansztamfater opened this issue 9 months ago • 6 comments

fixes #18561 fixes #19999

Summary

This PR fixes a bug that makes no routes being fetched when the users switch the input mode to display values in fiat and a valid amount in fiat is entered. Also fixed some minor but noticeable bugs that appeared after fixing the main bug:

  • Visual overflow of the suffix text of the input when swapping mode to fiat and the number is too big. Needed to refactor a bit the views and styles of Token Input component.
  • Don't allow the user to use more decimals than the token supports.
  • Fiat character symbol was not showing in the conversion.
  • Fiat character symbol was not used when showing the max amount.
  • Many trailing zeroes issues when leading with large numbers.
  • Routes being fetched when swapping to fiat, and vise versa

Demo

https://github.com/status-im/status-mobile/assets/18485527/c67ae017-b134-4813-b716-99ba9167ef8f

Platforms

  • Android
  • iOS

Areas that maybe impacted

Functional
  • wallet / transactions

Steps to test

  • Open Status
  • Login
  • Go to wallet
  • Select an account
  • Tap on Send button
  • Select an asset where the user has funds on
  • Tap on switch button on the input to display values in fiat
  • Enter a valid amount in fiat
  • Wait for routes to be loaded
  • Verify correct behavior of input and routes loading

status: ready

briansztamfater avatar May 13 '24 15:05 briansztamfater

Jenkins Builds

Click to see older builds (52)
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:x: b6ca301e9948a0418921a7d2323ae31d16d390f4 #1 2024-05-13 15:52:20 ~2 min tests :page_facing_up:log
:x: 2e74d9826c81cbe2b4c33aff85bd4ce549c7b445 #2 2024-05-13 15:54:55 ~2 min tests :page_facing_up:log
:heavy_check_mark: 2e74d9826c81cbe2b4c33aff85bd4ce549c7b445 #2 2024-05-13 15:59:34 ~6 min android :robot:apk :calling:
:heavy_check_mark: 2e74d9826c81cbe2b4c33aff85bd4ce549c7b445 #2 2024-05-13 16:00:07 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: 2e74d9826c81cbe2b4c33aff85bd4ce549c7b445 #2 2024-05-13 16:02:43 ~10 min ios :iphone:ipa :calling:
:x: 1a6106ed288948e5246bdb206f4dfb8fd82500cb #3 2024-05-14 09:35:58 ~2 min tests :page_facing_up:log
:heavy_check_mark: 1a6106ed288948e5246bdb206f4dfb8fd82500cb #3 2024-05-14 09:39:45 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: 1a6106ed288948e5246bdb206f4dfb8fd82500cb #3 2024-05-14 09:39:49 ~6 min android :robot:apk :calling:
:heavy_check_mark: 1a6106ed288948e5246bdb206f4dfb8fd82500cb #3 2024-05-14 09:42:29 ~8 min ios :iphone:ipa :calling:
:x: f6f077c650e7afacaf8ac1fd63db7abb68c38510 #4 2024-05-14 09:46:08 ~2 min tests :page_facing_up:log
:heavy_check_mark: f6f077c650e7afacaf8ac1fd63db7abb68c38510 #4 2024-05-14 09:49:26 ~5 min android-e2e :robot:apk :calling:
:heavy_check_mark: f6f077c650e7afacaf8ac1fd63db7abb68c38510 #4 2024-05-14 09:49:38 ~6 min android :robot:apk :calling:
:heavy_check_mark: f6f077c650e7afacaf8ac1fd63db7abb68c38510 #4 2024-05-14 09:52:18 ~8 min ios :iphone:ipa :calling:
:x: 0bf15844d404b54b34b3c4217b7bdd6f274c32b5 #5 2024-05-14 15:39:12 ~2 min tests :page_facing_up:log
:x: efcff9cbf0eda3f5192acbf81b81c41b14e43e55 #6 2024-05-14 15:42:43 ~2 min tests :page_facing_up:log
:heavy_check_mark: efcff9cbf0eda3f5192acbf81b81c41b14e43e55 #6 2024-05-14 15:47:53 ~8 min android :robot:apk :calling:
:heavy_check_mark: efcff9cbf0eda3f5192acbf81b81c41b14e43e55 #6 2024-05-14 15:47:55 ~8 min android-e2e :robot:apk :calling:
:heavy_check_mark: efcff9cbf0eda3f5192acbf81b81c41b14e43e55 #6 2024-05-14 15:48:07 ~8 min ios :iphone:ipa :calling:
:heavy_check_mark: 1d77b60842e1c28825de01ea4ce47c845a7aa582 #7 2024-05-15 10:41:55 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: 1d77b60842e1c28825de01ea4ce47c845a7aa582 #7 2024-05-15 10:41:57 ~6 min android :robot:apk :calling:
:heavy_check_mark: 1d77b60842e1c28825de01ea4ce47c845a7aa582 #7 2024-05-15 10:43:52 ~8 min ios :iphone:ipa :calling:
:heavy_check_mark: 1d77b60842e1c28825de01ea4ce47c845a7aa582 #8 2024-05-15 12:56:16 ~4 min tests :page_facing_up:log
:x: d7a73bd027c8ff4cbee976e6b8d6a75f14860eb9 #9 2024-05-16 10:06:20 ~30 sec tests :page_facing_up:log
:heavy_check_mark: d7a73bd027c8ff4cbee976e6b8d6a75f14860eb9 #8 2024-05-16 10:12:43 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: d7a73bd027c8ff4cbee976e6b8d6a75f14860eb9 #8 2024-05-16 10:12:47 ~6 min android :robot:apk :calling:
:heavy_check_mark: d7a73bd027c8ff4cbee976e6b8d6a75f14860eb9 #8 2024-05-16 10:14:23 ~8 min ios :iphone:ipa :calling:
:x: 1b0a237fb43f2c7e8cd4af56f02134527a154c44 #10 2024-05-16 10:17:13 ~2 min tests :page_facing_up:log
:x: dc873bf916db2ad77b4fbe2557c52f96c4796c15 #11 2024-05-16 10:22:06 ~30 sec tests :page_facing_up:log
:heavy_check_mark: dc873bf916db2ad77b4fbe2557c52f96c4796c15 #10 2024-05-16 10:27:27 ~5 min android :robot:apk :calling:
:heavy_check_mark: dc873bf916db2ad77b4fbe2557c52f96c4796c15 #10 2024-05-16 10:27:50 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: dc873bf916db2ad77b4fbe2557c52f96c4796c15 #10 2024-05-16 10:31:08 ~9 min ios :iphone:ipa :calling:
:x: dc873bf916db2ad77b4fbe2557c52f96c4796c15 #12 2024-05-16 10:48:10 ~30 sec tests :page_facing_up:log
:x: 1acd275fe625d735cb05ff2c52a7f748589e934b #13 2024-05-16 14:03:44 ~1 min tests :page_facing_up:log
:x: bf1d1b906946e6d66ae4d2d802a771e38d08e55e #14 2024-05-16 14:06:37 ~2 min tests :page_facing_up:log
:heavy_check_mark: bf1d1b906946e6d66ae4d2d802a771e38d08e55e #12 2024-05-16 14:10:04 ~6 min android :robot:apk :calling:
:heavy_check_mark: bf1d1b906946e6d66ae4d2d802a771e38d08e55e #12 2024-05-16 14:10:51 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: bf1d1b906946e6d66ae4d2d802a771e38d08e55e #12 2024-05-16 14:13:03 ~8 min ios :iphone:ipa :calling:
:heavy_check_mark: 08f7100367d0acdad1e28c9cd1c6e3c0e753a0ac #15 2024-05-16 14:26:22 ~5 min tests :page_facing_up:log
:heavy_check_mark: 08f7100367d0acdad1e28c9cd1c6e3c0e753a0ac #13 2024-05-16 14:26:55 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: 08f7100367d0acdad1e28c9cd1c6e3c0e753a0ac #13 2024-05-16 14:27:33 ~6 min android :robot:apk :calling:
:heavy_check_mark: b994b961eb57b9365db7fcbf1735a79aba6fd4e8 #16 2024-05-16 14:34:29 ~4 min tests :page_facing_up:log
:heavy_check_mark: b994b961eb57b9365db7fcbf1735a79aba6fd4e8 #14 2024-05-16 14:37:33 ~7 min android :robot:apk :calling:
:heavy_check_mark: b994b961eb57b9365db7fcbf1735a79aba6fd4e8 #14 2024-05-16 14:37:44 ~7 min android-e2e :robot:apk :calling:
:heavy_check_mark: b994b961eb57b9365db7fcbf1735a79aba6fd4e8 #14 2024-05-16 14:41:21 ~11 min ios :iphone:ipa :calling:
:heavy_check_mark: 0a70a8f5e0b4b72b36c1200eaa469005c5a74466 #17 2024-05-17 13:57:20 ~4 min tests :page_facing_up:log
:heavy_check_mark: 0a70a8f5e0b4b72b36c1200eaa469005c5a74466 #15 2024-05-17 13:59:20 ~6 min android :robot:apk :calling:
:heavy_check_mark: 0a70a8f5e0b4b72b36c1200eaa469005c5a74466 #15 2024-05-17 14:00:14 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: 0a70a8f5e0b4b72b36c1200eaa469005c5a74466 #15 2024-05-17 14:04:43 ~11 min ios :iphone:ipa :calling:
:heavy_check_mark: 882f7b7cf45a35f42d8416425e35b658c821cb44 #18 2024-05-20 08:34:45 ~4 min tests :page_facing_up:log
:heavy_check_mark: 882f7b7cf45a35f42d8416425e35b658c821cb44 #16 2024-05-20 08:36:46 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: 882f7b7cf45a35f42d8416425e35b658c821cb44 #16 2024-05-20 08:37:38 ~6 min android :robot:apk :calling:
:heavy_check_mark: 882f7b7cf45a35f42d8416425e35b658c821cb44 #16 2024-05-20 08:40:29 ~9 min ios :iphone:ipa :calling:
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: cbbb9e923e60d9e85e095e1c1ba3ef93b0b94d7c #19 2024-05-20 11:29:30 ~4 min tests :page_facing_up:log
:heavy_check_mark: cbbb9e923e60d9e85e095e1c1ba3ef93b0b94d7c #17 2024-05-20 11:31:16 ~6 min android :robot:apk :calling:
:heavy_check_mark: cbbb9e923e60d9e85e095e1c1ba3ef93b0b94d7c #17 2024-05-20 11:32:12 ~6 min android-e2e :robot:apk :calling:
:heavy_check_mark: cbbb9e923e60d9e85e095e1c1ba3ef93b0b94d7c #17 2024-05-20 11:33:40 ~8 min ios :iphone:ipa :calling:
:heavy_check_mark: 60151b5351f8d6cb00013e90441d298fe27d5904 #20 2024-05-20 13:00:42 ~4 min tests :page_facing_up:log
:heavy_check_mark: 60151b5351f8d6cb00013e90441d298fe27d5904 #18 2024-05-20 13:02:34 ~5 min android-e2e :robot:apk :calling:
:heavy_check_mark: 60151b5351f8d6cb00013e90441d298fe27d5904 #18 2024-05-20 13:02:51 ~6 min android :robot:apk :calling:
:heavy_check_mark: 60151b5351f8d6cb00013e90441d298fe27d5904 #18 2024-05-20 13:05:35 ~8 min ios :iphone:ipa :calling:

status-im-auto avatar May 13 '24 15:05 status-im-auto

Hey @briansztamfater, can you please review your code a little bit to explain are the other bugs being fixed?

Also would be good if you can add a video to PR description.

OmarBasem avatar May 15 '24 05:05 OmarBasem

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 20000 pr's 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

J-Son89 avatar May 15 '24 07:05 J-Son89

@J-Son89 @OmarBasem added more context all over the PR, also improved the description describing related issues that were fixed here and added a demo video

briansztamfater avatar May 15 '24 10:05 briansztamfater

87% of end-end tests have passed

Total executed tests: 52
Failed tests: 5
Expected to fail tests: 2
Passed tests: 45
IDs of failed tests: 727230,704615,727229,703391,702807 
IDs of expected to fail tests: 703495,703503 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 1: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]`
    Device 1: `Text` is `0.49046 ETH`
    critical/test_wallet.py:129: in test_wallet_send_asset_from_drawer
        self._check_balances_after_tx(amount_to_send, sender_balance, receiver_balance, eth_amount_sender,
    critical/test_wallet.py:100: in _check_balances_after_tx
        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))]))
     Eth amount in the receivers wallet is 0.001 but should be 0.0011
    E    Eth amount in the senders wallet is 0.4905 but should be 0.4904
    



    2. test_wallet_send_eth, id: 727229

    Device 1: Find Text by xpath: //android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]
    Device 1: Text is 0.49046 ETH
    critical/test_wallet.py:114: in test_wallet_send_eth
        self._check_balances_after_tx(amount_to_send, sender_balance, receiver_balance, eth_amount_sender,
    critical/test_wallet.py:100: in _check_balances_after_tx
        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))]))
     Eth amount in the receivers wallet is 0.001 but should be 0.0011
    E    Eth amount in the senders wallet is 0.4905 but should be 0.4904
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_edit_delete_message_when_offline, id: 704615

    Device 1: Looking for a message by text: text after edit
    Device 1: Looking for a message by text: message to delete
    critical/chats/test_public_chat_browsing.py:798: in test_community_edit_delete_message_when_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 'message to delete' was not deleted for the receiver
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_send_image_save_and_share, id: 703391

    Device 2: Find Button by accessibility id: image-0
    Device 2: Click system back button
    critical/chats/test_1_1_public_chats.py:458: in test_1_1_chat_send_image_save_and_share
        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 about saving a photo is not shown for sender.
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. 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

    Expected to fail tests (2)

    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/status-im/status-mobile/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:464: 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/status-im/status-mobile/issues/19627]]

    Device sessions

    Passed tests (45)

    Click to expand

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

    2. test_wallet_add_remove_watch_only_account, id: 727232
    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 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_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 TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    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 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_pin_messages, id: 702731
    Device sessions

    7. test_1_1_chat_message_reaction, id: 702730
    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 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

    status-im-auto avatar May 16 '24 11:05 status-im-auto

    87% of end-end tests have passed

    e2e failures are not related to the PR

    yevh-berdnyk avatar May 16 '24 13:05 yevh-berdnyk

    Hey @briansztamfater! Thanks for the PR. I see that you have pushed recently some changes. Is that just rebasing or additional changes?

    pavloburykh avatar May 20 '24 11:05 pavloburykh

    Hey @briansztamfater! Thanks for the PR. I see that you have pushed recently some changes. Is that just rebasing or additional changes?

    Hey @pavloburykh, just rebasing, PR can be tested

    briansztamfater avatar May 20 '24 12:05 briansztamfater

    @briansztamfater thanks for the fixes. PR is ready for merge.

    pavloburykh avatar May 20 '24 12:05 pavloburykh