Repository navigation
[tech-debt 5/5 highest risk] Don't let caller options override query enabled guards - #14778
Merged
Merged
Conversation
`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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 passedenabledreplaced the hook's own guard. For exampleuseCoinBalancewithenabled: trueran the AUDIO balance queries for non-AUDIO mints, anduseCurrentAccountcould run without a wallet. These now spread options first and setenabled: guard && options?.enabled !== false, which is whatuseUseralready 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: truewill now see its query stay disabled until the guard passes. I grepped the callers that passenabledand found only boolean conditions that are compatible with the guard. One thing to know: TanStack also accepts a function forenabled. These hooks now treat a function as "not false" and ignore it. No current caller passes one.Dropped from #14665
useGetStemsArchiveJobStatus: removed on main with the streamed stems zip (feat(stems): download all stems as one streamed zip from the API #14703).Verified
tsc: common, mobile and web show the same errors as origin/main in this checkout, all in untouched files.eslinton changed files: clean.store/upload/selectors.test.tsfailure).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