Skip to content

Commit 3b76461

Browse files
committed
test(objectql,dogfood): tidy the refused-registration test headers
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kPpaFpvn6zyWoBxLN
1 parent bc1584d commit 3b76461

3 files changed

Lines changed: 11 additions & 20 deletions

File tree

‎packages/objectql/src/engine.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4996,12 +4996,9 @@ export function packageBodyObjectAndAppOwnerStampRefusal(
49964996
* walking the collections and items in the order the seam registers them, or
49974997
* `undefined`.
49984998
*
4999-
* The seam used to raise each of these on the item it was about to register,
5000-
* after `installPackage`, the objects and the apps had registered: the
5001-
* refusal propagated (install-local answered `422 PLUGIN_REGISTER_FAILED`)
5002-
* while the package record, objects and apps stayed in the live registry until
5003-
* restart, and a refused re-register of an installed id left that install
5004-
* half-replaced. Every judge here reads the item, its derived name, the
4999+
* Asked first so a body refused by one of them leaves nothing of the package
5000+
* registered, and a refused re-register of an installed id leaves that
5001+
* install as it was. Every judge here reads the item, its derived name, the
50055002
* source label and the owning id, and nothing the registry holds, so asking
50065003
* it first gives the same answer in the same words. ⛔ No second copy of any
50075004
* judge: each is the one function its own record names.

‎packages/objectql/src/package-refused-registration-withdrawn.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* boot seed of disabled packages;
2323
* - CONTROLS: a clean body registers everything as before; a body that took
2424
* over a tenant's object is not withdrawn (the withdrawal would drop the
25-
* tenant's layer); an installed id refused part-way by the registry keeps
26-
* today's state, pinned here until it has its own card.
25+
* tenant's layer); nor is an installed id refused part-way by the registry
26+
* (the withdrawal would take the installed version with it).
2727
*/
2828

2929
import { describe, it, expect } from 'vitest';
@@ -225,7 +225,7 @@ describe('[#28697] controls', () => {
225225
expect(engine.registry.getPackage(PKG), 'not withdrawn').toBeDefined();
226226
});
227227

228-
it('an installed id refused part-way by the registry: today\'s state, pinned until its own card', () => {
228+
it('an installed id refused part-way by the registry is not withdrawn', () => {
229229
const engine = new ObjectQL();
230230
engine.registerApp({ id: HOST, name: HOST, objects: [object('probe_held')] } as any);
231231
engine.registerApp({ id: PKG, name: PKG, version: '1.0.0', objects: [object('probe_a'), object('probe_old')], apps: [app('probe_app')] } as any);
@@ -235,7 +235,7 @@ describe('[#28697] controls', () => {
235235
}) as any));
236236
expect(err).toMatchObject({ code: 'OBJECT_OWNERSHIP_CONFLICT', status: 422 });
237237
const t = trace(engine);
238-
// Not withdrawn (that would take v1 with it) and not restored.
238+
// Not withdrawn: the withdrawal would take v1 with it.
239239
expect(t.pkg?.manifest.version).toBe('2.0.0');
240240
expect((engine.registry.getObject('probe_a') as any)?.label).toBe('v2 label');
241241
expect(t.objects).toEqual(['probe_a', 'probe_held', 'probe_old']);

‎packages/qa/dogfood/test/install-local-refused-package-leaves-nothing.dogfood.test.ts‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
// GOLDEN REGRESSION — a package the install refuses part-way through
44
// registering leaves nothing of itself in the running system (#28697).
55
//
6-
// ## What was measured before the fix
7-
//
8-
// Installed into the showcase through `POST /api/v1/marketplace/install-local`,
9-
// an inline manifest whose object and app were clean and whose connector wore
10-
// the showcase's own `_packageId` answered 422 `PLUGIN_REGISTER_FAILED`, with
11-
// no ledger entry; but the package, its object and its app had already
12-
// registered, and stayed readable until restart.
13-
//
146
// ## What this file pins, on one boot
157
//
16-
// 1. that install is refused as before, and afterwards neither the package,
17-
// its object nor its app reads; the same id then installs clean, 200;
8+
// 1. an install whose connector wears the showcase's id is refused as
9+
// before (422 `PLUGIN_REGISTER_FAILED`), and afterwards neither the
10+
// package, its object nor its app reads; the same id then installs
11+
// clean, 200;
1812
// 2. an install the registry refuses part-way (its second object is one the
1913
// showcase owns) is refused 422 `PLUGIN_REGISTER_FAILED`, and afterwards
2014
// neither the package nor its first object reads; the showcase's object

0 commit comments

Comments
 (0)