Skip to content

[tech-debt 5/5 highest risk] Don't let caller options override query enabled guards - #14778

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/tech-debt-5-query-guards
Nov 12, 2026
Merged

dylanjeffers merged 1 commit into
mainfrom
fix/tech-debt-5-query-guards

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Fifth of five PRs that re-ship #14665 on current main, ordered from lowest to highest risk. Branched off main, independent of the others.

What's in it

Query hooks in common built their options as { enabled: guard, ...options }, so any caller that passed enabled replaced the hook's own guard. For example useCoinBalance with enabled: true ran the AUDIO balance queries for non-AUDIO mints, and useCurrentAccount could run without a wallet. These now spread options first and set enabled: guard && options?.enabled !== false, which is what useUser already does.

Hooks changed: useFanClubs, useWalletCoins, useUserRemixContests, useCoinExchangeRate, usePlaylistUpdates, useRemixes, useRemixesCount, useCurrentAccount, useManagers, useCoinBalance, useDestinationUsdcAccountCheck, useUSDCBalance, useUserBalanceHistory, useMintRecovery, useUserbank.

Why this tier

Highest blast radius of the set: it touches about 15 widely used hooks. Any caller that relied on overriding a guard with enabled: true will now see its query stay disabled until the guard passes. I grepped the callers that pass enabled and found only boolean conditions that are compatible with the guard. One thing to know: TanStack also accepts a function for enabled. These hooks now treat a function as "not false" and ignore it. No current caller passes one.

Dropped from #14665

Verified

  • tsc: common, mobile and web show the same errors as origin/main in this checkout, all in untouched files.
  • eslint on changed files: clean.
  • common vitest: same as main (only the pre-existing store/upload/selectors.test.ts failure).

Not verified

No device or browser testing. Screens most worth a look on RC: wallet/coin balances, buy/sell, artist coin pages, remix contests and the account/manager switcher.

🤖 Generated with Claude Code

`enabled: guard, ...options` let a caller's `enabled` replace the hook's
own guard. Spread options first and combine them, matching useUser:
`enabled: guard && options?.enabled !== false`.

From #14665.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ffaa4ff

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

@dylanjeffers
dylanjeffers merged commit 1149c58 into main Nov 12, 2026
27 checks passed
@dylanjeffers
dylanjeffers deleted the fix/tech-debt-5-query-guards branch November 12, 2026 18:14
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.

1 participant