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

WalletConnect no internet edge-cases #20826

Merged
merged 18 commits into from
Jul 25, 2024
Merged

Conversation

clauxx
Copy link
Member

@clauxx clauxx commented Jul 19, 2024

fixes #20802
fixes #20760
fixes #20764

Summary

Fixing issues related to internet connection in wallet connect.

Changes included:

  1. Moved the net-info ns from legacy to status-im and adapted to guidelines
  2. Moved network (internet) root subs from legacy to status-im
  3. If the user logs in without internet, show the persisted sessions in "Connected dApps"
  4. If the user logs in without internet, don't initialise wallet-connect until the connection is re-established
  5. Show toast if disconnecting without internet connection
  6. Show toast if approving dapp connection without internet
  7. Show toast if scanning wallet-connect QR without internet
  8. Show alert banner inside request modal (above slider, similar to the fee warning) when connection is lost. Not using a toast here, since the request can only come in with an internet connection, so we're just handling the case where the connection is lost while the modal is open. The slider is disabled while there is no connection.
  9. For point 8, moved the quo/alert-banner into the reusable footer component

status: ready

@clauxx clauxx self-assigned this Jul 19, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Jul 19, 2024

Jenkins Builds

Click to see older builds (48)
Commit #️⃣ Finished (UTC) Duration Platform Result
9dee200 #1 2024-07-19 17:55:42 ~3 min tests 📄log
✔️ 9dee200 #1 2024-07-19 17:59:46 ~7 min android 🤖apk 📲
✔️ 9dee200 #1 2024-07-19 17:59:46 ~7 min android-e2e 🤖apk 📲
✔️ 9dee200 #1 2024-07-19 18:01:22 ~9 min ios 📱ipa 📲
f400a47 #2 2024-07-19 20:05:34 ~3 min tests 📄log
e441ccd #3 2024-07-19 20:11:07 ~3 min tests 📄log
d4490f1 #4 2024-07-19 20:15:44 ~3 min tests 📄log
✔️ d4490f1 #4 2024-07-19 20:18:50 ~6 min android 🤖apk 📲
✔️ d4490f1 #4 2024-07-19 20:19:44 ~7 min android-e2e 🤖apk 📲
✔️ d4490f1 #4 2024-07-19 20:20:57 ~8 min ios 📱ipa 📲
72f1c59 #5 2024-07-19 20:56:39 ~3 min tests 📄log
✔️ 72f1c59 #5 2024-07-19 21:01:08 ~8 min android-e2e 🤖apk 📲
✔️ 72f1c59 #5 2024-07-19 21:01:19 ~8 min android 🤖apk 📲
✔️ 72f1c59 #5 2024-07-19 21:01:33 ~8 min ios 📱ipa 📲
7c94654 #7 2024-07-20 14:22:28 ~4 min tests 📄log
✔️ 7c94654 #7 2024-07-20 14:24:18 ~6 min android-e2e 🤖apk 📲
✔️ 7c94654 #7 2024-07-20 14:25:48 ~7 min android 🤖apk 📲
✔️ 7c94654 #7 2024-07-20 14:28:24 ~10 min ios 📱ipa 📲
✔️ 7c94654 #8 2024-07-20 14:30:30 ~1 min tests 📄log
✔️ ba65b89 #9 2024-07-22 08:27:53 ~5 min tests 📄log
✔️ ba65b89 #8 2024-07-22 08:31:18 ~8 min android-e2e 🤖apk 📲
✔️ ba65b89 #8 2024-07-22 08:31:25 ~8 min android 🤖apk 📲
✔️ ba65b89 #8 2024-07-22 08:31:32 ~8 min ios 📱ipa 📲
9b276b4 #10 2024-07-23 15:59:20 ~2 min tests 📄log
✔️ 9b276b4 #9 2024-07-23 16:04:34 ~7 min android-e2e 🤖apk 📲
✔️ 9b276b4 #9 2024-07-23 16:04:39 ~7 min android 🤖apk 📲
✔️ 9b276b4 #9 2024-07-23 16:06:04 ~8 min ios 📱ipa 📲
41d212b #14 2024-07-24 09:05:59 ~3 min tests 📄log
✔️ 713acc5 #16 2024-07-24 09:13:56 ~4 min tests 📄log
✔️ 713acc5 #15 2024-07-24 09:15:57 ~6 min android 🤖apk 📲
✔️ 713acc5 #15 2024-07-24 09:16:39 ~7 min android-e2e 🤖apk 📲
✔️ 713acc5 #15 2024-07-24 09:18:14 ~8 min ios 📱ipa 📲
✔️ 0d0e84d #17 2024-07-24 12:24:33 ~5 min tests 📄log
✔️ 0d0e84d #16 2024-07-24 12:28:20 ~8 min ios 📱ipa 📲
✔️ 0d0e84d #16 2024-07-24 12:29:16 ~9 min android-e2e 🤖apk 📲
✔️ 0d0e84d #16 2024-07-24 12:29:22 ~9 min android 🤖apk 📲
✔️ 1549eaf #18 2024-07-24 12:35:06 ~4 min tests 📄log
✔️ 1549eaf #17 2024-07-24 12:38:14 ~7 min android-e2e 🤖apk 📲
✔️ 1549eaf #17 2024-07-24 12:38:24 ~7 min android 🤖apk 📲
✔️ 1549eaf #17 2024-07-24 12:41:05 ~10 min ios 📱ipa 📲
e091ba5 #19 2024-07-24 13:29:13 ~4 min tests 📄log
✔️ e091ba5 #18 2024-07-24 13:32:46 ~8 min android-e2e 🤖apk 📲
✔️ e091ba5 #18 2024-07-24 13:32:51 ~8 min android 🤖apk 📲
✔️ e091ba5 #18 2024-07-24 13:34:20 ~10 min ios 📱ipa 📲
✔️ 396e184 #20 2024-07-24 14:37:56 ~4 min tests 📄log
✔️ 396e184 #19 2024-07-24 14:41:22 ~8 min android 🤖apk 📲
✔️ 396e184 #19 2024-07-24 14:41:29 ~8 min android-e2e 🤖apk 📲
✔️ 396e184 #19 2024-07-24 14:42:14 ~9 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 904eab5 #21 2024-07-24 14:52:29 ~4 min tests 📄log
✔️ 904eab5 #20 2024-07-24 14:56:17 ~8 min android-e2e 🤖apk 📲
✔️ 904eab5 #20 2024-07-24 14:56:18 ~8 min android 🤖apk 📲
✔️ 904eab5 #20 2024-07-24 14:56:25 ~8 min ios 📱ipa 📲
✔️ e13c862 #23 2024-07-25 06:50:34 ~4 min tests 📄log
✔️ e13c862 #22 2024-07-25 06:52:16 ~6 min android-e2e 🤖apk 📲
✔️ e13c862 #22 2024-07-25 06:53:35 ~7 min android 🤖apk 📲
✔️ e13c862 #22 2024-07-25 06:54:40 ~8 min ios 📱ipa 📲

@clauxx clauxx force-pushed the feat/wallet-connect-no-internet branch 4 times, most recently from c8de0db to 7c94654 Compare July 20, 2024 14:17
@clauxx
Copy link
Member Author

clauxx commented Jul 23, 2024

@qoqobolo @pavloburykh The PR is ready for testing

@status-im-auto
Copy link
Member

71% of end-end tests have passed

Total executed tests: 7
Failed tests: 1
Expected to fail tests: 1
Passed tests: 5
IDs of failed tests: 727230 
IDs of expected to fail tests: 727232 

Failed tests (1)

Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Device 2: Find `Text` by `xpath`: `//android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]`
    Device 2: `Text` is `0.01259 ETH`

    critical/test_wallet.py:184: in test_wallet_send_asset_from_drawer
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Sender balance is not updated on Etherscan, it is 0.4858 but expected to be 0.4859
    



    Expected to fail tests (1)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_watch_only_account, id: 727232

    Device 1: Find EditBox by accessibility id: add-address-to-watch
    Device 1: Type 0x8d2413447ff297d30bdc475f6d5cb00254685aae to EditBox

    critical/test_wallet.py:249: in test_wallet_add_remove_watch_only_account
        self.wallet_view.add_watch_only_account(address=address_to_watch, account_name=new_account_name)
    ../views/wallet_view.py:163: in add_watch_only_account
        self.account_has_activity_label.wait_for_visibility_of_element()
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: Text by accessibility id:`account-has-activity` is not found on the screen after wait_for_visibility_of_element 
    

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

    Device sessions

    Passed tests (5)

    Click to expand

    Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    @qoqobolo qoqobolo self-assigned this Jul 23, 2024
    @qoqobolo
    Copy link
    Contributor

    @clauxx could you resolve the conflicts please? I'll start testing after that, thanks!

    @clauxx
    Copy link
    Member Author

    clauxx commented Jul 23, 2024

    @qoqobolo done 👍

    @ilmotta
    Copy link
    Contributor

    ilmotta commented Jul 24, 2024

    Hey @clauxx, I found quite hard to review this PR due to the amount of commits coming from other already merged PRs. Even the large number of changes coming from the recently changed translations file.

    Sorry if I'm out of context, but why are we basing the PR branch off of fix/typed-data-wrong-chain and not develop? From a QA perspective this also makes things complicated/risky to test.

    @clauxx
    Copy link
    Member Author

    clauxx commented Jul 24, 2024

    Hey @clauxx, I found quite hard to review this PR due to the amount of commits coming from other already merged PRs. Even the large number of changes coming from the recently changed translations file.

    Sorry if I'm out of context, but why are we basing the PR branch off of fix/typed-data-wrong-chain and not develop? From a QA perspective this also makes things complicated/risky to test.

    Yeah, good point. I have to rebase. Initially the changes here depended on the other branch

    @clauxx clauxx force-pushed the feat/wallet-connect-no-internet branch 2 times, most recently from 08a2839 to 0611a81 Compare July 24, 2024 08:59
    @clauxx clauxx changed the base branch from fix/typed-data-wrong-chain to develop July 24, 2024 09:01
    @clauxx
    Copy link
    Member Author

    clauxx commented Jul 24, 2024

    @ilmotta Sorry for this, seems like during a previous rebase the tree got messed up. Should be good to review and test now 👍

    @qoqobolo
    Copy link
    Contributor

    Thanks @clauxx, ping me please as soon as you have news👍

    @clauxx clauxx force-pushed the feat/wallet-connect-no-internet branch from 1549eaf to e091ba5 Compare July 24, 2024 13:23
    @clauxx
    Copy link
    Member Author

    clauxx commented Jul 25, 2024

    @qoqobolo ready to be checked again. Added some changes to make it easier for the other PR to rebase (cc @Parveshdhull).

    @qoqobolo
    Copy link
    Contributor

    Thanks @clauxx, LGTM.
    PR can be merged.

    @clauxx clauxx merged commit cee2124 into develop Jul 25, 2024
    5 checks passed
    @clauxx clauxx deleted the feat/wallet-connect-no-internet branch July 25, 2024 08:21
    ilmotta pushed a commit that referenced this pull request Jul 28, 2024
    * feat: only initialize wc if internet online
    
    * feat: no internet toast for session establishment
    
    * feat: no internet banner on session requests
    
    * feat: reloading walletconnect on connection change
    
    * fix: re-initialize only when previously failed to
    
    * fix: removed legacy net-info ns
    
    * ref: renamed :network-status to :network/status
    
    * ref: moved network subs to own "category"
    
    * fix: device network fx args
    
    * fix: tests & showing persisted dapps when offline
    
    * fix: addressed review comments
    
    * fix: rebase issues
    
    * fix: linting
    
    * fix: usage of web3-wallet (#20864)
    
    * fix: moved networks to contextx and renaming
    
    * ref: moved building supported namespaces into fx
    ilmotta added a commit that referenced this pull request Jul 30, 2024
    Revisions from develop:
    
    - 59ceddb develop origin/develop fix(wallet): fix bridge transactions (#20902)
    - 99ccbc3 Cover wallet send events with tests Part 2 #20411 #20533 (#20721)
    - 8c2d539 Enabling WalletConnect feature flag (#20906)
    - 67c83b1 fix(wallet): remove edit routes button in bridging (#20874)
    - 11a84ba feat(wallet): disable complex routing (#20901)
    - 1f5bb57 chore(wallet): disable bridging on unsupported tokens (#20846)
    - 4586f80 Add toggle in advanced settings for mobile data
    - 55c620e fix: create password for small screen (#20645)
    - 525609f Wallet Activity: transactions are not sorted by time #20808 (#20862)
    - 9065395 chore(settings): Disable telemetry option (#20881)
    - d27ab75 fix_:display group message using the new ui (#20787)
    - c6a1db6 ci: enable split apks & build only for arm64-v8a (#20683)
    - 73777e0 Ensure keycard account can send transaction after upgrading from v1 to v2 #20552 (#20845)
    - a6d3fc3 [#20524] fix: the missed keypairs are shown in the key pair list screen (#20888)
    - a671c70 fix broken screen and navigation when syncing fails (#20887)
    - a45991b 🥅 Filter connected dapps based on testnet mode, reject proposals and requests gracefully (#20799)
    - 2e9fa22 feat: wallet router v2 (#20631)
    - 737d8c4 rename sub to fix error when requesting to join community (#20868)
    - 3aa7e10 Sync process is blocked on Enabled notifications screen (#20883)
    - c1d2d44 perf: Fix app freeze after login (#20729)
    - 0fed811 e2e: updated testnet switching and added one test into smoke
    - 53c35cb fix(wallet): Linear gradient exception on invalid colors for watched account cards (#20854)
    - be82365 chore(settings)_: Remove testnet toggle from legacy advanced settings (#20875)
    - eae8a65 feat(wallet)_: Add beta info box in activity tab (#20873)
    - fe54a25 fix: not clearing network & web3-wallet on logout (#20886)
    - 15a4219 Reject wallet-connect request by dragging the modal down (#20763) (#20836)
    - 2ffbdac WalletConnect show expired toast (#20857)
    - 402eb83 fix Issue with scrolling WalletConnect transaction on Android (#20867)
    - ff88049 Fix WalletConnect header alignment on Android (#20860)
    - cee2124 WalletConnect no internet edge-cases (#20826)
    - 60ad7c8 chore(tests): New match-strict? cljs.test directive (#20825)
    - 4989c92 fix_: Adding own address as saved addresses (#20839)
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    6 participants