From 55a9c87610d63009318e95f7c368fa46075a1cb0 Mon Sep 17 00:00:00 2001 From: hided62 Date: Mon, 24 Aug 2026 08:04:14 +0000 Subject: [PATCH] =?UTF-8?q?fix(vote):=20=EC=84=A4=EB=AC=B8=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=EC=9E=90=EB=A5=BC=20=EC=9E=A5=EC=88=98=EB=AA=85?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=A0=80=EC=9E=A5=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 인증 계정 ID나 계정 표시명 대신 getMyGeneral로 확정한 현재 장수명을 opener_name에 저장한다. 서로 다른 세 identity를 둔 회귀 테스트로 저장 경계를 고정한다. --- app/game-api/src/router/vote/index.ts | 3 +-- app/game-api/test/voteRouter.test.ts | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/game-api/src/router/vote/index.ts b/app/game-api/src/router/vote/index.ts index 0eb358af..b52cf230 100644 --- a/app/game-api/src/router/vote/index.ts +++ b/app/game-api/src/router/vote/index.ts @@ -416,7 +416,6 @@ export const voteRouter = router({ ) .mutation(async ({ ctx, input }) => { const general = await getMyGeneral(ctx); - const openerName = ctx.auth?.user.username ?? general.name; const options = normalizeOptions(input.options); if (options.length === 0) { throw new TRPCError({ code: 'BAD_REQUEST', message: '항목이 없습니다.' }); @@ -468,7 +467,7 @@ export const voteRouter = router({ ${multipleOptions}, ${input.revealMode}, ${general.id}, - ${openerName}, + ${general.name}, ${gameTime.now}, ${gameTime.tick === null ? null : BigInt(gameTime.tick)}, ${endAt}, diff --git a/app/game-api/test/voteRouter.test.ts b/app/game-api/test/voteRouter.test.ts index a55ce09c..b169e63f 100644 --- a/app/game-api/test/voteRouter.test.ts +++ b/app/game-api/test/voteRouter.test.ts @@ -264,7 +264,7 @@ describe('vote router actor and permission boundaries', () => { expect(fixture.redisPublish).not.toHaveBeenCalled(); }); - it('publishes a global front-status projection after creating a survey', async () => { + it('stores the authenticated general name and publishes a global projection after creating a survey', async () => { const auth = buildAuth(['admin.survey.open']); auth.user.username = 'admin-account'; auth.user.displayName = '관리자 표시명'; @@ -285,8 +285,9 @@ describe('vote router actor and permission boundaries', () => { const insert = fixture.queryRaw.mock.calls .map(([query]) => query) .find((query) => sqlText(query).includes('INSERT INTO vote_poll')); - expect(insert?.values).toContain('admin-account'); - expect(insert?.values).not.toContain('관리자 장수'); + expect(insert?.values).toContain('관리자 장수'); + expect(insert?.values).not.toContain('admin-account'); + expect(insert?.values).not.toContain('관리자 표시명'); }); it('reports the current world develcost as the legacy five-times survey reward', async () => {