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: don't load social login if no env var is set #3267

Merged
merged 2 commits into from
Feb 15, 2024
Merged

Fix: don't load social login if no env var is set #3267

merged 2 commits into from
Feb 15, 2024

Conversation

compojoom
Copy link
Collaborator

What it solves

grafik

Resolves #
We should be able to start the app by just providing the infura token and nothing else.

How this PR fixes it

If we haven't specified any social_wallet_options, the social login is not enabled.

How to test it

  1. Clone the PR
  2. Create an .env file with just
NEXT_PUBLIC_INFURA_TOKEN=YOUR_KEY
NEXT_PUBLIC_SAFE_APPS_INFURA_TOKEN=YOUR_KEY

You shouldn't get an error now when you run yarn dev

Screenshots

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) 🧑‍💻

With our default .env variables we would end up trying to parse the empty string and we’ll end up in the catch case. No need to polute the console with this.
If we haven’t configured any SOCIAL_WALLET_OPTIONS we don’t need to worry about the chain.
@compojoom compojoom marked this pull request as ready for review February 15, 2024 13:37
Copy link

github-actions bot commented Feb 15, 2024

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

@katspaugh katspaugh changed the title Fix start without all .env variables Fix: don't load social login if no env var is set Feb 15, 2024
Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

🙏

Copy link

📦 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 1.03 MB (🟡 +1.07 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!

Copy link

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.71% (-0.02% 🔻)
11569/14698
🔴 Branches
56.82% (-0.01% 🔻)
2595/4567
🟡 Functions 63.66% 1843/2895
🟢 Lines
80.04% (-0.02% 🔻)
10433/13035
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / config.ts
52.63% (-10.53% 🔻)
53.85% 50%
50% (-12.5% 🔻)
🔴
... / wallets.ts
34.62% (-0.08% 🔻)
0% 0%
43.9% (+0.31% 🔼)

Test suite run success

1404 tests passing in 191 suites.

Report generated by 🧪jest coverage report action from 18f58bb

@katspaugh katspaugh merged commit ffd511f into dev Feb 15, 2024
15 checks passed
@katspaugh katspaugh deleted the fix-start branch February 15, 2024 15:19
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 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.

2 participants