Skip to content

Fix: 초대코드 중복 생성 문제 해결 #103

@jjh75607

Description

@jjh75607

목적

냉장고 초대 코드 생성 시 중복 체크 없이 랜덤 생성만 하고 있어, 확률은 낮지만 중복이 발생할 가능성이 있음

작업 상세 내용

  • InvitationCode의 code 필드에 유니크 제약조건 추가
  • Refrigerator 엔티티에서 유니크 제약조건 삭제
  • InvitationCodeGenerator에 중복 체크 및 재시도 로직 구현
  • 테스트 작성

참고 사항

  • @Embedded 타입의 필드는 @table 레벨 uniqueConstraints가 작동하지 않음
  • 32^8 경우의 수로 충돌 확률은 극히 낮지만 테스트 코드 실행시 간헐적으로 발생
  • 애플리케이션 레벨 재시도 로직(최대 3번)으로 이중 방어

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions