Skip to content

Comments

fix: 스탬프 완료 로직 버그 수정 (#79)#80

Merged
hisonghy merged 1 commit intodevelopfrom
bugfix/79
Oct 12, 2025
Merged

fix: 스탬프 완료 로직 버그 수정 (#79)#80
hisonghy merged 1 commit intodevelopfrom
bugfix/79

Conversation

@hisonghy
Copy link
Contributor

@hisonghy hisonghy commented Oct 12, 2025

📌 작업 내용 및 특이사항

✅ 스탬프 완료 로직 버그 해결

  • 스탬프 완료 요청 시, 200 OK 응답은 잘 되지만 Stamp 엔티티의 completed 필드가 false -> true로 업데이트되지 않는 버그가 발생했습니다.
  • 기존 StampService.completeStamp()에 트랜잭션이 적용되어 있는데, 트랜잭션 밖에서 조회된 Stamp 엔티티를 매개변수로 전달받아 업데이트를 수행하고 있었습니다.
  • 실행 시 전달된 Stamp는 현재 영속성 컨텍스트에서 관리되지 않는 상태라 더티 체킹이 정상적으로 동작하지 않았습니다.
  • StampService.completeStamp()의 트랜잭션을 제거하고, 상위 로직인 StampFacade.completeStamp()에 트랜잭션을 적용해 하나의(동일한) 트랜잭션 내에서 동일한 영속성 컨텍스트로 엔티티가 관리되도록 수정했습니다.
  • StampService.completeStamp() 트랜잭션을 유지하고, 매개변수로 ID를 받아 해당 메서드에서 직접 엔티티를 조회하고 업데이트하는 방법도 있었지만 코드의 수정과 변경 범위를 생각해 위의 방법을 사용했습니다.

🌱 관련 이슈


🔍 참고사항(선택)


📚 기타(선택)

* fix: StampService.completeStamp() 트랜잭션 제거
* fix: StampFacade.completeStamp() 트랜잭션 적용
@hisonghy hisonghy self-assigned this Oct 12, 2025
@hisonghy hisonghy added the 🐛bug 버그 발견 및 수정/해결 label Oct 12, 2025
Copy link
Contributor

@chaiminwoo0223 chaiminwoo0223 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다. 머지 부탁드립니다!

@hisonghy hisonghy merged commit 6ddacdb into develop Oct 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug 버그 발견 및 수정/해결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛️[BUG]: 스탬프 완료 요청 시 completed 필드가 수정되지 않는 버그 해결

2 participants