Skip to content

fix: SessionPersistenceService 트랜잭션 내 엔티티 재조회 및 중복 실행 방지#71

Merged
Boyeon-Shin merged 1 commit into
mainfrom
refactor/transactional-boundary
May 5, 2026
Merged

fix: SessionPersistenceService 트랜잭션 내 엔티티 재조회 및 중복 실행 방지#71
Boyeon-Shin merged 1 commit into
mainfrom
refactor/transactional-boundary

Conversation

@Boyeon-Shin
Copy link
Copy Markdown
Collaborator

📝 작업 내용 (Description)

SessionPersistenceService 트랜잭션 내 엔티티 재조회 및 중복 실행 방지

🔄 변경 유형 (Type of Change)

  • ✨ 새로운 기능 (feat)
  • 🐛 버그 수정 (fix)
  • 📝 문서 수정 (docs)
  • 💄 스타일 (style)
  • ♻️ 리팩토링 (refactor)
  • ✅ 테스트 (test)
  • 🔧 기타 (chore)

✅ 체크리스트 (Checklist)

  • 코드가 정상적으로 동작하는지 확인했습니다
  • 기존 테스트가 통과합니다
  • 필요한 경우 새로운 테스트를 추가했습니다

@Boyeon-Shin Boyeon-Shin self-assigned this May 5, 2026
@Boyeon-Shin Boyeon-Shin merged commit 61f07b8 into main May 5, 2026
3 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the session persistence logic to use session IDs instead of entity objects and introduces state validation checks before updating session statuses. A review comment suggests improving the validation in saveCompletedSession by ensuring the session is in the IN_PROGRESS state before proceeding, rather than only checking if it is already COMPLETED. This change would ensure consistency with the failure handling logic and prevent invalid state transitions from a FAILED status.

Comment on lines +23 to +25
if (session.getStatus() == SessionStatus.COMPLETED) {
return;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

saveCompletedSession 메서드에서 세션 상태가 COMPLETED인 경우만 체크하고 있습니다. 이미 실패(FAILED)한 세션이 완료 처리되는 것을 방지하고, saveFailedSession 메서드(35라인)의 검증 로직과 일관성을 유지하기 위해 IN_PROGRESS 상태가 아닌 경우 처리를 중단하도록 조건을 변경하는 것이 상태 관리 측면에서 더 안전합니다.

Suggested change
if (session.getStatus() == SessionStatus.COMPLETED) {
return;
}
if (session.getStatus() != SessionStatus.IN_PROGRESS) {
return;
}

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.

1 participant