Skip to content

handle empty address in fetchPublishedContracts #5702

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 11, 2024

Conversation

jnsdls
Copy link
Member

@jnsdls jnsdls commented Dec 11, 2024

partially fixes: DASH-572


PR-Codex overview

This PR refactors the fetchPublishedContracts function to improve error handling and eliminate the use of invariant for address validation. It introduces a try-catch block to handle potential errors gracefully and returns an empty array in case of invalid input or errors.

Detailed summary

  • Removed invariant checks for address and resolvedAddress.
  • Added a try-catch block to handle errors.
  • Changed error handling to return an empty array instead of throwing errors.
  • Kept the logic for fetching and processing published contracts intact.

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

Copy link

vercel bot commented Dec 11, 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 Dec 11, 2024 10:18pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Dec 11, 2024 10:18pm
thirdweb_playground ⬜️ Skipped (Inspect) Dec 11, 2024 10:18pm
wallet-ui ⬜️ Skipped (Inspect) Dec 11, 2024 10:18pm

@vercel vercel bot temporarily deployed to Preview – docs-v2 December 11, 2024 21:43 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 11, 2024 21:43 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 11, 2024 21:43 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Dec 11, 2024
Copy link
Member Author

jnsdls commented Dec 11, 2024


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

Copy link

linear bot commented Dec 11, 2024

@jnsdls jnsdls marked this pull request as ready for review December 11, 2024 21:44
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.52%. Comparing base (3d6eb96) to head (f701b2d).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5702   +/-   ##
=======================================
  Coverage   51.52%   51.52%           
=======================================
  Files        1094     1094           
  Lines       57592    57592           
  Branches     4756     4756           
=======================================
  Hits        29677    29677           
  Misses      27198    27198           
  Partials      717      717           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 3d6eb96
packages 48.23% <ø> (ø)

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

Copy link
Contributor

github-actions bot commented Dec 11, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 44.94 KB (0%) 899 ms (0%) 473 ms (+51.21% 🔺) 1.4 s
thirdweb (cjs) 110.78 KB (0%) 2.3 s (0%) 1.3 s (+48.45% 🔺) 3.5 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 37 ms (+38.67% 🔺) 149 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 10 ms (+12.09% 🔺) 20 ms
thirdweb/react (minimal + tree-shaking) 19.03 KB (0%) 381 ms (0%) 200 ms (+171.59% 🔺) 581 ms

Copy link
Contributor

graphite-app bot commented Dec 11, 2024

Merge activity

@jnsdls jnsdls force-pushed the handle_empty_address_in_fetchPublishedContracts branch from e89f8c7 to f701b2d Compare December 11, 2024 22:13
Copy link

changeset-bot bot commented Dec 11, 2024

⚠️ No Changeset found

Latest commit: f701b2d

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

@vercel vercel bot temporarily deployed to Preview – docs-v2 December 11, 2024 22:13 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 11, 2024 22:13 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 11, 2024 22:13 Inactive
@graphite-app graphite-app bot merged commit f701b2d into main Dec 11, 2024
32 checks passed
@graphite-app graphite-app bot deleted the handle_empty_address_in_fetchPublishedContracts branch December 11, 2024 22:19
@vercel vercel bot temporarily deployed to Production – thirdweb_playground December 11, 2024 22:19 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui December 11, 2024 22:19 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 December 11, 2024 22:19 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.

2 participants