feat: 직접 writer를 내구성 변화 저널에 연결
86개 API mutation을 분류하고 메시지 mailbox, 베팅, 국가 설정, 예약 명령의 revision/outbox 표식을 소유 transaction에 연결한다. 공개 SSE는 식별자 없는 invalidation만 노출한다.
This commit is contained in:
@@ -346,6 +346,7 @@ export const turnsRouter = router({
|
||||
const snapshot = await mutateReservedTurns(() =>
|
||||
setGeneralTurn(ctx.db, input.generalId, input.turnIndex, input.action, args, input.expectedRevision)
|
||||
);
|
||||
ctx.changeJournal?.mark('reserved.general', input.generalId);
|
||||
return { ok: true, ...snapshot };
|
||||
}),
|
||||
shiftGeneral: authedProcedure
|
||||
@@ -362,6 +363,7 @@ export const turnsRouter = router({
|
||||
const snapshot = await mutateReservedTurns(() =>
|
||||
shiftGeneralTurns(ctx.db, input.generalId, input.amount, input.expectedRevision)
|
||||
);
|
||||
ctx.changeJournal?.mark('reserved.general', input.generalId);
|
||||
return { ok: true, ...snapshot };
|
||||
}),
|
||||
repeatGeneral: authedProcedure
|
||||
@@ -377,6 +379,7 @@ export const turnsRouter = router({
|
||||
const snapshot = await mutateReservedTurns(() =>
|
||||
repeatGeneralTurns(ctx.db, input.generalId, input.amount, input.expectedRevision)
|
||||
);
|
||||
ctx.changeJournal?.mark('reserved.general', input.generalId);
|
||||
return { ok: true, ...snapshot };
|
||||
}),
|
||||
setGeneralBulk: authedProcedure
|
||||
@@ -403,6 +406,7 @@ export const turnsRouter = router({
|
||||
const snapshot = await mutateReservedTurns(() =>
|
||||
setGeneralTurns(ctx.db, input.generalId, updates, input.expectedRevision)
|
||||
);
|
||||
ctx.changeJournal?.mark('reserved.general', input.generalId);
|
||||
return { ok: true, ...snapshot };
|
||||
}),
|
||||
setNation: authedProcedure
|
||||
|
||||
Reference in New Issue
Block a user