Skip to content

Commit db7513a

Browse files
committed
test(rest): read the batch door's exposure pins over a real metadata store
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwgfUuNAvcUg3JzBiR
1 parent ec6f33e commit db7513a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/rest/src/batch-op-exposure-object-read.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
2323
import { ObjectQL } from '@objectstack/objectql';
2424
import { SqlDriver } from '@objectstack/driver-sql';
2525
import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol';
26+
import { SysMetadataAuditObject, SysMetadataCommitObject, SysMetadataHistoryObject, SysMetadataObject } from '@objectstack/metadata-core';
2627
import { RestServer } from './rest-server';
2728

2829
const liveEngines: ObjectQL[] = [];
@@ -67,6 +68,12 @@ async function boot() {
6768
for (const o of [WIDGET, VAULT, LEDGER]) engine.registry.registerObject(o as any, LEGACY_PACKAGE);
6869
engine.registry.registerObject(SECRET as any);
6970
await engine.syncSchemas();
71+
// The metadata store every exposure gate reads through. Without it the
72+
// protocol's object reads answer SERVICE_UNAVAILABLE and every gate fails
73+
// OPEN by design (#3545), on this door and on the data door alike.
74+
for (const o of [SysMetadataObject, SysMetadataHistoryObject, SysMetadataAuditObject, SysMetadataCommitObject]) {
75+
if (!engine.registry.getObject(o.name)) engine.registry.registerObject(o as any);
76+
}
7077

7178
const protocol = new ObjectStackProtocolImplementation(engine as any);
7279
const noop = () => {};

0 commit comments

Comments
 (0)