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(wallet)_: collectible route cleanup on navigating back from TX confirmation page #21883

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

smohamedjavid
Copy link
Member

fixes #21882

Summary

This PR fixes routes not cleaned properly (Context Canceled and No Routes Found errors thrown on generating the next route) when the user navigates back from the TX confirmation screen using the device's back button/gesture.

Platforms

  • Android
  • iOS

Steps to test

Prerequisite: A wallet account with multiple collectibles
  • Open Status
  • Navigate to the Wallet Tab
  • Tap any collectible and enter the Send flow
  • Complete the flow until the TX confirmation screen
  • Navigate back using the device's back button or gesture
  • Try to complete the flow again (reaching the TX confirmation page)
  • Verify the Context Canceled and No Routes Found error messages are not shown

status: ready

Comment on lines +10 to +13
(->> ownership
(some #(when (= address (:address %))
(:balance %)))
utils.number/parse-int)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Small refactoring of collectible balance util method based on #21871 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

The only changes on this screen are

  • Removed the let var on-close as the navigate-back and clean-up events are separated
  • Removed the fn wrap as the functional compiler is the default
  • Moved the clean-up event to unmount (previously it was in a separate let var), as the event is not called when the user uses the device's back button/gesture.

to-address)}
sign-on-keycard? (get-in transaction-for-signing
[:signingDetails :signOnKeycard])]
(hot-reload/use-safe-unmount #(rf/dispatch [:wallet/clean-route-data-for-collectible-tx]))
Copy link
Member Author

Choose a reason for hiding this comment

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

Clean up event on unmount

{:footer-container-padding 0
:header [quo/page-nav
{:icon-name :i/arrow-left
:on-press events-helper/navigate-back
Copy link
Member Author

Choose a reason for hiding this comment

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

Separated navigate back and clean up event (moved to unmount)

@smohamedjavid smohamedjavid marked this pull request as ready for review January 2, 2025 21:41
@status-im-auto
Copy link
Member

status-im-auto commented Jan 2, 2025

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ dd81fda #1 2025-01-02 21:42:27 ~8 min ios 📱ipa 📲
✔️ dd81fda #1 2025-01-02 21:45:05 ~11 min tests 📄log
✔️ dd81fda #1 2025-01-02 21:47:48 ~14 min android 🤖apk 📲
✔️ dd81fda #1 2025-01-02 21:50:52 ~17 min android-e2e 🤖apk 📲
✔️ c7dca3d #2 2025-01-03 08:32:56 ~4 min tests 📄log
✔️ c7dca3d #2 2025-01-03 08:34:56 ~6 min ios 📱ipa 📲
✔️ c7dca3d #2 2025-01-03 08:37:16 ~9 min android 🤖apk 📲
✔️ c7dca3d #2 2025-01-03 08:37:26 ~9 min android-e2e 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 3d7074b #3 2025-01-03 15:48:27 ~4 min tests 📄log
✔️ 3d7074b #3 2025-01-03 15:50:18 ~6 min ios 📱ipa 📲
✔️ 3d7074b #3 2025-01-03 15:50:56 ~7 min android 🤖apk 📲
✔️ 3d7074b #3 2025-01-03 15:51:22 ~7 min android-e2e 🤖apk 📲
a78f3c7 #4 2025-01-07 13:02:20 ~4 min tests 📄log
✔️ a78f3c7 #4 2025-01-07 13:04:36 ~6 min ios 📱ipa 📲
✔️ a78f3c7 #4 2025-01-07 13:05:01 ~7 min android 🤖apk 📲
✔️ a78f3c7 #4 2025-01-07 13:07:00 ~9 min android-e2e 🤖apk 📲
✔️ a78f3c7 #5 2025-01-07 13:18:42 ~4 min tests 📄log

Copy link
Member

@briansztamfater briansztamfater left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@mohsen-ghafouri mohsen-ghafouri left a comment

Choose a reason for hiding this comment

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

Nice stuff

@smohamedjavid smohamedjavid force-pushed the fix/route-cleanup-for-collectible-tx branch from dd81fda to c7dca3d Compare January 3, 2025 08:27
@status-im-auto
Copy link
Member

75% of end-end tests have passed

Total executed tests: 8
Failed tests: 0
Expected to fail tests: 2
Passed tests: 6
IDs of expected to fail tests: 727230,727229 

Expected to fail tests (2)

Click to expand

Class TestWalletMultipleDevice:

1. test_wallet_send_asset_from_drawer, id: 727230

Device 1: Could not reach Button by pressing system back button
Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

critical/test_wallet.py:165: 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:38: in _get_balances_before_tx
    sender_balance = self.network_api.get_balance(self.sender['wallet_address'])
../support/api/network_api.py:55: in get_balance
    return int(balance) / 1000000000000000000
 invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 

[[Arbiscan API is down, looking for analogue]]

2. test_wallet_send_eth, id: 727229

Device 2: Tap on found: Button
Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

critical/test_wallet.py:130: in test_wallet_send_eth
    sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
critical/test_wallet.py:38: in _get_balances_before_tx
    sender_balance = self.network_api.get_balance(self.sender['wallet_address'])
../support/api/network_api.py:55: in get_balance
    return int(balance) / 1000000000000000000
 invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 

[[Arbiscan API is down, looking for analogue]]

Passed tests (6)

Click to expand

Class TestCommunityOneDeviceMerged:

1. test_restore_multiaccount_with_waku_backup_remove_profile_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
2. test_wallet_balance_mainnet, id: 740490

Class TestCommunityMultipleDeviceMerged:

1. test_community_message_edit, id: 702843
Device sessions

Class TestOneToOneChatMultipleSharedDevicesNewUi:

1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
Device sessions

@VolodLytvynenko VolodLytvynenko self-assigned this Jan 3, 2025
@VolodLytvynenko
Copy link
Contributor

Hi @smohamedjavid still reproducible on IOS if the following steps are performed:

Steps:

  1. Open multi collectible (ERC 1150)-> navigate to confirmation tx page
  2. Open collectible (ERC 720) -> navigate to confirmation tx page
  3. Go back using device's back button -> navigate to confirmation tx page again

Actual result:

A "Context canceled" error and a "No routes found" message are displayed.

context.mp4

Device:

iPhone 11 Pro Max, IOS 17

Logs:

logs.zip

@smohamedjavid smohamedjavid force-pushed the fix/route-cleanup-for-collectible-tx branch from c7dca3d to 3d7074b Compare January 3, 2025 15:43
@smohamedjavid
Copy link
Member Author

@VolodLytvynenko - please retest 🙏 . It should be fixed now.

@status-im-auto
Copy link
Member

75% of end-end tests have passed

Total executed tests: 8
Failed tests: 0
Expected to fail tests: 2
Passed tests: 6
IDs of expected to fail tests: 727230,727229 

Expected to fail tests (2)

Click to expand

Class TestWalletMultipleDevice:

1. test_wallet_send_asset_from_drawer, id: 727230

Device 1: Could not reach Button by pressing system back button
Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

critical/test_wallet.py:165: 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:38: in _get_balances_before_tx
    sender_balance = self.network_api.get_balance(self.sender['wallet_address'])
../support/api/network_api.py:55: in get_balance
    return int(balance) / 1000000000000000000
 invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 

[[Arbiscan API is down, looking for analogue]]

2. test_wallet_send_eth, id: 727229

Device 2: Tap on found: Button
Balance is Invalid API Key (#err2)|ARBTESTNET Gwei

critical/test_wallet.py:130: in test_wallet_send_eth
    sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
critical/test_wallet.py:38: in _get_balances_before_tx
    sender_balance = self.network_api.get_balance(self.sender['wallet_address'])
../support/api/network_api.py:55: in get_balance
    return int(balance) / 1000000000000000000
 invalid literal for int() with base 10: 'Invalid API Key (#err2)|ARBTESTNET' 

[[Arbiscan API is down, looking for analogue]]

Passed tests (6)

Click to expand

Class TestCommunityOneDeviceMerged:

1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
Device sessions

2. test_community_copy_and_paste_message_in_chat_input, id: 702742
Device sessions

Class TestCommunityMultipleDeviceMerged:

1. test_community_message_edit, id: 702843
Device sessions

Class TestWalletOneDevice:

1. test_wallet_add_remove_regular_account, id: 727231
2. test_wallet_balance_mainnet, id: 740490

Class TestOneToOneChatMultipleSharedDevicesNewUi:

1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
Device sessions

@VolodLytvynenko
Copy link
Contributor

@smohamedjavid Thank you for PR. No issues from my side. PR is ready to be merged

@smohamedjavid smohamedjavid force-pushed the fix/route-cleanup-for-collectible-tx branch from 3d7074b to a78f3c7 Compare January 7, 2025 12:57
@smohamedjavid smohamedjavid merged commit ba8cf8e into develop Jan 7, 2025
5 checks passed
@smohamedjavid smohamedjavid deleted the fix/route-cleanup-for-collectible-tx branch January 7, 2025 13:34
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.

"Context Canceled" Error and "No Routes Found" message on Collectible Send flow when using device back button
6 participants