Skip to content

Conversation

@kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Nov 1, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on improving error handling in the claimToBatch.ts file by replacing the use of findIndex with a loop to validate the options.content array for missing recipient addresses and claim quantities.

Detailed summary

  • Replaced the findIndex method for error checking with a for loop.
  • Added error checks for both quantity and to properties in the options.content array.
  • Updated error messages to indicate the index of the problematic item directly within the loop.

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

@vercel
Copy link

vercel bot commented Nov 1, 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 Nov 1, 2024 10:50am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 10:50am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 10:50am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 10:50am

@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2024

⚠️ No Changeset found

Latest commit: b03dc57

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 1, 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.

@kien-ngo kien-ngo marked this pull request as ready for review November 1, 2024 04:47
Copy link
Contributor Author

kien-ngo commented Nov 1, 2024

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

Join @kien-ngo and the rest of your teammates on Graphite Graphite

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 761 ms (+9.97% 🔺) 1.7 s
thirdweb (cjs) 102.91 KB (0%) 2.1 s (0%) 1.7 s (+36% 🔺) 3.8 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 52 ms (+60.8% 🔺) 148 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 135 ms (+1313.64% 🔺) 145 ms
thirdweb/react (minimal + tree-shaking) 16.98 KB (0%) 340 ms (0%) 237 ms (+129.19% 🔺) 577 ms

@codecov
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 45.36%. Comparing base (f40d247) to head (b03dc57).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../src/extensions/erc721/drops/write/claimToBatch.ts 20.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5257   +/-   ##
=======================================
  Coverage   45.36%   45.36%           
=======================================
  Files        1067     1067           
  Lines       55434    55433    -1     
  Branches     3991     3991           
=======================================
+ Hits        25147    25148    +1     
+ Misses      29596    29594    -2     
  Partials      691      691           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from f40d247
packages 40.40% <20.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
.../src/extensions/erc721/drops/write/claimToBatch.ts 88.05% <20.00%> (+2.76%) ⬆️

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 1, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR refactors the validation logic in the `claimToBatch.ts` file to improve error handling for missing recipient addresses and claim quantities. It replaces the use of `findIndex` with a `for` loop for more straightforward validation.

### Detailed summary
- Removed the use of `findIndex` for checking missing recipient addresses and claim quantities.
- Added a `for` loop to iterate through `options.content` for validation.
- Updated error messages to reflect the index of the item directly within the loop.

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

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants