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: Disable transaction buttons until sdk is initialized #4405

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

usame-algan
Copy link
Member

What it solves

Resolves #4404

This should make our e2e tests more robust

How this PR fixes it

  • Adds a check for the sdk inside CheckWallet which will disable all buttons it wraps until the SDK is initialized

How to test it

  1. Create and queue a transaction
  2. Go to the queue
  3. Reload the app
  4. Observe the Confirm button is disabled until the SDK is ready

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

Copy link

github-actions bot commented Oct 22, 2024

@usame-algan
Copy link
Member Author

@mike10ca The e2e tests can be tested in this PR. Lets see if they still fail as often as before. Do we have a list of e2e test where we know this error happens?

Copy link

github-actions bot commented Oct 22, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 997.65 KB (🟡 +3.7 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Twenty-five Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/address-book 26.09 KB (🟡 +3 B) 1023.74 KB
/apps 48.42 KB (🟡 +23 B) 1.02 MB
/apps/custom 40.06 KB (🟡 +25 B) 1.01 MB
/apps/open 55.18 KB (🟡 +1 B) 1.03 MB
/balances 29.44 KB (🟡 +21 B) 1 MB
/balances/nfts 19.21 KB (🟡 +25 B) 1016.85 KB
/home 57.33 KB (🟡 +1 B) 1.03 MB
/licenses 4.98 KB (🟡 +7 B) 1002.62 KB
/new-safe/advanced-create 36.68 KB (🟡 +212 B) 1.01 MB
/new-safe/create 35.94 KB (🟡 +212 B) 1.01 MB
/new-safe/load 16.61 KB (🟡 +205 B) 1014.26 KB
/settings/appearance 8.06 KB (🟡 +19 B) 1005.7 KB
/settings/cookies 7.68 KB (🟡 +20 B) 1005.33 KB
/settings/data 7.58 KB (🟡 +19 B) 1005.23 KB
/settings/environment-variables 9.17 KB (🟡 +20 B) 1006.82 KB
/settings/modules 9.84 KB (🟡 +19 B) 1007.49 KB
/settings/notifications 27.05 KB (🟡 +22 B) 1 MB
/settings/safe-apps 23.94 KB (🟡 +20 B) 1021.59 KB
/settings/security 8.1 KB (🟡 +18 B) 1005.75 KB
/settings/setup 36 KB (🟡 +18 B) 1.01 MB
/share/safe-app 9.73 KB (🟡 +2 B) 1007.37 KB
/transactions 73.69 KB (🟡 +164 B) 1.05 MB
/transactions/history 73.66 KB (🟡 +163 B) 1.05 MB
/transactions/messages 39.2 KB (🟡 +20 B) 1.01 MB
/transactions/queue 31.3 KB (🟡 +20 B) 1 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Oct 22, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73.66% (+0% 🔼)
13514/18347
🔴 Branches
51.43% (-0.01% 🔻)
3281/6380
🔴 Functions 57.2% 1967/3439
🟡 Lines
75.36% (-0% 🔻)
12289/16306
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / useTxPendingStatuses.ts
83.64% (-0.91% 🔻)
68.33% (-1.67% 🔻)
75%
92.63% (-1.05% 🔻)

Test suite run success

1574 tests passing in 208 suites.

Report generated by 🧪jest coverage report action from 0b08f35

@mike10ca
Copy link
Contributor

@mike10ca The e2e tests can be tested in this PR. Lets see if they still fail as often as before. Do we have a list of e2e test where we know this error happens?

@usame-algan yes, this was associated with sending out an NFT. I tested it locally few times and it seems to work. Let's merge it and observe the tests further.

@usame-algan
Copy link
Member Author

@francovenica I suggest we test the app with different safe versions. Basically we disable a lot of buttons now if the SDK could not be initialized so we need to make sure it still works even with older safe versions where the SDK might not work.

@francovenica
Copy link
Contributor

So for me it works fine, and shows the tooltip about the sdk not being enabled.
image

I tried in old safes versions, safes 1.1.1 and 1.3.0 and I also there I got the button being disabled for a second just with no tooltip.

Since it works fine, let's see if automation works fine now since it is the reason we are doing this mostly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when trying to sign/execute transaction too fast after page refresh
4 participants