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

fix: Crash when number of pools invalid #11140

Merged
merged 4 commits into from
Mar 21, 2025

Conversation

memoyil
Copy link
Collaborator

@memoyil memoyil commented Jan 15, 2025


PR-Codex overview

This PR focuses on improving the handling of the enabled option in various hooks related to contract calls, ensuring that calls are only made when appropriate conditions are met.

Detailed summary

  • Renamed numberOfPools to poolLengthNumber for clarity.
  • Added a check for poolLengthNumber to ensure it's a safe integer and non-negative.
  • Introduced enabled option in useSingleContractMultipleData to conditionally execute calls.
  • Updated conditions in multiple hooks to respect the enabled flag before making contract calls.

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

Copy link

vercel bot commented Jan 15, 2025

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

Name Status Preview Comments Updated (UTC)
solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 11:52am
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 11:52am
7 Skipped Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 11:52am
blog ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 11:52am
bridge ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 11:52am
games ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 11:52am
gamification ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 11:52am
uikit ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 11:52am
ton ⬜️ Skipped (Inspect) Mar 20, 2025 11:52am

@@ -235,7 +236,7 @@ export function useMultipleContractSingleData<TAbi extends Abi | readonly unknow
}: // FIXME: wagmiv2
// MultipleSameDataCallParameters<TAbi, TFunctionName>): CallState<ContractFunctionResult<TAbi, TFunctionName>>[] {
MultipleSameDataCallParameters<TAbi, TFunctionName>): CallState<any>[] {
const { enabled, blocksPerFetch } = options ?? { enabled: true }
Copy link
Collaborator Author

@memoyil memoyil Jan 15, 2025

Choose a reason for hiding this comment

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

this is potential bug if options set without enabled param which causes enabled false/undefined by default which is unexpected

Copy link

changeset-bot bot commented Jan 15, 2025

⚠️ No Changeset found

Latest commit: 1ce3f7c

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 – ton January 15, 2025 12:06 Inactive
@vercel vercel bot temporarily deployed to Preview – ton January 15, 2025 12:09 Inactive
@memoyil memoyil force-pushed the feature/fix_crash_when_number_of_pools_invalid branch from 0ba841b to 705853f Compare January 15, 2025 12:11
@vercel vercel bot temporarily deployed to Preview – ton January 15, 2025 12:11 Inactive
@memoyil memoyil force-pushed the feature/fix_crash_when_number_of_pools_invalid branch from 705853f to 4792355 Compare March 20, 2025 08:57
@vercel vercel bot temporarily deployed to Preview – ton March 20, 2025 08:57 Inactive
Copy link

vercel bot commented Mar 20, 2025

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this project.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@chef-ryan chef-ryan merged commit 98fa244 into develop Mar 21, 2025
21 checks passed
@chef-ryan chef-ryan deleted the feature/fix_crash_when_number_of_pools_invalid branch March 21, 2025 03:35
chef-ryan added a commit that referenced this pull request Mar 21, 2025
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.

2 participants