Skip to content

Commit c05a8a0

Browse files
fix(cloud-connection): a dry-run re-install answers a resolver refusal of either side with its 422, never a throw (#35347)
Fixes #34846 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:本地安装接口带 `dryRun: true` 预演重装时,如果「已装副本」或「新包」被今天的校验拒收,现在回 422 并点名是哪一份被拒,而不是直接抛错(传输层表现为 500)。 - 为什么改:真装一次早已回 422 并点名已装副本;同一个包预演却抛错,预演和真装的回答不一致。 - 风险与回滚:低。只在预演路径上、调用 `planUpgrade` 之前加一次与真装 2c″ 完全相同的预解析;两份都合法时行为不变(CONTROL 用例钉住)。回滚即 revert 本 PR。 - 先看:`packages/cloud-connection/src/marketplace-install-local-plugin.ts` 的 `answerUpgradeDryRun` 新增的三行与抽出的 `upgradeSideRefusal`;其次新测试文件 `marketplace-install-local-dry-run-refusal-34846.test.ts`。 - 两分钟验证:`pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-dry-run-refusal-34846.test.ts`,预期 4 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes - `answerUpgradeDryRun` (the `dryRun: true` branch of `POST /api/v1/marketplace/install-local`) now pre-resolves both sides before `planUpgrade` folds them, and answers a resolver refusal with `declaredRefusalAnswer(manifestId, err, side)`: the refusal's own declared status and code, with the sentence naming the stored copy (and the remedy) or the incoming package. Before, the refusal left the door as a throw. - Step 2c″'s pre-resolve (incoming side first, then the installed side, each in its own `try`) is extracted unchanged into one module-private helper, `upgradeSideRefusal`, which both readers now call: `evaluateDeclaredRenames` and `answerUpgradeDryRun`. An undeclared throw is still rethrown, never relabelled. - The 503 for a runtime with no `planUpgrade` is still answered first, as before. - Patch changeset for `@objectstack/cloud-connection`. ## Tests New file `packages/cloud-connection/src/marketplace-install-local-dry-run-refusal-34846.test.ts`, driven through the real handler (harness as in the step 2c″ refusal suite, with `planUpgrade` being the real fold plus `comparePackageVersions`): - installed copy refused, incoming well-formed: 422 `INVALID_ARTIFACT_PACKAGE_ENTRY`, message starts with the installed-copy sentence, no plan read, nothing registered or synced, ledger byte-identical; - incoming refused, installed well-formed: 422 naming the incoming package; - both refused: the incoming refusal, asked first; - CONTROL: both well-formed: 200 with the plan, `planUpgrade` called once. Red first, at `9e2b802c` (test only, code unchanged): 3 failed, 1 passed (the CONTROL); each failure is the thrown `Release artifact packages[0] is not a package entry (ADR-0130 D4): ... indexes[].unique: true was retired ...`. Ablation (committed fix at `d09cd19e`; the test imports the plugin from `src`, so no rebuild is involved): `scripts/ablation-replace.mjs` deleted the dry run's `if (refused) return c.json(refused.body, refused.status);` (anchor 1 to 0, blob `ac4d332f` to `e09c14ed`), giving 3 failed and 1 passed. It then restored the file: blob `ac4d332f` equals HEAD, and `git diff HEAD` is empty. <details><summary>Package suite and typecheck at 986d579</summary> `pnpm --filter @objectstack/cloud-connection exec vitest run --maxWorkers=2 && pnpm --filter @objectstack/cloud-connection typecheck` under the verify lock: `VERDICT command-exit 0`, Test Files 91 passed (91), Tests 1330 passed (1330); typecheck ran `tsc --noEmit && tsc --noEmit -p tsconfig.test.json` (the test config includes `src/**/*`, so the new file is compiled). </details> ## Acceptance notes - The transport's 500 for the old throw was not re-measured. It is taken from the real-runtime refusal suite's header, as the card says. - The incoming-side refusal reaches the dry run only on a runtime that predates the step-1c code judgements. A runtime that carries those judgements answers the same refusal at step 1c first, as the real install does. The installed side is read by no earlier step, so its refusal reaches the dry run on every runtime. That case is the one this fixes in practice. - The dispatch named a new test file for this card. The step 2c″ refusal suite would also have been a home, as a top-level `describe`. The harness was copied from it rather than shared. ## Verification <details><summary>Derived gate families (dispatch-gates --commands, 71) at 986d579</summary> 69 exit 0. Two were NOT MEASURED, each exiting 3 on its own prerequisite: - `node scripts/check-plugin-teardown-shape.mjs --self-test` needs an unshallow clone for its pinned positive control. It is a checker-health check only. - `pnpm check:dual-build-cjs-loads` reads every package's `dist`, and this worktree built only the closure of cloud-connection. Both are left to CI. `dispatch-gates --ran` reconciliation: 71 derived, 69 run, 2 NOT-MEASURED (derived from the recorded exit 3), 0 UNRUN. `overlap-check --branch=HEAD`: `VERDICT clean exit 0`, merges cleanly with origin/main. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CaysxGzF62ACvZ1x9x)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1aac465 commit c05a8a0

3 files changed

Lines changed: 317 additions & 22 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
---
4+
5+
fix(cloud-connection): a dry-run re-install answers a refused installed copy or incoming package with a 422, never a 500
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`POST /api/v1/marketplace/install-local` with `dryRun: true` compares the installed copy (the body the last install stored) with the incoming version. When today's artifact resolver refused either body (for example, a stored copy that still carries a retired key such as a bare `indexes[].unique: true`), the dry run threw, and the transport answered `500 INTERNAL_ERROR`. It now answers the way the real install already does: the refusal's own `422` and code (`INVALID_ARTIFACT_PACKAGE_ENTRY` and its siblings). When the stored copy is refused, the message names that copy and the way out: uninstall the package, then install the new version. When the incoming package is refused, the message names the incoming package. Nothing is planned or written. A dry run whose two bodies both resolve answers the plan exactly as before.
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* [#34846] The dry run (`dryRun: true`, step 2a′) compares the installed copy
5+
* — the body the last install stored in the ledger — with the incoming
6+
* version through the `manifest` service's `planUpgrade`, which folds each
7+
* side through the artifact resolver (`resolveStackCollection`). When today's
8+
* resolver refuses either side, the dry run answers as the real install does
9+
* at step 2c″: that refusal's own declared status and code, the sentence
10+
* naming whose body was refused (the stored copy and the way out, or the
11+
* incoming package), and nothing planned or written. Before, the refusal was
12+
* thrown out of the door, and the transport, which renders no `422`, answered
13+
* `500 INTERNAL_ERROR`.
14+
*
15+
* Driven through the real `POST /api/v1/marketplace/install-local` handler
16+
* under the `single` posture, over a runtime that predates the step-1c code
17+
* judgements (`@objectstack/runtime` mocked without `collectJobsWithoutBody` /
18+
* `collectHooksWithoutBody`, as in
19+
* `marketplace-install-local-resolver-refusal-34432.test.ts`), so an incoming
20+
* body the resolver refuses reaches the dry run at all: a runtime carrying
21+
* those judgements answers it at step 1c first. The installed side is read by
22+
* no step before the dry run, so its refusal reaches it on every runtime.
23+
* `planUpgrade` here is the comparison the real service runs (each side folded
24+
* by `resolveStackCollection`, then `comparePackageVersions`), as in
25+
* `marketplace-install-local-upgrade-plan.test.ts`.
26+
*/
27+
28+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
29+
import { mkdtempSync, readdirSync, readFileSync, rmSync } from 'node:fs';
30+
import { join } from 'node:path';
31+
import { tmpdir } from 'node:os';
32+
33+
vi.mock('@objectstack/runtime', () => ({
34+
SeedLoaderService: class {
35+
async loadStored() { return this.load(); }
36+
async load() { return { summary: { totalInserted: 0, totalUpdated: 0, totalSkipped: 0 }, errors: [] }; }
37+
async buildDependencyGraph(objects: string[]) { return { objects }; }
38+
},
39+
resolveSeedLocaleForLoad: async () => undefined,
40+
appDefaultSeedLocale: () => undefined,
41+
describeSeedLocale: () => 'none',
42+
}));
43+
44+
import { resolveStackCollection } from '@objectstack/core';
45+
import { comparePackageVersions } from '@objectstack/metadata-core';
46+
import { MarketplaceInstallLocalPlugin } from './marketplace-install-local-plugin.js';
47+
import { declareInstallerPlatformOwner, installerAuthService, withInstallerGrants } from './install-local-principal.fixtures.js';
48+
import { LocalManifestSource } from './local-manifest-source.js';
49+
50+
type Handler = (c: any) => Promise<any>;
51+
type Row = Record<string, any>;
52+
53+
const ROUTE = '/api/v1/marketplace/install-local';
54+
const SUITE = 'com.example.suite';
55+
56+
const LEAD = { name: 'crm_lead', label: 'Lead', fields: { account_name: { type: 'text', label: 'Account' } } };
57+
const ACCOUNT = { name: 'crm_account', label: 'Account', fields: { name: { type: 'text', label: 'Name' } } };
58+
/** An object still carrying the retired bare `indexes[].unique: true`, which the package-entry contract refuses. */
59+
const RETIRED_ACCOUNT = { ...ACCOUNT, indexes: [{ fields: ['name'], unique: true }] };
60+
61+
const entry = (id: string, objects: Row[]): Row => ({
62+
manifest: { id, name: id, version: '1.0.0', type: 'module', objects },
63+
});
64+
65+
/**
66+
* A composed artifact: `packages[]` and no top-level `objects`, so every reader goes through the resolver.
67+
* Its top-level `datasources` map (empty) is what step 2a, the datasource holder, reads instead of
68+
* resolving the packages, so an incoming body the resolver refuses reaches the dry run.
69+
*/
70+
const composed = (packages: unknown): Row => ({ id: SUITE, name: 'Suite', version: '1.0.0', type: 'app', datasources: {}, packages });
71+
const WELL_FORMED = (): Row[] => [entry(`${SUITE}.core`, [ACCOUNT]), entry(`${SUITE}.leads`, [LEAD])];
72+
const REFUSED = (): Row[] => [entry(`${SUITE}.core`, [RETIRED_ACCOUNT]), entry(`${SUITE}.leads`, [LEAD])];
73+
74+
const INCOMING_SENTENCE = `Package '${SUITE}' cannot be installed:`;
75+
const INSTALLED_SENTENCE = `The installed copy of package '${SUITE}', stored here by its last install, is refused by this runtime:`;
76+
77+
function makeRawApp() {
78+
const routes = new Map<string, Handler>();
79+
return {
80+
routes,
81+
get: (p: string, h: Handler) => routes.set(`GET ${p}`, h),
82+
post: (p: string, h: Handler) => routes.set(`POST ${p}`, h),
83+
delete: (p: string, h: Handler) => routes.set(`DELETE ${p}`, h),
84+
};
85+
}
86+
87+
function makeC(reqBody: any) {
88+
return {
89+
req: {
90+
url: `http://localhost:3000${ROUTE}`,
91+
raw: new Request(`http://localhost:3000${ROUTE}`),
92+
json: async () => reqBody,
93+
param: () => undefined,
94+
header: () => undefined,
95+
query: () => undefined,
96+
},
97+
json: vi.fn((payload: any, status?: number) => ({ payload, status: status ?? 200 })),
98+
};
99+
}
100+
101+
const fold = (artifact: unknown) => ({
102+
objects: resolveStackCollection(artifact, 'objects'),
103+
objectExtensions: resolveStackCollection(artifact, 'objectExtensions'),
104+
data: resolveStackCollection(artifact, 'data'),
105+
});
106+
107+
async function boot(dir: string) {
108+
const rawApp = makeRawApp();
109+
const hooks = new Map<string, any>();
110+
const register = vi.fn();
111+
const syncSchemas = vi.fn(async () => undefined);
112+
const planUpgrade = vi.fn(async (installed: unknown, incoming: unknown) => ({
113+
plan: comparePackageVersions(fold(installed), fold(incoming)),
114+
environment: { columns: [], removedObjects: [], seeds: [] },
115+
}));
116+
const services: Record<string, any> = {
117+
manifest: { register, planUpgrade },
118+
auth: installerAuthService(),
119+
objectql: withInstallerGrants({ syncSchemas, registry: { getObject: () => undefined } }),
120+
metadata: {},
121+
};
122+
const ctx = {
123+
hook: (e: string, h: any) => hooks.set(e, h),
124+
getService: (name: string) => {
125+
if (name === 'http-server') return { getRawApp: () => rawApp };
126+
const svc = services[name];
127+
if (svc === undefined) throw new Error(`no ${name}`);
128+
return svc;
129+
},
130+
registerService: (name: string, svc: unknown) => { services[name] = svc; },
131+
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() },
132+
};
133+
const plugin = new MarketplaceInstallLocalPlugin({ controlPlaneUrl: 'off', storageDir: dir });
134+
await plugin.start(ctx as any);
135+
await hooks.get('kernel:ready')?.();
136+
// The door registers its own plugin manifest at boot; only the dry run's registrations count.
137+
register.mockClear();
138+
return {
139+
dryRun: (manifest: unknown) => rawApp.routes.get(`POST ${ROUTE}`)!(makeC({ manifest, dryRun: true })),
140+
register,
141+
syncSchemas,
142+
planUpgrade,
143+
};
144+
}
145+
146+
let dir: string;
147+
let posture: string | undefined;
148+
let restoreOwner: () => void;
149+
beforeEach(() => {
150+
dir = mkdtempSync(join(tmpdir(), 'mil-dry-run-refusal-'));
151+
posture = process.env.OS_TENANCY_POSTURE;
152+
process.env.OS_TENANCY_POSTURE = 'single';
153+
restoreOwner = declareInstallerPlatformOwner('admin');
154+
});
155+
afterEach(() => {
156+
restoreOwner();
157+
rmSync(dir, { recursive: true, force: true });
158+
if (posture === undefined) delete process.env.OS_TENANCY_POSTURE;
159+
else process.env.OS_TENANCY_POSTURE = posture;
160+
vi.restoreAllMocks();
161+
});
162+
163+
/** The ledger entry an earlier install would have written: `manifest` is the stored copy. */
164+
function seedInstalledCopy(manifest: Row): void {
165+
new LocalManifestSource(dir).write({
166+
packageId: SUITE,
167+
versionId: 'local',
168+
manifestId: SUITE,
169+
version: '1.0.0',
170+
manifest,
171+
installedAt: '2026-01-01T00:00:00.000Z',
172+
installedBy: 'admin',
173+
withSampleData: false,
174+
});
175+
}
176+
177+
/** Every ledger file and its bytes. */
178+
const ledgerFiles = (): Record<string, string> =>
179+
Object.fromEntries(readdirSync(dir).sort().map((f) => [f, readFileSync(join(dir, f), 'utf8')]));
180+
181+
/** No plan read, nothing registered or synced, and the ledger byte-for-byte as it was. */
182+
function expectNothingPlannedOrWritten(rt: Awaited<ReturnType<typeof boot>>, before: Record<string, string>) {
183+
expect(rt.planUpgrade).not.toHaveBeenCalled();
184+
expect(rt.register).not.toHaveBeenCalled();
185+
expect(rt.syncSchemas).not.toHaveBeenCalled();
186+
expect(ledgerFiles()).toEqual(before);
187+
}
188+
189+
describe('#34846 — a dry-run re-install answers a resolver refusal of either side as the real install does, never a throw', () => {
190+
it('the installed copy refused, the incoming version well-formed: the resolver\'s 422 naming the stored copy and the remedy', async () => {
191+
const rt = await boot(dir);
192+
seedInstalledCopy(composed(REFUSED()));
193+
const before = ledgerFiles();
194+
195+
const res = await rt.dryRun(composed(WELL_FORMED()));
196+
197+
expect(res.status, JSON.stringify(res.payload)).toBe(422);
198+
expect(res.payload.success).toBe(false);
199+
expect(res.payload.error.code).toBe('INVALID_ARTIFACT_PACKAGE_ENTRY');
200+
expect(res.payload.error.message.startsWith(INSTALLED_SENTENCE), res.payload.error.message).toBe(true);
201+
expect(res.payload.error.message).not.toContain(INCOMING_SENTENCE);
202+
expectNothingPlannedOrWritten(rt, before);
203+
});
204+
205+
it('the incoming version refused over a well-formed installed copy: the resolver\'s 422 naming the incoming package', async () => {
206+
const rt = await boot(dir);
207+
seedInstalledCopy(composed(WELL_FORMED()));
208+
const before = ledgerFiles();
209+
210+
const res = await rt.dryRun(composed(REFUSED()));
211+
212+
expect(res.status, JSON.stringify(res.payload)).toBe(422);
213+
expect(res.payload.success).toBe(false);
214+
expect(res.payload.error.code).toBe('INVALID_ARTIFACT_PACKAGE_ENTRY');
215+
expect(res.payload.error.message.startsWith(INCOMING_SENTENCE), res.payload.error.message).toBe(true);
216+
expect(res.payload.error.message).not.toContain('installed copy');
217+
expectNothingPlannedOrWritten(rt, before);
218+
});
219+
220+
it('both refused: the incoming package\'s refusal is the answer, asked first, as at step 2c″', async () => {
221+
const rt = await boot(dir);
222+
seedInstalledCopy(composed(REFUSED()));
223+
const before = ledgerFiles();
224+
225+
const res = await rt.dryRun(composed(REFUSED()));
226+
227+
expect(res.status, JSON.stringify(res.payload)).toBe(422);
228+
expect(res.payload.error.code).toBe('INVALID_ARTIFACT_PACKAGE_ENTRY');
229+
expect(res.payload.error.message.startsWith(INCOMING_SENTENCE), res.payload.error.message).toBe(true);
230+
expectNothingPlannedOrWritten(rt, before);
231+
});
232+
233+
it('CONTROL: a well-formed installed copy and a well-formed incoming version answer the plan, as before', async () => {
234+
const rt = await boot(dir);
235+
seedInstalledCopy(composed(WELL_FORMED()));
236+
const before = ledgerFiles();
237+
238+
const res = await rt.dryRun(composed(WELL_FORMED()));
239+
240+
expect(res.status, JSON.stringify(res.payload)).toBe(200);
241+
expect(res.payload.success).toBe(true);
242+
expect(res.payload.data.dryRun).toBe(true);
243+
expect(res.payload.data.installedVersion).toBe('1.0.0');
244+
expect(rt.planUpgrade).toHaveBeenCalledTimes(1);
245+
expect(rt.register).not.toHaveBeenCalled();
246+
expect(ledgerFiles()).toEqual(before);
247+
});
248+
});

‎packages/cloud-connection/src/marketplace-install-local-plugin.ts‎

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,48 @@ function declaredRefusalAnswer(
529529
};
530530
}
531531

532+
/**
533+
* [#34583, #34846] Both sides of a re-install folded through the artifact
534+
* resolver FIRST, by the fold the upgrade comparison reads them by
535+
* ({@link packageUpgradeSideOf}), so a body the resolver refuses is answered
536+
* ({@link declaredRefusalAnswer}) before any reader that would throw it: the
537+
* resolver is deterministic over the same bytes, so a reader after this never
538+
* meets its refusal. Each side on its own, the incoming body first: a refusal
539+
* of the installed copy (stored by an earlier install, read to compare
540+
* against) is answered naming that copy, never as "Package 'X' cannot be
541+
* installed", which blames the incoming one. `installed` `null` (a fresh
542+
* install) or `undefined` (none can be read) folds no installed side.
543+
*
544+
* The one pre-resolve of the two readers of both sides: step 2c″'s declared
545+
* renames ({@link MarketplaceInstallLocalPlugin.evaluateDeclaredRenames}) and
546+
* the dry run's `planUpgrade` (`answerUpgradeDryRun`), so a dry-run re-install
547+
* answers the refusal the real install answers. `undefined` when neither side
548+
* is refused; an undeclared throw out of the resolver is rethrown, never
549+
* relabelled.
550+
*/
551+
function upgradeSideRefusal(
552+
manifestId: string,
553+
converted: unknown,
554+
installed: unknown,
555+
): ReturnType<typeof declaredRefusalAnswer> {
556+
try {
557+
packageUpgradeSideOf(converted);
558+
} catch (err: unknown) {
559+
const refused = declaredRefusalAnswer(manifestId, err, 'incoming');
560+
if (!refused) throw err;
561+
return refused;
562+
}
563+
if (installed === null || installed === undefined) return undefined;
564+
try {
565+
packageUpgradeSideOf(installed);
566+
} catch (err: unknown) {
567+
const refused = declaredRefusalAnswer(manifestId, err, 'installed');
568+
if (!refused) throw err;
569+
return refused;
570+
}
571+
return undefined;
572+
}
573+
532574
/**
533575
* [#21490] The one `protocol` verb this plugin calls: the runner of the
534576
* uninstall cleanups domain plugins register through
@@ -4691,26 +4733,10 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
46914733
// throws is answered as the table read's. Without this, the
46924734
// resolver's 422 was answered as the 503 below and its author was told
46934735
// to retry once the database answers.
4694-
// [#34583] Each side in its own `try`, the incoming body first: a
4695-
// refusal of the installed copy (stored by an earlier install, read
4696-
// here to compare against) is answered naming that copy, never as
4697-
// "Package 'X' cannot be installed", which blames the incoming one.
4698-
try {
4699-
packageUpgradeSideOf(converted);
4700-
} catch (err: unknown) {
4701-
const refused = declaredRefusalAnswer(manifestId, err, 'incoming');
4702-
if (!refused) throw err;
4703-
return { tables: [], refusal: refused };
4704-
}
4705-
if (installed !== null && installed !== undefined) {
4706-
try {
4707-
packageUpgradeSideOf(installed);
4708-
} catch (err: unknown) {
4709-
const refused = declaredRefusalAnswer(manifestId, err, 'installed');
4710-
if (!refused) throw err;
4711-
return { tables: [], refusal: refused };
4712-
}
4713-
}
4736+
// [#34583] Each side on its own, the incoming body first
4737+
// ({@link upgradeSideRefusal}).
4738+
const sideRefused = upgradeSideRefusal(manifestId, converted, installed);
4739+
if (sideRefused) return { tables: [], refusal: sideRefused };
47144740
let plan: { tables: InstallRenameTable[]; refusals: InstallRenameRefusal[] };
47154741
try {
47164742
plan = await planDeclaredRenames(ctx, manifestId, converted, installed);
@@ -6899,7 +6925,10 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
68996925
* A runtime whose `manifest` service answers no `planUpgrade` answers 503:
69006926
* a preview that could not run is never answered as an empty one. A
69016927
* ledger entry that will not parse is said so, and the plan is then
6902-
* against no installed version.
6928+
* against no installed version. [#34846] A side the artifact resolver
6929+
* refuses — the incoming body, or the installed copy stored by an earlier
6930+
* install — is answered with that refusal, as the real install answers it
6931+
* at step 2c″ ({@link upgradeSideRefusal}), never thrown.
69036932
*/
69046933
private answerUpgradeDryRun = async (
69056934
c: any,
@@ -6922,7 +6951,15 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
69226951
const ledgerRead = this.ledger.read(manifestId);
69236952
const installedEntry = ledgerRead.entry;
69246953
const installed = installedEntry?.manifest ? this.convertPackageBodyForward(ctx, installedEntry.manifest) : undefined;
6925-
const reading = await service.planUpgrade(installed, this.convertPackageBodyForward(ctx, manifest)) as {
6954+
const incoming = this.convertPackageBodyForward(ctx, manifest);
6955+
// [#34846] `planUpgrade` folds both sides through the artifact
6956+
// resolver, so a side it refuses is answered here first, as step 2c″
6957+
// answers it on the real install ({@link upgradeSideRefusal}): the
6958+
// refusal's own 422 naming whose body was refused. Before, the refusal
6959+
// was thrown out of the door, which the transport answers 500.
6960+
const refused = upgradeSideRefusal(manifestId, incoming, installed);
6961+
if (refused) return c.json(refused.body, refused.status);
6962+
const reading = await service.planUpgrade(installed, incoming) as {
69266963
plan: unknown;
69276964
environment: unknown;
69286965
};

0 commit comments

Comments
 (0)