Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Nov 20, 2024

CNCT-2422


PR-Codex overview

This PR focuses on improving error handling during the migration from sharded to enclave wallets in the native-connector.ts and web-connector.ts files. It replaces console.warn statements with console.error and throws an error to better inform users of issues during the login process.

Detailed summary

  • In native-connector.ts:

    • Replaced console.warn with console.error for migration failure.
    • Added a throw new Error statement for better error handling.
  • In web-connector.ts:

    • Replaced console.warn with console.error for migration failure.
    • Added a throw new Error statement for better error handling.

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

@linear
Copy link

linear bot commented Nov 20, 2024

@vercel
Copy link

vercel bot commented Nov 20, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ❌ Failed (Inspect) Nov 21, 2024 5:31pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 5:31pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 5:31pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 5:31pm

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2024

⚠️ No Changeset found

Latest commit: 48181a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 20, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Nov 20, 2024
Comment on lines 95 to 96
console.error(
"Failed to migrate from sharded to enclave wallet, continuing with sharded wallet",
);
throw new Error("Something went wrong logging into your wallet");
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be a logical contradiction between the console message and the error handling. The message states "continuing with sharded wallet", but the subsequent throw statement prevents any continuation. Consider either:

  1. Removing the throw to allow fallback to sharded wallet as indicated
  2. Updating the console message to accurately reflect that migration failure is a fatal error

The current implementation could mislead developers debugging wallet migration issues.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Copy link
Member

Choose a reason for hiding this comment

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

worried about this because we still see some errors on DD about some users not being migrated - can we double check that first?

Copy link
Contributor Author

@gregfromstl gregfromstl Nov 21, 2024

Choose a reason for hiding this comment

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

There's more context on this here: https://thirdwebdev.slack.com/archives/C081B62FQ2K/p1732130602707349

Firekeeper and Jake wanted any migration failure to immediately enter a failed state and not roll over to sharded wallets

@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.97 KB (0%) 900 ms (0%) 2.8 s (+11.68% 🔺) 3.7 s
thirdweb (cjs) 105.01 KB (0%) 2.2 s (0%) 5.1 s (-25.04% 🔽) 7.2 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 113 ms (0%) 180 ms (-7.43% 🔽) 292 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 92 ms (-43.73% 🔽) 102 ms
thirdweb/react (minimal + tree-shaking) 18.38 KB (0%) 368 ms (0%) 384 ms (+0.1% 🔺) 751 ms

@codecov
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

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

Project coverage is 43.88%. Comparing base (6bd9683) to head (48181a4).
Report is 166 commits behind head on main.

Files with missing lines Patch % Lines
...irdweb/src/wallets/in-app/web/lib/web-connector.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5473   +/-   ##
=======================================
  Coverage   43.88%   43.88%           
=======================================
  Files        1075     1075           
  Lines       55944    55943    -1     
  Branches     3909     3910    +1     
=======================================
  Hits        24550    24550           
+ Misses      30711    30710    -1     
  Partials      683      683           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 5a5673e
packages 38.62% <0.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...irdweb/src/wallets/in-app/web/lib/web-connector.ts 0.27% <0.00%> (+<0.01%) ⬆️

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Nov 20, 2024
Copy link
Contributor Author

gregfromstl commented Nov 20, 2024

Merge activity

  • Nov 20, 2:43 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 2, 2:11 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

@github-actions
Copy link
Contributor

This PR has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Nov 29, 2024
@github-actions github-actions bot closed this Dec 1, 2024
@gregfromstl
Copy link
Contributor Author

Open

@gregfromstl gregfromstl reopened this Dec 2, 2024
@github-actions github-actions bot removed the Stale label Dec 3, 2024
@github-actions
Copy link
Contributor

This PR has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.

@github-actions github-actions bot added Stale and removed Stale labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants