Conversation
기획자 화면 명세를 로컬에서 관리하는 .figma/ 디렉터리를 ignore에 등록. 스크린샷/스펙 텍스트는 작업자 본인 로컬에서만 참고하도록 한다.
기획 명세에 별도 하한 정책이 없으나, 봇/오입력 방지를 위해 normalizeBirthDate에 1900-01-01 이전 날짜 거부 로직을 추가한다. 비교 기준은 normalize와 동일한 로컬 타임존 자정으로 둔다. - MIN_BIRTH_DATE 상수 추가 (user.constants.ts) - 회귀 테스트 2건 추가 (1899-12-31/1850 reject, 1900-01-01 통과)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f59f38266e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| today.setHours(0, 0, 0, 0); | ||
| const normalized = new Date(date); | ||
| normalized.setHours(0, 0, 0, 0); | ||
| if (normalized < MIN_BIRTH_DATE) { |
There was a problem hiding this comment.
Accept min birth date string in non-UTC timezones
When raw is a date-only string (e.g. '1900-01-01'), new Date(raw) is interpreted as UTC, then setHours(0,0,0,0) shifts it to local midnight. In negative-offset environments (e.g. America/New_York), this becomes 1899-12-31 00:00 local, so the new lower-bound check rejects a value that should be valid per the inclusive 1900-01-01 policy. This regression affects API clients that send birth dates as strings and run on non-UTC servers.
Useful? React with 👍 / 👎.
Coverage report
Test suite run success820 tests passing in 75 suites. Report generated by 🧪jest coverage report action from 7cfb5ea |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
기존 setHours(0,0,0,0) 로컬 자정 정규화 + 로컬 자정 MIN_BIRTH_DATE는 KST 환경에선 동작하나 음수 오프셋(예: America/New_York) 또는 UTC 환경에서는 '1900-01-01' 같은 ISO date string이 1899-12-31로 정렬되어 부당하게 reject되는 회귀가 있었음 (Codex 리뷰 P2). GraphQL DateTime은 ISO string을 UTC로 해석하고 DB 컬럼은 @db.Date(시간 무시)이므로 UTC 자정 기준으로 정규화/비교하도록 통일한다. - MIN_BIRTH_DATE = new Date(Date.UTC(1900, 0, 1)) - normalize: getUTCFullYear/getUTCMonth/getUTCDate로 UTC 자정 정렬 - 미래 비교의 today도 동일하게 UTC midnight 기준 - 회귀 테스트 입력을 ISO string으로 조정 + getUTCFullYear 검증
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cfb5eaf2b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const normalized = new Date( | ||
| Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()), | ||
| ); | ||
| if (normalized < MIN_BIRTH_DATE) { |
There was a problem hiding this comment.
Preserve client date when enforcing 1900-01-01 lower bound
Using getUTC* to derive normalized causes timezone-offset DateTime inputs at midnight to shift to the previous UTC day, so valid boundary values can be rejected. For example, with GraphQL DateTime (see DateTimeScalar.parseValue), sending 1900-01-01T00:00:00+09:00 parses to 1899-12-31T15:00:00Z, then this code normalizes it to 1899-12-31 and throws birthDate is too old, even though the client provided calendar date 1900-01-01. This is a regression introduced by the new minimum-date check path and affects clients that submit full ISO timestamps with positive offsets.
Useful? React with 👍 / 👎.
Summary
normalizeBirthDate)에 1900-01-01 이전 날짜 거부 정책 추가변경 사항
MIN_BIRTH_DATE = new Date(1900, 0, 1)상수 추가 (user.constants.ts)user-base.service.tsnormalizeBirthDate에< MIN_BIRTH_DATE거부 분기 추가Breaking 여부
Test plan
yarn test:cov통과 (820 tests)