Conversation
📝 WalkthroughSummary by CodeRabbit릴리스 노트
Walkthrough결제 실패 시 reservation session을 orderId로 삭제하도록 ReservationSessionRemover를 주입·호출하는 로직을 PaymentService에 추가하고, Discord 에러 로거와 필터들에 로깅/포맷 변경을 적용했습니다. Changes
Sequence DiagramsequenceDiagram
participant Client
participant PaymentService
participant ReservationSessionRemover
participant ReservationSessionRepository
participant Database
Client->>PaymentService: getPaymentConfirm()/cancelPayment()
PaymentService->>PaymentService: 결제 처리 시도
alt 예외 발생 (ReservationNotFound, EventNotFound, TicketType... 등)
PaymentService->>PaymentService: redis 롤백
PaymentService->>PaymentService: deleteReservationSessionByOrderId(orderId)
PaymentService->>ReservationSessionRemover: deleteByOrderId(orderId)
ReservationSessionRemover->>ReservationSessionRepository: deleteByOrderId(orderId)
ReservationSessionRepository->>Database: DELETE FROM reservation_session WHERE order_id = ?
Database-->>ReservationSessionRepository: 삭제 완료
ReservationSessionRepository-->>ReservationSessionRemover: 완료
ReservationSessionRemover-->>PaymentService: 완료
PaymentService-->>Client: 예외 반환
else 정상 처리
PaymentService-->>Client: 결과 반환
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/permitseoul/permitserver/global/DiscordErrorLogAppender.java (1)
52-159:⚠️ Potential issue | 🟡 MinorDiscord 필드 길이 제한을 고려해 메시지/스택 길이를 조정하세요.
Discord embed 필드 값은 최대 1024자로 제한됩니다. 현재 코드는 메시지에 코드펜스(
```)를 추가하면 제한을 초과합니다. 예를 들어, 메시지가 1024자로 잘려도````로 감싸면 총 1030자가 되어 webhook이 거부될 수 있습니다.코드펜스 오버헤드(6자)를 고려하여 안전한 상한으로 조정하세요.
🔧 수정 제안(diff)
- // 메시지 처리 (최대 1024자) - String message = event.getFormattedMessage(); - if (message.length() > 1024) { - message = message.substring(0, 1021) + "..."; - } + // 메시지 처리 (Discord field value: 1024 제한 고려) + String message = event.getFormattedMessage(); + final int maxFieldValue = 1024; + final int codeFenceOverhead = 6; // ``` ``` + final int ellipsisOverhead = 3; // ... + final int maxMessageLength = maxFieldValue - codeFenceOverhead; + if (message.length() > maxMessageLength) { + message = message.substring(0, maxMessageLength - ellipsisOverhead) + "..."; + } @@ - final int maxStackLength = 1000; + final int maxStackLength = + maxFieldValue - codeFenceOverhead - "\n... (truncated)".length();
🤖 Fix all issues with AI agents
In
`@src/main/java/com/permitseoul/permitserver/domain/payment/api/service/PaymentService.java`:
- Around line 266-268: The deletion of reservation session inside
deleteReservationSessionByOrderId should be best‑effort and must not overwrite
upstream exceptions; wrap the call to
reservationSessionRemover.deleteByOrderId(orderId) in a try/catch (e.g., catch
Exception or RuntimeException), log the failure with context (include orderId
and the caught exception) and do not rethrow so the original exception mapping
is preserved—adjust the body of deleteReservationSessionByOrderId accordingly to
swallow/log deletion errors only.
🔥Pull requests
⛳️ 작업한 브랜치
👷 작업한 내용
🚨 참고 사항