Skip to content

Commit f4ca1bc

Browse files
committed
test(metadata-protocol): the outage pin org arm moves to a tier-A type
The layered read now gates its organization, so an allowOrgOverride:false type issues no org-scope read at all and the case would pass vacuously. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
1 parent 1cd70a4 commit f4ca1bc

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

packages/metadata-protocol/src/protocol.metadata-store-outage.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,24 @@ describe('[#5707] the layered read stops painting an outage as "nothing was cust
360360
// `try`, so the swallow hid BOTH: an env-wide overlay row that was
361361
// perfectly readable was reported as "no overlay" because the org read
362362
// failed ahead of it.
363+
//
364+
// ⚠️ [#14907] `view`, not `object` — and the type is now load-bearing
365+
// rather than incidental. This verb gates its organization through
366+
// `organizationIdForMetaRead`, so an `allowOrgOverride: false` type
367+
// (`object`, which the rest of this file uses as its generic subject)
368+
// resolves `orgId` to `undefined` and never issues an org-scope read at
369+
// all. There would be no failing read to report, and this case would
370+
// pass vacuously against a method that had stopped doing the thing it
371+
// is about. `view` is tier-A, so the org arm is really taken.
363372
const err = connectionRefused();
364373
const engine = engineWithRows([]);
365374
engine.findOne = vi.fn(async (_o: string, opts: any) => {
366375
if (opts?.where?.organization_id === 'org_acme') throw err;
367-
return { type: 'object', name: 'acct', state: 'active', metadata: JSON.stringify({ name: 'acct', label: 'Env overlay' }) };
376+
return { type: 'view', name: 'acct', state: 'active', metadata: JSON.stringify({ name: 'acct', label: 'Env overlay' }) };
368377
});
369378

370379
const caught = await rejection(
371-
() => p_layered(engine, { type: 'object', name: 'acct', organizationId: 'org_acme' }),
380+
() => p_layered(engine, { type: 'view', name: 'acct', organizationId: 'org_acme' }),
372381
);
373382
expectStoreUnavailable(caught, err);
374383
});

0 commit comments

Comments
 (0)