fix(session-query): address review round 1

This commit is contained in:
Hypatia May
2026-07-10 17:29:52 +08:00
parent aa1dc0e2c7
commit 18028cad4f
14 changed files with 386 additions and 18 deletions

View File

@@ -128,11 +128,12 @@ export function runCoordinatorContract(name: string, makeFixture: () => Promise<
const fix = await makeFixture()
const { ctx, fiber } = await freshCtx(fix)
const observed: Array<{ headerId: SessionId; change: SessionPersistedChange }> = []
ctx.on('session/persisted', () => { throw new Error('synchronous derived read model failed') })
ctx.on('session/persisted', (header, change) => {
observed.push({ headerId: header.id, change: structuredClone(change) })
header.createdAt = -1
return Promise.reject(new Error('derived read model failed'))
})
ctx.on('session/persisted', () => Promise.reject(new Error('asynchronous derived read model failed')))
try {
const m = meta('notifications', WORK)
await ctx.sessionPersistence.create(m)