feat: 직접 writer를 내구성 변화 저널에 연결
86개 API mutation을 분류하고 메시지 mailbox, 베팅, 국가 설정, 예약 명령의 revision/outbox 표식을 소유 transaction에 연결한다. 공개 SSE는 식별자 없는 invalidation만 노출한다.
This commit is contained in:
@@ -35,5 +35,6 @@ export const setNotice = authedProcedure
|
||||
},
|
||||
nationMeta
|
||||
);
|
||||
ctx.changeJournal?.mark('front.nation', me.nationId);
|
||||
return { ok: true, msg };
|
||||
});
|
||||
|
||||
@@ -429,7 +429,7 @@ export const assertNationEditable = (
|
||||
};
|
||||
|
||||
export const updateNationMeta = async (
|
||||
ctx: Pick<GameApiContext, 'turnDaemon'>,
|
||||
ctx: Pick<GameApiContext, 'turnDaemon' | 'changeJournal'>,
|
||||
nationId: number,
|
||||
updates: Record<string, unknown>,
|
||||
currentMeta: Record<string, unknown>
|
||||
@@ -453,6 +453,8 @@ export const updateNationMeta = async (
|
||||
}
|
||||
throw new TRPCError({ code: 'BAD_REQUEST', message: result.reason });
|
||||
}
|
||||
ctx.changeJournal?.mark('nation.content', nationId);
|
||||
ctx.changeJournal?.mark('dashboard.global');
|
||||
return {
|
||||
...currentMeta,
|
||||
...updates,
|
||||
|
||||
Reference in New Issue
Block a user