feat(editor) : notify peers of draft overwrite
CI / Verify (push) Successful in 1m20s
CI / Build immutable images and deploy (push) Successful in 1m51s

This commit is contained in:
2026-09-15 19:46:40 +07:00 Unverified
parent fb152c12fe
commit c3a2aa88d6
7 changed files with 121 additions and 50 deletions
+23
View File
@@ -61,4 +61,27 @@ describe("invalidation event envelopes", () => {
payload: { id, version: 6, scope: "unknown" },
})).toBeNull();
});
it("publishes validated overwrite details only on admin events", () => {
const id = "4afeea7b-6f24-43f3-b747-2db98335e01e";
const overwrite = { operation: "overwrite", actorName: "Editor One" };
expect(toInvalidationEvent({
topic: "admin",
aggregateId: id,
eventType: "admin.updated",
payload: { id, version: 7, scope: "weapon", ...overwrite },
})).toEqual({ type: "admin.updated", id, version: 7, scope: "weapon", ...overwrite });
expect(parseInvalidationEvent(JSON.stringify({
type: "admin.updated",
id,
version: 8,
operation: "overwrite",
}))).toBeNull();
expect(toInvalidationEvent({
topic: `page:${id}`,
aggregateId: id,
eventType: "page.updated",
payload: { id, version: 7, ...overwrite },
})).toEqual({ type: "page.updated", id, version: 7 });
});
});