Sample Deliverable
PR 리스크 리뷰 샘플
실제 고객 코드가 아닌 가상 예시입니다. 유료 리뷰에서는 칭찬보다 배포 후 깨질 가능성, 누락 테스트, 잘못된 계약을 먼저 봅니다.
Findings
P1 - New retry loop can duplicate side effects. File: `src/jobs/sendReceipt.ts` Risk: - The retry wrapper calls `sendEmail()` again after a timeout. - There is no idempotency key or sent-receipt record check. - A slow provider response can create duplicate customer emails. Suggested fix: - Record a stable receipt id before calling the provider. - Skip sends when that receipt id is already marked `sent` or `sending`. - Add a test for provider timeout followed by retry. P2 - Test only covers the happy path. File: `tests/sendReceipt.test.ts` Risk: - The new test proves one successful send. - It does not cover timeout, provider 500, duplicate job delivery, or missing recipient. Suggested fix: - Add failure-path tests before merging the retry behavior.
Review Shape
- Findings first, ordered by severity
- File/path references when the context includes code
- Concrete failure condition, not vague style feedback
- Small test or verification suggestion for each risky change