This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit b8fa223
fix(app-shell): offer Sync objects only on a federation-source datasource (#13321)
Fixes #13318
Clause-②: no
## What changes
Setup → Datasources showed **Sync objects** on every datasource row.
Since objectstack#24837 (merged as objectstack `72a302a9d`), every Sync
door refuses a datasource that is not a federation source with a `400`:
a `managed` one, declared or by default, and the platform's `default`
datasource by name. On such a row the button opened a dialog that could
only show the refusal.
`DatasourceResourcePage` now renders the existing button only when
`offersSync(row)` holds: the row's `schemaMode`, read from the `GET
/api/v1/datasources` payload the page already holds, is `external` or
`validate-only`, and the row is not `default`. Nothing else changes: no
new widget, dialog, hook, request or locale key.
- `DatasourceRow` declares `schemaMode`, typed with the spec's own
`SchemaMode` (`@objectstack/spec/data`).
- The `default` name is a literal beside a comment naming the server's
`DEFAULT_DATASOURCE_NAME`: that constant lives in
`@objectstack/service-datasource`, a server package the console does not
depend on, and the spec does not export it.
## The card's acceptance, met
From the card's **Expected**:
> The Sync action is offered only on a row whose `schemaMode` is
`external` or `validate-only`, read from the list payload the page
already holds.
Met: `offersSync` is an allow-list over the row's own `schemaMode`.
> A missing `schemaMode` reads as `managed`: the spec's default, and the
editor's own reading.
Met without a fallback: a missing value is not in the allow-list, so it
offers no Sync. (The server's list summary already serves `schemaMode:
effective.schemaMode ?? 'managed'` on every row, at objectui's
objectstack pin `06cab4849` and at objectstack `origin/main`.)
> On a managed row nothing starts a Sync. If the row says anything, it
names the remedy the server's refusal names [...]
Met by hiding the button: nothing starts a Sync, and the row says
nothing. A disabled button with a native tooltip was not chosen: the
Button primitive's disabled state sets `pointer-events-none`, so the
tooltip would not show without a new wrapper. The remedy stays the
editor's existing Schema mode select.
> The platform's `default` datasource offers no Sync either; the server
already refuses it by name.
Met: `offersSync` refuses the name first, whatever its `schemaMode`.
> No new widget, dialog or hook: the existing button's visibility or
disabled state, and the existing editor.
Met: the existing button's visibility only.
From the card's **Pins**, in the new
`DatasourceResourcePage.syncFederationOnly-13318.test.tsx`:
- (a) a row with no `schemaMode` and a `managed` row show no Sync button
(both rows render their Test button);
- (b) an `external` row and a `validate-only` row show it;
- (c) the `default` row shows none, even declared `external`;
- (d) CONTROL: on an `external` row, Sync opens the dialog, requests
`GET /api/v1/datasources/warehouse/remote-tables`, and lists the remote
tables.
Fixture triage: the objectui#13207 suite
(`DatasourceResourcePage.refusals-13207.test.tsx`) drove Sync on a
`managed` row. Its row now declares `external`: its refusal cases pin
how a refused introspection is drawn, which still applies to a
federation source (an unreachable driver, say), and `managed` was
incidental.
## Measured premises
- The list payload carries `schemaMode`:
`DatasourceAdminService.listDatasources` sets it on every summary, and
the contract `DatasourceSummary.schemaMode` is required, at the pin
`06cab4849` and at objectstack `origin/main`. No new request.
- The pin does not need to move: the console reads the row's own
`schemaMode`. `git merge-base --is-ancestor 72a302a9d origin/main` in
the objectstack checkout answers exit 0.
- The server's guard is
`ExternalDatasourceService.assertFederationSource`: the `default` name
first, then `isFederationSource` (a declared `schemaMode` that is not
`managed`).
## Verification (head `46bd4f4`)
- `pnpm exec vitest run
packages/app-shell/src/views/metadata-admin/datasource/`: Test Files 4
passed (4), Tests 27 passed (27).
- Narrowed app-shell set (the datasource directory,
`packages/app-shell/src/__tests__/`, and three tree-wide ratchet/census
tests): Test Files 31 passed (31), Tests 488 passed (488). The full
app-shell suite (1674 test files) is left to CI.
- `pnpm --filter @object-ui/app-shell type-check`: exit 0. `tsc -p
tsconfig.test.json --listFiles` lists both datasource test files the
diff touches.
- Ablation, one run: `{offersSync(ds) && (` replaced with `{true && (`
through `ablation-replace.mjs` (anchor 1 to 0, blob `1ef26d74d6e7` to
`2c02bcdbca5f`): pins (a) and (c) went red, (b) and (d) stayed green,
Tests 2 failed, 25 passed. Restored: blob equals HEAD, `git diff HEAD`
empty.
- `eslint --no-inline-config` over the datasource directory: 0 errors; 2
warnings, both on lines this diff does not touch.
- `check-changeset-presence`, `check-changeset-no-major`,
`check:new-line-citations`, `check:control-bytes`,
`check:test-path-roots`, the three `check:vi-mock-*`,
`check:changeset-claims`, `check:pending-changeset-literals`,
`check:spec-symbols`: exit 0 each. `check-governed-queue-guard --test`
on the diff: NOT GOVERNED.
## Acceptance notes
- The page header still reads "Connect external databases and sync their
tables in as objects." It is still true of the page and was left alone.
- Changeset: `.changeset/13318-datasource-sync-managed.md`,
`@object-ui/app-shell` patch.
Implemented in session
`https://claude.ai/code/session_019Bd3muSBdHUFdJiKqnsM2W`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_019Bd3muSBdHUFdJiKqnsM2W)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent cd14d8e commit b8fa223
4 files changed
Lines changed: 178 additions & 4 deletions
File tree
- .changeset
- packages/app-shell/src/views/metadata-admin/datasource
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| |||
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
177 | 210 | | |
178 | 211 | | |
179 | 212 | | |
| |||
609 | 642 | | |
610 | 643 | | |
611 | 644 | | |
612 | | - | |
613 | | - | |
614 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
615 | 650 | | |
616 | 651 | | |
617 | 652 | | |
| |||
0 commit comments