cultcache-ts: test a catalog-less write over a record under another schema id
StrykerJS on e8b3e4ca left `written.catalogEntry?.schemaName` -> `.schemaName`
alive: the schema-id rule always matched first in the existing fixtures, so
the name rule never ran for an envelope without a catalog entry. This fixture
stores a record under another schema id whose name is the write's label, so
only the name and type rules can match it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e8b3e4ca79
commit
a00bb01f75
1 changed files with 8 additions and 0 deletions
|
|
@ -1765,3 +1765,11 @@ test("a store replaces and deletes a record written by an envelope that carries
|
|||
await store.delete(raw(0x02));
|
||||
assert.deepEqual(await recordsOnDisk(file), []);
|
||||
});
|
||||
|
||||
test("an envelope with no catalog entry replaces a record stored under another schema id that carries its label", async () => {
|
||||
const file = join(await mkdtemp(join(tmpdir(), "cultcache-identity-")), "store.cc");
|
||||
const store = new SingleFileMessagePackBackingStore(file);
|
||||
await store.push(identityEnvelope("k", "label-x", "id-x", "t"));
|
||||
await store.push({ key: "k", type: "t", payload: Uint8Array.of(0x02), storedAt: "2026-09-30T00:00:00Z" });
|
||||
assert.deepEqual(await recordsOnDisk(file), [["k", "t"]]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue