MetaMask / MetaMask/metamask-extension
Adopt createUIQueryClient surface guards in extension UI
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
File: ui/contexts/query-client.ts, shared/constants/data-services.ts
Size: S | Hours: 2–3
Problem
PR #41183 wired createUIQueryClient into the extension but left DATA_SERVICES = []. Once the core-side guards for the QueryClient mutation surface ship (tier-1 and tier-2 bypasses for setQueryData, setQueryDefaults, fetchQuery, etc.), the extension needs to adopt them and verify end-to-end behavior.
Solution
After core guards land:
- Upgrade
@metamask/react-data-queryinpackage.json. - Verify that the guards fire for a registered data-service key (e.g.
queryClient.setQueryData(['SomeDataService:foo'], {...})throws). - Audit the three Option C raw-TQ consumers (
useHistoricalPrices,activity-v2/hooks,useMerklRewards) to confirm their keys don't accidentally overlap with any registered data-service prefix. - Document the key-prefix boundary in a comment near
DATA_SERVICES.
Acceptance Criteria
-
@metamask/react-data-querybumped to version containing the guards - Runtime guard smoke-tested against a registered data service
- Option C consumers audited and confirmed non-overlapping
- Existing UI
useQueryusages (wrapper + Option C) unchanged and still green
Dependencies
Depends on: MetaMask/core#8530 — QueryClient surface guards
Related: PR #41183
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ui/contexts/query-client.ts and shared/constants/data-services.ts, then inspect package.json for the @metamask/react-data-query version. After the core guards land, verify the registered-key smoke case, audit useHistoricalPrices, activity-v2/hooks, and useMerklRewards for prefix overlap, and document the boundary near DATA_SERVICES while keeping existing useQuery usage green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100