Skip to content

Commit 809c270

Browse files
fix(metadata-protocol): withhold the bare history of a name only disabled packages hold (#38625)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9St4eUWHFcCKuRUrCZPperJ)_ Fixes #37915 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员停用一个包后,在历史面板查看只归该包所有的元数据(例如邮件模板)时,以前仍列出全部版本,现在与查看条目本身一样显示“未找到”;重新启用后历史照常列出。 - 属于包的停用规则(维护者原则「我觉得停用就该全部消失」),补上读取版本历史这一处遗漏。 - 若判断有误,只会让某个名称的历史在停用期间多显示或少显示;不写任何数据,撤回本改动即恢复原样。 - 无。 ## What changes - `historySlotOf` (`packages/metadata-protocol/src/protocol-history-slots.ts`) takes a new `read` flag. When the history read names no package, it first asks whether only disabled packages hold the name. That judgment is the one the bare writes already use (`packagelessHolderRefusal`, its disabled-holders arm). If they do, the read throws `404 RESOURCE_NOT_FOUND` before the two-holder refusal (which would name the hidden package) and before any version is read. Only `historyMetaItem` passes `read: true`. - Why a flag rather than the bare arm itself, as the dispatch suggested: the bare rollback also calls `historySlotOf`, and it must keep its ruled `409` "Enable the package … first" refusal. Judging inside the shared bare arm would have turned that refusal into a `404`. The last control case below pins it. - `GET /meta/:type/:name/history` (`packages/rest/src/meta-item-history-routes.ts`): the catch sends a bare not-found in the plain read's own body (`sendMetaItemAbsent`). It recognises one the way the item read's catch does (`thrownAnswerIsBareNotFound`). So the bare history and the bare item read answer byte for byte the same 404. Without this fork the classification door answers the flat dialect, which is what the REST ablation below shows. This file is outside the claim's declared surface. It is the renderer half the dispatch named (`handleRouteError` at the history route), and it changes nothing else in the file. - Unchanged: `?package=` history reads, the bare rollback's refusal, and every name that an enabled package or the environment holds. ## Tests <details><summary>Pins and controls</summary> - `packages/objectql/src/disabled-holder-packageless-row-doors.test.ts`, new describe, on the real engine with the card's `com.acme.mail` / `acme.welcome` / `fr-FR` fixture: - The package-less row and the package's own row: the bare history is `404 RESOURCE_NOT_FOUND` while the package is disabled. Re-enabled, it lists both versions again. - The history of a deleted package-less row is withheld the same way, with a re-enable control. - The history naming the package is unchanged. The package's own row still lists 2 versions while the named item read serves no item, and the package-less row keeps its `409`. This is pinned as measured on `main` ee9fd3d. - CONTROL: the bare rollback keeps its `409` with the enable as the remedy. - `packages/rest/src/meta-disabled-package-doors.test.ts`, new describe, RestServer over the real ObjectQL engine (better-sqlite3 in memory). Bare `/history?member=fr-FR`: 200 with 2 events, then 404 with a body byte-identical to `GET /meta/email_template/acme.welcome?member=fr-FR`, and not naming the package. `?package=` answers equal before and after. Re-enabled: 200 with 2 events. - `packages/metadata-protocol/src/protocol-history-slots.test.ts`, unit arms: four disabled cells (package-less row, own row, both rows, no row) answer 404. Controls: enabled, not a read, an enabled row binding (the two-holder 409 stands), and the named read. </details> <details><summary>Suite readings</summary> - At a1f33b1: `pnpm --filter @objectstack/metadata-protocol test`, 372 files passed with 9 skipped, 23657 tests passed with 45 skipped. `pnpm --filter @objectstack/objectql test`, 640/640 files, 14544/14544 tests. `pnpm --filter @objectstack/rest test`, 440 files passed, 9046 tests passed with 351 skipped. - `typecheck` for rest and objectql: 0 at a1f33b1. For metadata-protocol: 0 at e17e5df. At a1f33b1 it was 2, from a TS2345 in the new test cases, which e17e5df fixes. `protocol-history-slots.test.ts` reran 25/25 at e17e5df. </details> <details><summary>Ablations (rebuild + dist proof)</summary> - Ablation 1: the read judgment's call site in `historySlotOf` was mutated through `scripts/ablation-replace.mjs`, and metadata-protocol was rebuilt. `ablation-dist-preflight` found the marker in `dist/index.js` and `dist/index.cjs`. Result: 4/25 unit cases red, 3/19 objectql cases red, the REST case red. Then the source was restored (blob equal to HEAD), metadata-protocol was rebuilt, and the marker was absent from all 24 dist files with `git diff HEAD` empty. - Ablation 2: the REST catch fork was deleted and the REST case went red, with the body in the flat dialect: `{"error":"Metadata item email_template/acme.welcome not found","code":"RESOURCE_NOT_FOUND"}`. Then it was restored (blob equal to HEAD). </details> <details><summary>Gates</summary> - Gates come from `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`: 75 commands, run on e17e5df (the final head). The result is `--ran` (exit codes recorded) reconciles 75 derived and 74 run with exit 0. One is NOT MEASURED: `node scripts/check-plugin-teardown-shape.mjs --self-test`, exit 3, PREREQUISITE NOT MET, because the shallow clone cannot reach its pinned fixture commit. CI runs it on a full clone. - `node scripts/pm/overlap-check.mjs`: `VERDICT clean exit 0` (merges cleanly with origin/main, and no open PR shares a file). </details> ## Acceptance notes - **The named history read (`?package=PKG`, PKG disabled).** The card asks for two things that disagree once measured. Its expected section says the named read "follows whatever the named item read does today", and the named item read today serves no item (REST 404). Its acceptance section says "Named reads are unchanged". This PR keeps the named history unchanged and pins it. Note that the bare writes' `?package=` remedy (the named rollback is admitted while the package is disabled) relies on that listing to choose a version. The zone ruled on this: the named history stays as built (option A, unchanged and pinned). Answering 404 there as well (option B) is not part of this PR. - **Diff door.** `diffMetaItem` calls `historySlotOf` with no disabled-holders judgment, so the same gap exists in its code. It is not reproduced on the card's fixture: the diff compares only the canonical member, which a shipped name's package cannot hold a row at (the save is `403 NOT_OVERRIDABLE` / `WRITABLE_PACKAGE_REQUIRED`). Turning it on is one `read: true` plus the same REST catch fork, but it has no pin here, so it is left for a follow-up. - **Audit door.** `auditMetaItem` does not call `historySlotOf`, so the dispatch's mechanism assumption is disproved. It lists the name's audit rows, including refusals made while the package is disabled. Withholding a compliance trail is a product decision, so it is not touched here. - **Types not stored per package** (page, report, analytics_cube and others). `historySlotOf` answers `undefined` for them, and this change does not reach them. REST already withholds the gated types (book, doc, app, view, dashboard) through `eventDoorRefusal`. The other types are unmeasured. - **Runtime dispatcher.** `packages/runtime/src/domains/meta.ts` serves no `/history` route (no route for it at ee9fd3d), so RestServer is the only HTTP transport here. ## Read first 1. `packages/metadata-protocol/src/protocol-history-slots.ts`: the `read` arm placed before the two-holder refusal. Risk: the order (a disabled-only name with two slots now answers 404, not 409). 2. `packages/rest/src/meta-item-history-routes.ts`: the catch fork. Risk: any other bare not-found thrown on this door now gets the nested absence body instead of the flat one. 3. `packages/objectql/src/disabled-holder-packageless-row-doors.test.ts`: the named-read pin, which records the current behaviour on purpose. ## Verification Two-minute check: `pnpm --filter @objectstack/objectql exec vitest run src/disabled-holder-packageless-row-doors.test.ts -t 37915`. Expect 5 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1d19acf commit 809c270

7 files changed

Lines changed: 280 additions & 3 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/rest': patch
4+
---
5+
6+
fix(metadata-protocol): the history of a name only disabled packages hold is not served
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`GET /api/v1/meta/:type/:name/history` naming no package, for a type stored per package (an `email_template`, a `flow`, an `agent`, …), now answers `404 RESOURCE_NOT_FOUND` for a name that only disabled packages hold. The body is the same one `GET /api/v1/meta/:type/:name` gives for that name. A disabled package holds no name, so the item read already answered not found, but the history door kept listing every version of the name, at any `?member=`. That included the history of a row stored under no package, which is that package's customization, and the history of a row that was deleted. In process, `historyMetaItem` throws the same `404`.
12+
13+
- Enable the package again and the history is listed as before.
14+
- The history naming the package (`?package=`) is unchanged.
15+
- The rollback naming no package keeps its `409` refusal, which says to enable the package first.
16+
- A name that an enabled package or the environment holds answers as before.

‎packages/metadata-protocol/src/protocol-history-and-publish.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,14 @@ export class ProtocolHistoryAndPublishFacet {
296296
// holds, named bare, reads its whole log as before.
297297
// [#34681] A row-held base's name, named bare, reads that base's
298298
// versions, as `?package=` naming it does ({@link historySlotOf}).
299+
// [#37915, ADR-0150 D3] A name only disabled packages hold, named
300+
// bare, is the by-name read's absence (`404 RESOURCE_NOT_FOUND`):
301+
// a disabled package holds no name, so its log is not served until
302+
// the package is enabled again (`read`).
299303
const slot = await historySlotOf(host, {
300304
type: singularType, name: request.name, ...memberOption(member),
301305
...(request.packageId !== undefined ? { packageId: request.packageId } : {}),
306+
read: true,
302307
});
303308
// [ADR-0131 D6] The environment's change log; a legacy
304309
// organization-scoped history row is not read.

‎packages/metadata-protocol/src/protocol-history-slots.test.ts‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,50 @@ describe('the doors and the console read one list of by-package types', () => {
206206
}
207207
});
208208
});
209+
210+
describe('[#37915, ADR-0150 D3] historySlotOf: the bare history read of a name only disabled packages hold', () => {
211+
/** A registry whose one holder of the name is `com.a`, disabled or not. */
212+
function hostWith(disabled: boolean, options: FakeOptions = {}) {
213+
const host = fakeHost({ shippers: ['com.a'], ...options });
214+
Object.assign(host.engine.registry, {
215+
packageScopedHoldersOf: () => ['com.a'],
216+
isPackageDisabled: (id: string) => disabled && id === 'com.a',
217+
});
218+
return host;
219+
}
220+
const refusalOf = (pending: Promise<unknown>): Promise<any> => pending.then(() => undefined, (error: unknown) => error);
221+
222+
it.each<[string, FakeOptions]>([
223+
['the package-less row', { unbound: true }],
224+
['the package\'s own row', { candidates: ['com.a'] }],
225+
['both rows (BASE: the two-holder 409 naming the disabled package)', { candidates: ['com.a'], unbound: true }],
226+
['no row', {}],
227+
])('%s: the read is the missing name, 404 RESOURCE_NOT_FOUND', async (_cell, options) => {
228+
const absent = await refusalOf(historySlotOf(hostWith(true, options), { type: 'flow', name: 'n', read: true }));
229+
expect([absent?.status, absent?.code]).toEqual([404, 'RESOURCE_NOT_FOUND']);
230+
});
231+
232+
it('CONTROL — enabled: the one slot, as before', async () => {
233+
expect(await historySlotOf(hostWith(false, { unbound: true }), { type: 'flow', name: 'n', read: true }))
234+
.toEqual({ owner: { packageId: null, sole: true }, addressed: false, held: true });
235+
});
236+
237+
it('CONTROL — not a read (the rollback, the diff): the slot, as before; the door judges the name itself', async () => {
238+
expect(await historySlotOf(hostWith(true, { unbound: true }), { type: 'flow', name: 'n' }))
239+
.toEqual({ owner: { packageId: null, sole: true }, addressed: false, held: true });
240+
});
241+
242+
it('CONTROL — an enabled package binds a stored row: not withheld (the two-holder refusal stands)', async () => {
243+
const refused = await refusalOf(historySlotOf(hostWith(true, { candidates: ['com.a', 'com.b'] }), { type: 'flow', name: 'n', read: true }));
244+
expect(refused).toBeInstanceOf(PackageScopedNameRefusedError);
245+
expect(refused.refusal.reason).toBe('ambiguous-in-environment');
246+
});
247+
248+
it('CONTROL — the read naming the package is not judged here', async () => {
249+
const slot = await historySlotOf(
250+
hostWith(true, { candidates: ['com.a'], served: { package_id: 'com.a' } }),
251+
{ type: 'flow', name: 'n', packageId: 'com.a', read: true },
252+
);
253+
expect(slot).toEqual({ owner: { packageId: 'com.a', sole: true }, addressed: true, held: true });
254+
});
255+
});

‎packages/metadata-protocol/src/protocol-history-slots.ts‎

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@
3838
* `P`'s customization): a read naming any other package falls back to it
3939
* too, and ⛔ such a package never addresses it.
4040
*
41+
* [#37915, ADR-0150 D3] The history READ naming no package (`read: true`)
42+
* first asks whether only disabled packages hold the name, by the judgment
43+
* the writes naming no package ask (`packagelessHolderRefusal`, its
44+
* disabled-holders arm: a registry holder, a code shipper or a stored row's
45+
* binding, a disabled holder's customization pair counted as that holder).
46+
* A disabled package holds no name, so the by-name read answers the missing
47+
* name, and this read answers it too: `404 RESOURCE_NOT_FOUND`, before the
48+
* two-holder refusal (which would name the disabled holders) and before any
49+
* version is read. Re-enabled, the log is served as before. The writes of the
50+
* family (the bare rollback) keep their own refusal, which names the remedy,
51+
* and the read naming `P` is unchanged.
52+
*
4153
* A version belongs to a slot by its history row's attribution
4254
* (`historyRowAttribution`, `@objectstack/metadata`). A version attributed to
4355
* no package (recorded before `sys_metadata_history.package_id` was written
@@ -64,7 +76,8 @@ import type { ProtocolHost } from './protocol-host.js';
6476
import { memberOption } from './protocol-bundle-members.js';
6577
import { shippingPackageIds } from './protocol-environment-rows.js';
6678
import type { HistoryVersionOwner } from './sys-metadata-repository.js';
67-
import { packagelessRowHeldBaseAddress } from './protocol-save.js';
79+
import { packagelessHolderRefusal, packagelessRowHeldBaseAddress } from './protocol-save.js';
80+
import { metadataItemNotFoundError } from './protocol-client-failures.js';
6881

6982
/** What {@link historySlotOf} answers for a door of a by-package type. */
7083
export interface HistorySlot {
@@ -150,6 +163,28 @@ function refuseWhereBareReadRefuses(host: Pick<ProtocolHost, 'engine'>, type: st
150163
}
151164
}
152165

166+
/**
167+
* [#37915, ADR-0150 D3] The bare history read of a name only disabled
168+
* packages hold: the by-name read's absence, `404 RESOURCE_NOT_FOUND`. Judged
169+
* as the writes naming no package judge it ({@link packagelessHolderRefusal},
170+
* its disabled-holders arm), over the name's row slots; that judgment's
171+
* verdict is read here, never its sentence (a write's remedy, which a read
172+
* does not owe). `slots` are {@link rowSlotsOf}'s.
173+
*/
174+
function refuseDisabledHoldersOnlyRead(
175+
host: Pick<ProtocolHost, 'engine' | 'shippedArtifactsOf'>,
176+
type: string,
177+
name: string,
178+
member: string | undefined,
179+
slots: ReadonlyArray<string | null>,
180+
): void {
181+
const judged = packagelessHolderRefusal(host, 'save', type, type, name, member, {
182+
candidates: slots.filter((slot): slot is string => slot !== null),
183+
unbound: slots.includes(null),
184+
}, 'disabled-holders');
185+
if (judged !== undefined) throw metadataItemNotFoundError(type, name);
186+
}
187+
153188
/**
154189
* The row slot a history or rollback request of `(type, name)` addresses —
155190
* see the module header. `type` is the canonical type key and `member` the
@@ -166,6 +201,9 @@ function refuseWhereBareReadRefuses(host: Pick<ProtocolHost, 'engine'>, type: st
166201
* same request naming it does: the history, diff and rollback naming no
167202
* package read and restore the base's versions, never another holder's.
168203
*
204+
* @throws a `404 RESOURCE_NOT_FOUND` for a bare `read` of a name only
205+
* disabled packages hold ({@link refuseDisabledHoldersOnlyRead}), before
206+
* any refusal below.
169207
* @throws {PackageScopedNameRefusedError} `ambiguous-in-environment` for a
170208
* bare request of a name two or more row slots hold (other than a row-held
171209
* base's, above), or the bare plain read's own refusal; `not-held-by-qualifier` for a package that neither
@@ -174,13 +212,26 @@ function refuseWhereBareReadRefuses(host: Pick<ProtocolHost, 'engine'>, type: st
174212
*/
175213
export async function historySlotOf(
176214
host: Pick<ProtocolHost, 'declinesStoredRow' | 'engine' | 'findServedOverlayRow' | 'packagelessAddress' | 'readItemActiveRows' | 'rethrowUnlessMetadataStoreUnprovisioned' | 'shippedArtifactsOf'>,
177-
request: { type: string; name: string; member?: string; packageId?: string },
215+
request: {
216+
type: string;
217+
name: string;
218+
member?: string;
219+
packageId?: string;
220+
/**
221+
* [#37915] The door is the history read: named bare, a name only
222+
* disabled packages hold is the by-name read's absence. Omitted by
223+
* the rollback, which refuses such a name with its remedy, and by
224+
* the diff.
225+
*/
226+
read?: boolean;
227+
},
178228
): Promise<HistorySlot | undefined> {
179229
const { type, name, member, packageId } = request;
180230
refusePackageSelectorOutsideSlottedTypes(type, packageId);
181231
if (!PACKAGE_SLOTTED_STORE_TYPES.has(type)) return undefined;
182232
const slots = await rowSlotsOf(host, type, name, member);
183233
if (packageId === undefined) {
234+
if (request.read === true) refuseDisabledHoldersOnlyRead(host, type, name, member, slots);
184235
if (slots.length > 1) {
185236
const base = await packagelessRowHeldBaseAddress(host, type, name, member);
186237
if (base !== undefined) return historySlotOf(host, { ...request, packageId: base });

‎packages/objectql/src/disabled-holder-packageless-row-doors.test.ts‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,77 @@ describe('[ADR-0150 D3, the 2026-11-26 note] the per-item publish and the rollba
435435
expect(await subjectAt(protocol, 'fr-FR')).toBe('PKG fr 1');
436436
});
437437
});
438+
439+
describe('[#37915, ADR-0150 D3] the history read naming no package, while every holder is disabled', () => {
440+
const refusalOf = (pending: Promise<unknown>): Promise<any> => pending.then(() => undefined, (error: unknown) => error);
441+
const versions = async (protocol: ObjectStackProtocolImplementation, extra: Record<string, unknown> = {}) =>
442+
(await protocol.historyMetaItem({ type: 'email_template', name: NAME, member: 'fr-FR', ...extra } as any)).events.length;
443+
444+
it.each([['the package-less row', undefined], ['the package\'s own row', PKG]] as const)('%s: the bare history is the by-name read\'s absence (404 RESOURCE_NOT_FOUND); re-enabled, it lists the versions again', async (_cell, packageId) => {
445+
const stores: Stores = new Map();
446+
const { engine, protocol } = await boot(stores);
447+
for (const subject of ['SAVED fr 1', 'SAVED fr 2']) {
448+
await protocol.saveMetaItem({ type: 'email_template', name: NAME, item: template('fr-FR', subject), ...(packageId ? { packageId } : {}) } as any);
449+
}
450+
expect(await versions(protocol)).toBe(2);
451+
engine.registry.disablePackage(PKG);
452+
// The by-name read naming no package serves nothing at the member.
453+
expect(await subjectAt(protocol, 'fr-FR')).toBeUndefined();
454+
// FROM (`main` ee9fd3d4): `{ events }` with both versions. TO: the missing name.
455+
const absent = await refusalOf(versions(protocol));
456+
expect([absent?.status, absent?.code], String(absent?.message ?? 'no refusal')).toEqual([404, 'RESOURCE_NOT_FOUND']);
457+
// CONTROL — re-enabled: both versions are listed again.
458+
engine.registry.enablePackage(PKG);
459+
expect(await versions(protocol)).toBe(2);
460+
});
461+
462+
it('the history of a deleted package-less row is withheld the same way; re-enabled, it is listed again', async () => {
463+
const stores: Stores = new Map();
464+
const { engine, protocol } = await boot(stores);
465+
await protocol.saveMetaItem({ type: 'email_template', name: NAME, item: template('fr-FR', 'SAVED fr 1') } as any);
466+
await protocol.deleteMetaItem({ type: 'email_template', name: NAME, member: 'fr-FR' } as any);
467+
expect(packagelessRows(stores)).toEqual([]);
468+
const listed = await versions(protocol);
469+
expect(listed).toBeGreaterThan(0);
470+
engine.registry.disablePackage(PKG);
471+
const absent = await refusalOf(versions(protocol));
472+
expect([absent?.status, absent?.code], String(absent?.message ?? 'no refusal')).toEqual([404, 'RESOURCE_NOT_FOUND']);
473+
engine.registry.enablePackage(PKG);
474+
expect(await versions(protocol)).toBe(listed);
475+
});
476+
477+
it('the history naming the package is unchanged: the package\'s own row lists its versions, the package-less row keeps its 409, disabled or not', async () => {
478+
const stores: Stores = new Map();
479+
const { engine, protocol } = await boot(stores);
480+
for (const subject of ['PKG fr 1', 'PKG fr 2']) {
481+
await protocol.saveMetaItem({ type: 'email_template', name: NAME, item: template('fr-FR', subject), packageId: PKG } as any);
482+
}
483+
const other: Stores = new Map();
484+
const packageless = await boot(other);
485+
await packageless.protocol.saveMetaItem({ type: 'email_template', name: NAME, item: template('fr-FR', 'SAVED fr') } as any);
486+
const named = async () => ({
487+
own: await versions(protocol, { packageId: PKG }),
488+
ownRead: await protocol.getMetaItem({ type: 'email_template', name: NAME, member: 'fr-FR', packageId: PKG } as any)
489+
.then((r: any) => r?.item?.subject as string | undefined),
490+
packageless: await refusalOf(versions(packageless.protocol, { packageId: PKG })).then((e) => [e?.status, e?.code]),
491+
});
492+
expect(await named()).toEqual({ own: 2, ownRead: 'PKG fr 2', packageless: [409, 'RESOURCE_CONFLICT'] });
493+
engine.registry.disablePackage(PKG);
494+
packageless.engine.registry.disablePackage(PKG);
495+
// Pinned as measured on `main` ee9fd3d4: the named history still lists
496+
// the package's own versions while the named by-name read serves no item.
497+
expect(await named()).toEqual({ own: 2, ownRead: undefined, packageless: [409, 'RESOURCE_CONFLICT'] });
498+
});
499+
500+
it('CONTROL — the rollback naming no package keeps its own refusal, the enable as the remedy', async () => {
501+
const stores: Stores = new Map();
502+
const { engine, protocol } = await boot(stores);
503+
await protocol.saveMetaItem({ type: 'email_template', name: NAME, item: template('fr-FR', 'SAVED fr 1') } as any);
504+
await protocol.saveMetaItem({ type: 'email_template', name: NAME, item: template('fr-FR', 'SAVED fr 2') } as any);
505+
const first = Math.min(...(await protocol.historyMetaItem({ type: 'email_template', name: NAME, member: 'fr-FR' } as any)).events.map((e: any) => e.version as number));
506+
engine.registry.disablePackage(PKG);
507+
const refused = await refusalOf(protocol.rollbackMetaItem({ type: 'email_template', name: NAME, toVersion: first, member: 'fr-FR' } as any));
508+
expect([refused?.status, refused?.code]).toEqual([409, 'RESOURCE_CONFLICT']);
509+
expect(String(refused?.message).startsWith('Enable the package that holds email_template ')).toBe(true);
510+
});
511+
});

0 commit comments

Comments
 (0)