Repository navigation
Commit b239a01
fix(app-shell): Browse Marketplace reads an unreachable catalog as unreachable, its raw cause behind More (#26213)
Fixes #25891
Clause-②: no
Metadata-protocol: none
## What changed
The runtime's marketplace proxy answers `502 MARKETPLACE_PROXY_FAILED`
only when its own fetch to the catalog throws
(`packages/cloud-connection/src/marketplace-proxy-plugin.ts`). Upstream
answers pass through with their own status and code. `marketplaceApi.ts`
`call()` already stamps `code` on the error. The load-error panel in
`MarketplacePage.tsx` never read it: it picked its class line by status
alone. So a runtime that could not reach the catalog read "The
marketplace catalog answered with an error (HTTP 502)", with the raw
Node text `fetch failed` in full view.
- `LoadFailure` now carries `code` and an `unreachable` class: no status
(no server answered), or `code === 'MARKETPLACE_PROXY_FAILED'`.
- The unreachable class reads `marketplace.load.unreachable`. Its raw
transport text (`fetch failed`, `Failed to fetch`) sits behind a More /
Less disclosure with a copy button, reusing the existing
`refusalDetails.more/less/copy/copied` keys, the same shape
`RefusalMessage` gives a refusal's detail. `RefusalMessage` itself is
not reused because it splits a server text into lead + rest, and here
the lead is our own sentence, not part of the text.
- Answered failures (a 403, or a 502/503/504 relayed from upstream) keep
`answeredError` with their status and the server's text in full view, as
objectui#11688 made them.
- The online / same-origin hint logic is unchanged.
- No locale pack is edited: only existing keys are used.
## Tests
`ui/packages/app-shell/src/console/marketplace/__tests__/MarketplacePage.loadFailureCause-11688.test.tsx`,
real `call()` over a stubbed `fetch`:
- flipped: the proxy's `502 MARKETPLACE_PROXY_FAILED` now reads
`marketplace.load.unreachable`, never `answeredError`; `fetch failed` is
not on screen until More is pressed, then it is, More reads Less, and
the copy button is labelled `refusalDetails.copy`. The configured-plane
hint is still drawn.
- new controls: a relayed `503 SERVICE_UNAVAILABLE` and a `403`
plain-text refusal both keep `answeredError`, their text in full view,
and no disclosure. The 503 keeps the hint and the 403 does not.
- the no-answer case (`TypeError: Failed to fetch`) also asserts the
unreachable line and that the raw text is not in full view.
Run at head `a7b293f0`, under the verify lock: `vitest run
packages/app-shell/src/console/marketplace/__tests__/MarketplacePage*`:
Test Files 9/9, Tests 67/67. The suites include
`MarketplacePage.sameOriginHint-11726.test.tsx` and
`MarketplacePage.loadingStates-12710.test.tsx` unchanged and green.
`pnpm --filter @object-ui/app-shell run type-check` passed with exit 0
(both `tsc --noEmit` and `tsconfig.test.json`). `eslint` on the two
changed files reported 0 errors and 3 warnings, all on pre-existing
lines.
Ablation, run at head `24315db2` via `scripts/ablation-replace.mjs`:
`unreachable: status === undefined || code === PROXY_UNREACHABLE_CODE,`
became `unreachable: status === undefined,`. The anchor count went from
1 to 0 and the blob from `f19da1750ab1` to `46ac6aa14f87`. The 11688
suite then had 1 failed and 9 passed; the failure was exactly the
flipped 502 case. The tool then restored the file (blob equals HEAD, and
`git diff HEAD` is empty).
## Gates
Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `a7b293f0`: 35 commands, every one run,
every one exit 0. `--ran` reconciliation: 35 derived, 35 run, 0
NOT-MEASURED, 0 UNRUN (a derived zero, exit codes recorded). `node
scripts/check-sdui-manifest.mjs` passed with exit 0, and
`scripts/sdui-manifest.*` is untouched. The roster gate flagged for
`.changeset/`, `node scripts/check-changeset-fixed.mjs`, passed with
exit 0. CI-owned families (the type-check lanes, Test UI, Lint UI) are
left to this PR's check-runs.
## Acceptance notes
- The card's literal copy names the catalog host. That needs a new
structured wire field on the proxy's failure, plus new pack keys. It is
out of this claim, as the claim's Premise records, and is a follow-up if
wanted. Today no failure the proxy returns carries the upstream host in
a field or a header, and the page never parses server prose for one
(objectui#11726).
- `MARKETPLACE_PROXY_FAILED` is compared as a string literal in
app-shell. The spec's error-code ledger lists it, but there is no
per-code exported constant to import.
- Open PR #26123 edits other regions of `MarketplacePage.tsx` (an import
near `middleTruncate.js`, a hook, `installLocal`). This diff stays out
of those regions.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 0453fab commit b239a01
3 files changed
Lines changed: 161 additions & 20 deletions
File tree
- .changeset
- ui/packages/app-shell/src/console/marketplace
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
153 | 162 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
160 | 173 | | |
161 | | - | |
| 174 | + | |
162 | 175 | | |
163 | 176 | | |
164 | 177 | | |
| |||
168 | 181 | | |
169 | 182 | | |
170 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
171 | 187 | | |
172 | | - | |
| 188 | + | |
173 | 189 | | |
| 190 | + | |
174 | 191 | | |
175 | 192 | | |
176 | 193 | | |
177 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
178 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
179 | 271 | | |
180 | 272 | | |
181 | 273 | | |
| |||
717 | 809 | | |
718 | 810 | | |
719 | 811 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
| 812 | + | |
728 | 813 | | |
729 | 814 | | |
730 | 815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
187 | 190 | | |
188 | 191 | | |
189 | | - | |
| 192 | + | |
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
196 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
197 | 202 | | |
198 | 203 | | |
199 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
200 | 244 | | |
201 | 245 | | |
202 | 246 | | |
| |||
0 commit comments