Skip to content

[fix] oauth2_id 컬럼 길이 부족으로 인한 회원탈퇴 실패 수정 (#368) - #369

Merged
hd0rable merged 1 commit into
developfrom
fix/#368-oauth2-id-column-length
Jul 26, 2026
Merged

[fix] oauth2_id 컬럼 길이 부족으로 인한 회원탈퇴 실패 수정 (#368)#369
hd0rable merged 1 commit into
developfrom
fix/#368-oauth2-id-column-length

Conversation

@hd0rable

@hd0rable hd0rable commented Jul 26, 2026

Copy link
Copy Markdown
Member

#️⃣ 연관된 이슈

closes #368

📝 작업 내용

문제 상황

회원 탈퇴 시 아래와 같은 예외가 발생했습니다.

  DataIntegrityViolationException: Data truncation: Data too long
  for column 'oauth2_id' at row 1

원인

User.markAsDeleted()에서 탈퇴 처리 시 oauth2Id에 "deleted:" 접두어(8자)를 붙이는데, Apple 로그인 유저의 oauth2Id("apple_" +
sub, 약 50자)가 users.oauth2_id 컬럼 길이(VARCHAR(50))를 정확히 채우고 있어서, 접두어를 붙이는 순간(약 58자) 컬럼 길이를 초과해
truncation 에러가 발생했습니다.
카카오/구글 로그인 유저는 oauth2Id가 짧아 문제가 없었지만, Apple 로그인 도입 이후 드러난 이슈입니다.

해결

  • oauth2_id 컬럼 길이를 50 → 100으로 확장 (UserJpaEntity.java)
  • 실제 DB 스키마에도 반영되도록 Flyway 마이그레이션 추가
    (V260726__Modify_oauth2_id_length.sql)

100자는 현재 최대 사용 길이(약 58자) 대비 충분한 여유이며, VARCHAR(50→100) 변경은 MySQL 8에서 1바이트 길이 프리픽스 범위 내
변경이라 인스턴트하게 적용되어 운영 환경에 안전합니다.

📸 스크린샷

💬 리뷰 요구사항

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

📌 PR 진행 시 이러한 점들을 참고해 주세요

* P1 : 꼭 반영해 주세요 (Request Changes) - 이슈가 발생하거나 취약점이 발견되는 케이스 등
* P2 : 반영을 적극적으로 고려해 주시면 좋을 것 같아요 (Comment)
* P3 : 이런 방법도 있을 것 같아요~ 등의 사소한 의견입니다 (Chore)

Summary by CodeRabbit

  • 개선 사항
    • OAuth2 로그인 식별자의 저장 가능 길이를 최대 100자로 확대했습니다.
    • 더 긴 외부 로그인 식별자도 정상적으로 저장할 수 있습니다.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

oauth2Id의 JPA 매핑 길이와 데이터베이스 oauth2_id 컬럼 길이를 50자에서 100자로 확장했습니다.

Changes

OAuth2 ID 길이 변경

Layer / File(s) Summary
컬럼 길이 매핑 및 마이그레이션
src/main/java/.../UserJpaEntity.java, src/main/resources/db/migration/...sql
oauth2Id의 JPA 컬럼 길이와 users.oauth2_id의 데이터베이스 타입을 VARCHAR(100) NOT NULL로 변경했습니다.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

깡충 토끼가 길이를 늘려요
OAuth2 ID, 더 멀리 담아요
JPA와 DB 손을 맞잡고
새 마이그레이션 살포시 뛰어요
당근처럼 깔끔한 변경이에요 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 oauth2_id 길이 부족으로 인한 회원탈퇴 실패 수정이라는 핵심 변경을 정확히 요약합니다.
Linked Issues check ✅ Passed 연결된 #368의 회원탈퇴 시 DB 제약조건 오류 수정 요구를 컬럼 길이 확장과 마이그레이션으로 충족합니다.
Out of Scope Changes check ✅ Passed 요구사항과 무관한 변경은 보이지 않으며, 엔티티와 마이그레이션 수정만 포함됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#368-oauth2-id-column-length

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between ba84efc and 29586b4.

📒 Files selected for processing (2)
  • src/main/java/konkuk/thip/user/adapter/out/jpa/UserJpaEntity.java
  • src/main/resources/db/migration/V260726__Modify_oauth2_id_length.sql

@github-actions

Copy link
Copy Markdown

Test Results

498 tests   498 ✅  35s ⏱️
148 suites    0 💤
148 files      0 ❌

Results for commit 29586b4.

@hd0rable
hd0rable merged commit 2689367 into develop Jul 26, 2026
4 checks passed
@hd0rable
hd0rable deleted the fix/#368-oauth2-id-column-length branch July 26, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] 회원탈퇴 에러 수정

1 participant