fix: 첫 빌드 전 닫힌 서버도 패치 정책으로 오픈 요청을 받는다

This commit is contained in:
2026-10-23 00:42:11 +09:00
parent d4a87c981f
commit b377250fb9
5 changed files with 51 additions and 10 deletions
+4 -8
View File
@@ -12,6 +12,7 @@ import { toPublicUser } from './auth/userRepository.js';
import type { UserOAuthInfo, UserRecord } from './auth/userRepository.js';
import { adminRouter } from './adminRouter.js';
import { openRequestsRouter } from './openRequests/router.js';
import { resolveOpeningCatalogCommit } from './openRequests/catalogSource.js';
import { accountRouter } from './account/router.js';
import {
hasActiveSpecialAccountGrant,
@@ -217,16 +218,11 @@ export const appRouter = router({
throw new TRPCError({ code: 'NOT_FOUND', message: 'Profile not found.' });
}
const profile = await ctx.profiles.getProfile(input.profileName);
const activeBuildCommit = profile?.buildCommitSha?.trim();
if (!profile || !activeBuildCommit) {
throw new TRPCError({
code: 'PRECONDITION_FAILED',
message: 'The profile has no active build commit.',
});
}
if (!profile) throw new TRPCError({ code: 'NOT_FOUND', message: 'Profile not found.' });
const catalogCommit = await resolveOpeningCatalogCommit(profile);
try {
return await listScenarioPreviews({ gitRef: activeBuildCommit });
return await listScenarioPreviews({ gitRef: catalogCommit });
} catch {
throw new TRPCError({
code: 'INTERNAL_SERVER_ERROR',