Skip to content

fix: Add chain fallback for wallet switching #5668

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

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Dec 9, 2024

Problem solved

CNCT-2609


PR-Codex overview

This PR addresses an issue where adding a blockchain network was not triggering for certain wallets. It modifies the error handling in the wallet_addEthereumChain process to ensure the chain is added correctly when the error code indicates it does not exist.

Detailed summary

  • Removed explicit any type handling in the catch block.
  • Simplified error handling by removing the conditional check for error codes.
  • Ensured the addition of the chain is attempted unconditionally when an error occurs.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:59pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:59pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:59pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 9:59pm

Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: 06170ae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Dec 9, 2024
@joaquim-verges joaquim-verges marked this pull request as ready for review December 9, 2024 21:46
Copy link
Contributor

github-actions bot commented Dec 9, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 41.13 KB (0%) 823 ms (0%) 783 ms (-40.77% 🔽) 1.7 s
thirdweb (cjs) 104.48 KB (0%) 2.1 s (0%) 2.5 s (+57.6% 🔺) 4.6 s
thirdweb (minimal + tree-shaking) 4.37 KB (0%) 88 ms (0%) 68 ms (-62.17% 🔽) 156 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 42 ms (-51.61% 🔽) 52 ms
thirdweb/react (minimal + tree-shaking) 16.99 KB (0%) 340 ms (0%) 621 ms (+92.26% 🔺) 960 ms

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 50.72%. Comparing base (3268af6) to head (06170ae).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/injected/index.ts 0.00% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5668   +/-   ##
=======================================
  Coverage   50.72%   50.72%           
=======================================
  Files        1092     1092           
  Lines       57213    57209    -4     
  Branches     4630     4629    -1     
=======================================
+ Hits        29019    29020    +1     
+ Misses      27478    27473    -5     
  Partials      716      716           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 3268af6
packages 47.21% <0.00%> (+<0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
packages/thirdweb/src/wallets/injected/index.ts 36.78% <0.00%> (+0.55%) ⬆️

... and 3 files with indirect coverage changes

@joaquim-verges joaquim-verges merged commit 485dcc6 into main Dec 9, 2024
32 of 35 checks passed
@joaquim-verges joaquim-verges deleted the fix_Add_chain_fallback_for_wallet_switching branch December 9, 2024 22:02
@jnsdls jnsdls mentioned this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants