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

Handle isContractDeployed error on contract page #5165

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

MananTank
Copy link
Member

@MananTank MananTank commented Oct 24, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR enhances error handling for contract validation in the layout.tsx file by ensuring that if the contract check fails, it defaults to false instead of throwing an error.

Detailed summary

  • Updated the isValidContract assignment to handle errors gracefully by using .catch(() => false) on the isContractDeployed(contract) call.

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

Copy link

vercel bot commented Oct 24, 2024

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

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 9:52pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Oct 24, 2024 9:52pm
thirdweb_playground ⬜️ Skipped (Inspect) Oct 24, 2024 9:52pm
wallet-ui ⬜️ Skipped (Inspect) Oct 24, 2024 9:52pm

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 24, 2024 21:34 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 24, 2024 21:34 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 24, 2024 21:34 Inactive
Copy link

changeset-bot bot commented Oct 24, 2024

⚠️ No Changeset found

Latest commit: 8e43e34

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

Copy link

graphite-app bot commented Oct 24, 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.

@MananTank MananTank marked this pull request as ready for review October 24, 2024 21:34
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 24, 2024
Copy link
Member Author

MananTank commented Oct 24, 2024

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

Join @MananTank and the rest of your teammates on Graphite Graphite

@MananTank MananTank changed the title Handle isContractDeployed error Handle isContractDeployed error on contract page Oct 24, 2024
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.42%. Comparing base (74e52c0) to head (8e43e34).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5165   +/-   ##
=======================================
  Coverage   45.42%   45.42%           
=======================================
  Files        1065     1065           
  Lines       55145    55145           
  Branches     3970     3970           
=======================================
  Hits        25049    25049           
  Misses      29404    29404           
  Partials      692      692           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 74e52c0
packages 40.44% <ø> (ø)

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

Copy link
Contributor

github-actions bot commented Oct 24, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.9 KB (+0.07% 🔺) 859 ms (+0.07% 🔺) 326 ms (-0.97% 🔽) 1.2 s
thirdweb (cjs) 102.73 KB (0%) 2.1 s (0%) 516 ms (+9.33% 🔺) 2.6 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 86 ms (+892.86% 🔺) 183 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 76 ms (+2141.38% 🔺) 86 ms
thirdweb/react (minimal + tree-shaking) 17.34 KB (0%) 347 ms (0%) 68 ms (+134.83% 🔺) 414 ms

Copy link

graphite-app bot commented Oct 24, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on improving error handling when checking if a contract is deployed. It ensures that if the contract check fails, it will not throw an error but instead return `false`.

### Detailed summary
- Modified `isValidContract` assignment to handle errors gracefully by using `.catch(() => false)` instead of letting the promise reject.
- Ensured that the flow continues to call `notFound()` if the contract is not valid.

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

<!-- end pr-codex -->
@jnsdls jnsdls force-pushed the 10-25-handle_iscontractdeployed_error branch from b707b1f to 8e43e34 Compare October 24, 2024 21:49
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 24, 2024 21:49 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 24, 2024 21:49 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 24, 2024 21:49 Inactive
@graphite-app graphite-app bot merged commit 8e43e34 into main Oct 24, 2024
30 checks passed
@graphite-app graphite-app bot deleted the 10-25-handle_iscontractdeployed_error branch October 24, 2024 21:52
@vercel vercel bot temporarily deployed to Production – wallet-ui October 24, 2024 21:52 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 October 24, 2024 21:52 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground October 24, 2024 21:52 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants