fix(app-shell): datasource preview 不再报告读副本数量(objectstack#4468 配套) - #3143
Merged
Conversation
`datasource.readReplicas` is retired in @objectstack/spec 17 (objectstack-ai/objectstack#4468) — nothing in the platform ever opened a replica connection, so the pill reported a configuration that did not exist. The pill did not merely echo the draft back, which is what a preview panel is for and is harmless. It concluded: an author who configured replicas and saw "2 read replicas" light up got the platform telling them it had understood. It was also the only surface in either repo that acknowledged the key at all, so it was the whole of the evidence that the feature worked. packages/spec/liveness/README.md has the standing rule this violated — an authoring or preview renderer is never a runtime consumer — and the 2026-06 sweep that classified 13 properties on preview-renderer evidence alone was later found wrong on 10 of them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WsgTqRF58HsQYKLsrZ5pQY
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
配套 objectstack-ai/objectstack#4481(issue objectstack-ai/objectstack#4468)。
改了什么
DatasourcePreview从datasource.readReplicas渲染一枚 "2 read replicas" 的 pill。这个 key 在@objectstack/spec17 里被退休了 —— 平台里没有任何东西打开过副本连接:没有驱动读这个 key,也没有任何查询路径区分读和写。删除:
readReplicas常量、那枚 Pill、以及随之不再使用的Copy图标 import。文件头的 feature 列表相应更新,并留下一句说明去向。为什么这不是"顺手清理"
preview 面板把草稿回显出来通常是无害的,那正是它的用途。这一枚不是回显,是结论 —— "2 read replicas"。作者配好副本、保存、看到 pill 亮起,得到的信号是平台确认它理解了配置。
而它是两个仓库里唯一承认这个 key 存在的地方,所以它就是"这个功能能用"的全部证据。
packages/spec/liveness/README.md里有一条常设规则专门讲这个:authoring / preview renderer 永远不算 runtime consumer。2026-06 那次仅凭 preview renderer 就把 13 个属性定性为live的扫描,复核后 10 个是错的。这枚 pill 是同一类错误的下游产物。验证
npx eslint packages/app-shell/src/views/metadata-admin/previews/DatasourcePreview.tsx— clean(确认没有留下未使用的 import)合并顺序
两边可以独立合并,先后都安全 —— spec 的删除不会让这段代码报错(读的是
Record<string, unknown>上的可选 key),这段代码的删除也不依赖 spec 的版本。但两边都合完之前会存在一个中间态:spec 已经拒收readReplicas,而 UI 还在数副本数量。建议贴近合并。后续
读副本路由本身立在 objectstack-ai/objectstack#4479(从查询路径的读写判定开始,不是从加字段开始)。UI 侧等那个功能真正存在时再重新出现,而不是继续替一个不存在的机制作证。
Generated by Claude Code