Expose replacement implementations of `QueryClient` APIs in UI
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- frontend
调研方向
首先阅读被阻塞的 issue #8530 和 ADR 0020 PR #131,以了解 guard 设计和待完成的对齐工作。检查 createUIQueryClient API,以及此处所述的 react-router v6 createHashRouter/RouterProvider 迁移。完成的标准是为乐观更新、路由加载器和 getQueryCache 变更选择并交付获批准的替代方案。
由索引模型根据 Issue 内容生成。
描述
Tracks follow-up work after the initial guard implementation (#8530) and ADR-level alignment on PR #131.
Subissues
Replacement: optimistic-update alternative for data-service-backed state (setQueryData / setQueriesData)
#8530 throws on these for data-service keys. This ticket designs and ships a sanctioned alternative so feature teams can still do optimistic UI updates. Options (pending ADR 0020 PR #131 resolution):
- Messenger-dispatched primitive:
dataService.setOptimisticCacheData(queryKey, updater)that writes to the background cache and propagates viacacheUpdated→hydrate(). Loses synchronous-write semantics; cold-path MV3 SW wake-up (100–300ms) makes worst case materially slower than the canonical pattern. - Sanctioned UI facade with explicit rollback on mutation failure. Preserves synchronous-write semantics.
- Explicit ADR statement that optimistic updates for data-service keys are out of scope under Option A.
File after PR #131 alignment on which option to pursue.
Replacement: route-loader integration for data-service keys (ensureQueryData / ensureInfiniteQueryData)
#8530 throws on these for data-service keys. This ticket designs and ships a sanctioned loader-compatible alternative. Extension is mid-transition to react-router v6 data-router (createHashRouter + RouterProvider), where loader: () => queryClient.ensureQueryData(...) is the natural pattern. Options (pending PR #131 resolution):
ensureDataServiceQueryData(routeMessenger, queryKey)— dispatches to the service via the route messenger, awaits cache population. Composes with the UI messengers ADRRouteMessengerauthorization boundary. Requires route-messenger-manager or closure-injected handle (UI messengers ADR Option 1B).- Block loaders from consuming data-service keys; treat route data loading as React-side only (
useSuspenseQueryin route component).
File after PR #131 alignment on which option to pursue.
getQueryCache() facade**
client.getQueryCache().build/.add/.remove bypasses all instance-shadowing from #8530. Two design options:
- Shadow
getQueryCacheto return a facade that gates mutating methods by key prefix - Stop returning a raw
QueryClientfromcreateUIQueryClient— return a narrower facade (breaking API change)
File after Layer 1 (#8530) is validated and a design option is chosen.
Dependencies
Blocked on: #8530 (Layer 1 guards)
Blocked on (replacements): ADR 0020 PR #131 resolution
- 主要语言
- TypeScript
- 星标
- 424
- 派生
- 311
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 446
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetaMask/core 的其他 Issue
-
EIP-1898 object selectors fail before downstream RPC in eth-json-rpc-middleware 26.0.0可能已有人在做 @debojyoti10CC 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
CI: "Validate changelog diffs" job fails on every fork-sourced pull request可能已有人在做 @Roxen-AS 于 37 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
platform-api-docs: `scan` strategy misses ESM-only packages, which ship `.d.ts` rather than `.d.cts`可能已有人在做 @gaohan1994 于 38 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[utils] Replace the `uuid` dependency with `crypto.randomUUID()`可能已有人在做 @avantikonde 于 51 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
MetaMask/core#10210 · 1 个 reaction ·
维护者通常 1 天内回复
-
[utils] `toWei` accepts fractional wei and returns wrong values可能已有人在做 @Roxen-AS 于 37 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
Flaky test: selecting a portion just after inserting it can also match its Change and Delete buttons未关闭ready-for-agent
难度 2/5 1-3 小时 新手友好度 84/100
linagora/dcs-onlyoffice#172 ·
-
bug follow-up
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
nightly-tests
难度 2/5 1-3 小时 新手友好度 68/100
BlackBeltTechnology/pi-agent-dashboard#1226 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
danielmiessler/LifeOS#3028 ·
维护者通常 5 天内回复
-
execute_sql cannot create a SQLite trigger or a PostgreSQL BEGIN ATOMIC function: the statement is cut at the semicolons inside its body可能已有人在做 @goranai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复