Skip to content

Commit 14f6999

Browse files
authored
fix(app-shell): datasource preview 不再报告读副本数量 (objectstack#4468) (#3143)
`datasource.readReplicas` is retired in @objectstack/spec 17 — nothing in the platform ever opened a replica connection, so the "2 read replicas" pill reported a configuration that did not exist. The pill did not echo the draft back, which is what a preview panel is for and is harmless. It concluded. And it was the only surface in either repo that acknowledged the key at all, so it was the whole of the evidence that the feature worked. Companion to objectstack-ai/objectstack#4481.
1 parent 4bf612c commit 14f6999

2 files changed

Lines changed: 33 additions & 6 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
"@object-ui/app-shell": patch
3+
---
4+
5+
Datasource preview stops reporting read replicas
6+
7+
`DatasourcePreview` rendered a "2 read replicas" pill from
8+
`datasource.readReplicas`. That key is retired in `@objectstack/spec` 17
9+
(objectstack#4468): nothing in the platform ever opened a replica connection —
10+
no driver reads the key and no query path splits reads from writes — so the
11+
pill confirmed a configuration that did not exist.
12+
13+
It is worth being precise about what the pill did wrong, because a preview
14+
panel echoing the draft back is normally harmless. This one did not echo, it
15+
concluded: an author who configured replicas, saved, and saw the pill light up
16+
got the platform telling them it had understood. It was the only surface in
17+
either repo that acknowledged the key at all, which made it the whole of the
18+
evidence that the feature worked. `packages/spec/liveness/README.md` has the
19+
standing rule — an authoring or preview renderer is never a runtime consumer —
20+
and a 2026-06 sweep that classified 13 properties on preview-renderer evidence
21+
alone was later found wrong on 10 of them.
22+
23+
Read-replica routing does not exist yet; it is tracked as a feature request
24+
rather than reflected in the UI as though it shipped.

packages/app-shell/src/views/metadata-admin/previews/DatasourcePreview.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
* verbatim; nested objects render as their key count.
1616
* • Pool, SSL, retry, health-check pills derived from optional
1717
* sibling blocks.
18-
* • Read-replica count and capabilities chip strip.
18+
* • Capabilities chip strip.
19+
*
20+
* A read-replica count pill used to sit in that strip. It is gone with
21+
* `datasource.readReplicas` itself (objectstack#4468): nothing in the
22+
* platform ever opened a replica connection, so the pill reported a
23+
* configuration that did not exist — and, being the only surface that
24+
* acknowledged the key at all, it was the strongest signal an author had
25+
* that it worked. A preview echoes what was typed; it can never stand in
26+
* for a runtime consumer (`packages/spec/liveness/README.md`).
1927
*
2028
* The preview never attempts a live "test connection" — it runs
2129
* inside the editor sandbox and must remain side-effect free.
@@ -24,7 +32,6 @@
2432
import * as React from 'react';
2533
import {
2634
Activity,
27-
Copy,
2835
Database,
2936
HardDrive,
3037
Lock,
@@ -70,7 +77,6 @@ export function DatasourcePreview({ name, draft }: MetadataPreviewProps) {
7077
const ssl = d.ssl as Record<string, unknown> | boolean | undefined;
7178
const retryPolicy = d.retryPolicy as Record<string, unknown> | undefined;
7279
const healthCheck = d.healthCheck as Record<string, unknown> | undefined;
73-
const readReplicas = Array.isArray(d.readReplicas) ? d.readReplicas : [];
7480
const capabilities = Array.isArray(d.capabilities) ? (d.capabilities as string[]) : [];
7581

7682
// External Datasource Federation (ADR-0015): a non-'managed' schemaMode
@@ -113,9 +119,6 @@ export function DatasourcePreview({ name, draft }: MetadataPreviewProps) {
113119
</span>
114120
<Pill icon={Power} label={active ? 'Active' : 'Disabled'} tone={active ? 'green' : 'gray'} />
115121
{isDefault && <Pill icon={Star} label="default" tone="amber" />}
116-
{readReplicas.length > 0 && (
117-
<Pill icon={Copy} label={`${readReplicas.length} read replica${readReplicas.length === 1 ? '' : 's'}`} />
118-
)}
119122
</div>
120123
</div>
121124
</div>

0 commit comments

Comments
 (0)