MetaMask / MetaMask/metamask-extension

Adopt createUIQueryClient surface guards in extension UI

Open
#41,977 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

INVALID-ISSUE-TEMPLATE
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:

  1. Upgrade @metamask/react-data-query in package.json.
  2. Verify that the guards fire for a registered data-service key (e.g. queryClient.setQueryData(['SomeDataService:foo'], {...}) throws).
  3. 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.
  4. Document the key-prefix boundary in a comment near DATA_SERVICES.

Acceptance Criteria

  • @metamask/react-data-query bumped to version containing the guards
  • Runtime guard smoke-tested against a registered data service
  • Option C consumers audited and confirmed non-overlapping
  • Existing UI useQuery usages (wrapper + Option C) unchanged and still green

Dependencies

Depends on: MetaMask/core#8530 — QueryClient surface guards
Related: PR #41183

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.