Skip to content

fix: guard token fetch against undefined safeAddress - #2557

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/guard-undefined-safe-address-token-fetch
Open

sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/guard-undefined-safe-address-token-fetch

Conversation

@sentry

@sentry sentry Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR addresses the "Error fetching tokens" issue (SOLID-VF) which occurred when checkBalance() in hooks/useUser.ts called fetchIsDeposited() with an undefined user.safeAddress.

The root cause was that fetchIsDeposited directly used queryClient.fetchQuery(), bypassing the enabled: !!safeAddress guard defined in isDepositedQueryOptions. This resulted in a GraphQL query being sent with address: undefined, leading to a CombinedGraphQLErrors response from The Graph API.

Changes Made:

  • Added an early return guard in hooks/useAnalytics.ts within fetchIsDeposited. If safeAddress is undefined or falsy, it now immediately returns Promise.resolve(0), preventing the invalid GraphQL query.
  • Updated the type signature of the safeAddress parameter in both isDepositedQueryOptions and fetchIsDeposited from string to string | undefined to accurately reflect its potential state and improve type safety.

Fixes SOLID-VF

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
solid-app Ignored Ignored Preview Sep 22, 2026 10:36pm UTC
solid-app-staging Ignored Ignored Preview Sep 22, 2026 10:36pm UTC

Request Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants