[chore] Week 2 audit: cursor pagination / dead env / server-only#34
Merged
Conversation
Merged
peterabcd
added a commit
that referenced
this pull request
Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
Week 2 마무리 전 전체 codebase audit. 수동 E2E 전에 잠재 버그와 env 드리프를 정리하고 회고를 최종화.
수정 내용
버그:
/sessionscursor 페이지네이션 누락orderBy: [date desc, id desc]인데 cursor 는id < cursorId만 봤음.cursor: { id }+skip: 1로 정상적인 keyset 위치를 잡도록 수정.버그: client 컴포넌트가 server-only lib 을 transitive하게 끌어올 수 있었던 구조
encodePath중복 함수를lib/uploads.ts에 통합하면node:fs/promises등이 client 번들로 끌려가 webpack 빌드가 깨짐 (이 PR 작업 중 재현).lib/upload-url.ts로 URL encoding pure helper 만 분리.lib/uploads.ts,lib/auth.ts,lib/db.ts,lib/guard.ts,lib/sessions.ts에import "server-only"가드 적용 (future regression 차단).죽은 env 변수
NEXT_PUBLIC_APP_URL이 .env templates 에는 있었으나 코드 어디에도 안 쓰임.app/layout.tsx의metadataBase로 실제 사용 (OG/절대 URL 기준)..env.example와deploy/.env.example에 설명 추가.방어 적 hardening
auth.config.ts의clientId/clientSecret에 빈 문자열 폴백. undefined 가 Auth.js 로 전파되지 않도록.UX 정리
app/sessions/[id]/page.tsx의[세션 수정 — 다음 PR에서 추가]placeholder 제거.회고 업데이트
검증
pnpm check이 commit 서에서 한 번 감지해준 제바 webpack node-only import 분리 문제를 이 PR 안에서 다시 고으면서 해결.pnpm check(typecheck + lint + build) 통과.Fidelity check
server-only가드: client 컴포넌트 에서 lib/* 가 잘못 끌려가면 빌드 에러로 명시적 실패.NEXT_PUBLIC_APP_URLmetadataBase: 빌드 로그와 production route 출력 정상.이후 작업
v0.1.0태그 하면 Week 2 종료.