[fix] oauth2_id 컬럼 길이 부족으로 인한 회원탈퇴 실패 수정 (#368) - #369
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Walkthrough
ChangesOAuth2 ID 길이 변경
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
src/main/java/konkuk/thip/user/adapter/out/jpa/UserJpaEntity.java (1)
39-40: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win탈퇴 회귀 테스트를 추가해 주세요.
JPA 매핑과 마이그레이션은 100자로 일치하지만,
deleted:접두어가 추가된 50자 초과oauth2Id가 실제로 저장되는 탈퇴 경로가 검증되지 않았습니다. 기존UserJpaEntityTest또는 회원 탈퇴 통합 테스트에 해당 경계값 시나리오를 추가해 주세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/konkuk/thip/user/adapter/out/jpa/UserJpaEntity.java` around lines 39 - 40, 기존 UserJpaEntityTest 또는 회원 탈퇴 통합 테스트에 50자를 초과하는 oauth2Id를 사용하는 탈퇴 경계값 시나리오를 추가하세요. 탈퇴 처리에서 deleted: 접두어가 붙은 값이 실제로 저장되고, 100자 제한 내에서 JPA 매핑 및 마이그레이션과 일치하게 정상 처리되는지 검증하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/main/java/konkuk/thip/user/adapter/out/jpa/UserJpaEntity.java`:
- Around line 39-40: 기존 UserJpaEntityTest 또는 회원 탈퇴 통합 테스트에 50자를 초과하는 oauth2Id를
사용하는 탈퇴 경계값 시나리오를 추가하세요. 탈퇴 처리에서 deleted: 접두어가 붙은 값이 실제로 저장되고, 100자 제한 내에서 JPA
매핑 및 마이그레이션과 일치하게 정상 처리되는지 검증하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 925de319-b074-4a35-8d6f-4dd97cac8102
📒 Files selected for processing (2)
src/main/java/konkuk/thip/user/adapter/out/jpa/UserJpaEntity.javasrc/main/resources/db/migration/V260726__Modify_oauth2_id_length.sql
Test Results498 tests 498 ✅ 35s ⏱️ Results for commit 29586b4. |
#️⃣ 연관된 이슈
📝 작업 내용
문제 상황
회원 탈퇴 시 아래와 같은 예외가 발생했습니다.
원인
User.markAsDeleted()에서 탈퇴 처리 시 oauth2Id에 "deleted:" 접두어(8자)를 붙이는데, Apple 로그인 유저의 oauth2Id("apple_" +
sub, 약 50자)가 users.oauth2_id 컬럼 길이(VARCHAR(50))를 정확히 채우고 있어서, 접두어를 붙이는 순간(약 58자) 컬럼 길이를 초과해
truncation 에러가 발생했습니다.
카카오/구글 로그인 유저는 oauth2Id가 짧아 문제가 없었지만, Apple 로그인 도입 이후 드러난 이슈입니다.
해결
(V260726__Modify_oauth2_id_length.sql)
100자는 현재 최대 사용 길이(약 58자) 대비 충분한 여유이며, VARCHAR(50→100) 변경은 MySQL 8에서 1바이트 길이 프리픽스 범위 내
변경이라 인스턴트하게 적용되어 운영 환경에 안전합니다.
📸 스크린샷
💬 리뷰 요구사항
📌 PR 진행 시 이러한 점들을 참고해 주세요
Summary by CodeRabbit