Conversation
[bug] 히든이미지 저장 시 필드값 저장이 DB반영이 안되던 문제 수정
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.
📌 PR 정보
bug/#375develop📋 Summary
구버전 앱(1.2.0 미만) 사용자의 히든 프로필 이미지 제출 시, 회원 상태가
HIDDEN_COMPLETED로 변경되지 않던 트랜잭션 경계 분리로 인한 영속성 컨텍스트 문제를 해결했습니다.🐛 Problem
발생 상황
POST /v1/signup/hidden-images)member.completeHiddenProfile()메서드 호출PERSONALITY_COMPLETED상태에 머물러 관리자 심사 진행 불가근본 원인: 트랜잭션 경계 분리 문제
JPA 영속성 컨텍스트 문제:
registerHiddenImages()메서드 실행 중member는 영속성 컨텍스트에서 관리됨member는 준영속 상태로 전환completeHiddenProfile()로 변경한memberStatus필드가 DB에 반영되지 않음✅ Solution
변경 사항
파일:
src/main/kotlin/codel/member/business/signup/PreVerificationStrategy.ktBefore
After
핵심 변경 내용
Member 엔티티 재조회
findMember는 영속 상태영속 상태 엔티티에 대한 변경
로그 개선
memberStatus포함appVersion: < 1.2.0)🧪 Testing
테스트 시나리오
1. 정상 플로우 테스트
2. 재현 테스트 (수정 전 동작 확인)
member_status가HIDDEN_COMPLETED로 변경 확인hidden_completed_at타임스탬프 확인수동 테스트 결과
📊 Impact
영향받는 사용자
영향받는 기능
Breaking Changes
🔍 Technical Details
JPA 영속성 컨텍스트와 트랜잭션
영속성 컨텍스트 생명주기
수정 후 플로우
대안 방법들
방법 1: EntityManager.merge() 사용
방법 2: Repository에서 직접 UPDATE (현재 선택)
방법 3: 트랜잭션 전파 설정 변경
선택 이유: 방법 2가 가장 명확하고 안전
📝 Checklist
개발
문서
배포 전
🔗 Related
Issues
Commits
References
📸 Screenshots
Before (버그 재현)
After (수정 완료)
👨💻 Reviewers
@[팀원1] @[팀원2]
💬 Notes
PostVerificationStrategy를 사용하므로 영향 없습니다.