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: avoid fetching Safe Apps on all pages #3254

Merged
merged 9 commits into from
Feb 20, 2024
Merged

Fix: avoid fetching Safe Apps on all pages #3254

merged 9 commits into from
Feb 20, 2024

Conversation

katspaugh
Copy link
Member

What it solves

Resolves #3253

How this PR fixes it

The "native" WalletConnect feature has to annotate its transactions as if they were coming from the legacy WalletConnect Safe App. This is to ensure that the transaction service adds the correct icon and name to these transactions in the history and queue.

To avoid making an extra request just to fetch the WC Safe App id and URL, I suggest we hardcode it for now. We should solve the root cause of this dependancy on a legacy Safe App on the backend.

Copy link

github-actions bot commented Feb 14, 2024

Copy link

github-actions bot commented Feb 14, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Feb 14, 2024

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

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

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.03 MB (🟢 -468 B)
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!

Eight Pages Changed Size

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

Page Size (compressed) First Load
/apps 48.39 KB (🟡 +236 B) 1.08 MB
/apps/custom 39.56 KB (🟡 +236 B) 1.07 MB
/apps/open 64.13 KB (🟡 +236 B) 1.09 MB
/balances 29.16 KB (🟡 +265 B) 1.06 MB
/balances/nfts 20.73 KB (🟡 +251 B) 1.05 MB
/home 53.25 KB (🟡 +236 B) 1.08 MB
/settings/modules 9.77 KB (🟡 +310 B) 1.04 MB
/settings/safe-apps 24.23 KB (🟡 +236 B) 1.05 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 Feb 14, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.57% (-0.04% 🔻)
11604/14769
🔴 Branches
56.74% (-0.03% 🔻)
2594/4572
🟡 Functions
63.41% (-0.08% 🔻)
1842/2905
🟡 Lines
79.95% (-0.04% 🔻)
10468/13094
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / useSafeAppsFilters.ts
95% (-0.45% 🔻)
0% 100%
94.74% (-0.5% 🔻)
🟢
... / index.tsx
95.24% (-0.32% 🔻)
84.62% (+5.67% 🔼)
80%
94.74% (-0.39% 🔻)

Test suite run success

1402 tests passing in 191 suites.

Report generated by 🧪jest coverage report action from d1436b7

Copy link
Member

@schmanu schmanu left a comment

Choose a reason for hiding this comment

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

The same is required for the Safe Governance app.
We fetch the Safe Apps for the widget in the header to link to the Safe app.

@katspaugh katspaugh marked this pull request as draft February 14, 2024 14:41
Copy link

github-actions bot commented Feb 15, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@katspaugh katspaugh marked this pull request as ready for review February 15, 2024 16:07
Copy link
Member

@schmanu schmanu left a comment

Choose a reason for hiding this comment

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

Vamos!

@liliya-soroka
Copy link
Member

liliya-soroka commented Feb 19, 2024

@katspaugh , have we returned WalletConnect safe app ? (prod CGW)
Steps:

  1. go to the home page
  2. click WalletConnect app under transaction builder in the Connect & transact widget
image

@katspaugh
Copy link
Member Author

@liliya-soroka this can happen when you use the prod CGW switch. Let me fix it.

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@francovenica
Copy link
Contributor

I've checked that the apps still work fine.

Tried connecting with opensea and singing the message
Tried the tx builder in sepolia with a dummy contract.
Tried Cow swap both, as the integrated dapp in the safe and connecting with WC from their webpage (all in sepolia).

I didn't have any issues.

@katspaugh katspaugh merged commit 129b1b1 into dev Feb 20, 2024
13 checks passed
@katspaugh katspaugh deleted the fix-safe-apps branch February 20, 2024 06:17
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Safe Apps are fetched on initial page load
4 participants