refactor: ReservationNotFoundException 터지는 경우 멱등키 롤백 로직 추가#366
Merged
refactor: ReservationNotFoundException 터지는 경우 멱등키 롤백 로직 추가#366
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough이 PR은 멱등성 키에 대한 롤백 기능을 추가합니다. Redis 저장소에 삭제 메서드가 추가되고, 롤백 서비스 메서드가 생성되며, 취소 플로우가 실패 시 롤백을 트리거하는 예외 처리로 래핑됩니다. Changes
Sequence DiagramsequenceDiagram
participant Client
participant WaitingService
participant IdempotencyService
participant WaitingRepository
participant RedisRepo as WaitingIdempotencyRepository
participant Redis
Client->>WaitingService: cancelWaiting(request)
rect rgb(200, 150, 255, 0.5)
Note over WaitingService: Try Block
WaitingService->>WaitingRepository: lookup & cancel reservation
WaitingRepository-->>WaitingService: reservation cancelled
WaitingService->>RedisRepo: remove idempotency key
RedisRepo->>Redis: delete key
Redis-->>RedisRepo: acknowledged
RedisRepo-->>WaitingService: key deleted
WaitingService->>Client: CancelWaitingResponse
end
rect rgb(255, 100, 100, 0.5)
Note over WaitingService: Catch RuntimeException
WaitingService->>IdempotencyService: rollbackIdempotencyKey(key)
IdempotencyService->>RedisRepo: deleteByRegisterKey(key)
RedisRepo->>Redis: delete key
Redis-->>RedisRepo: acknowledged
RedisRepo-->>IdempotencyService: key deleted
IdempotencyService-->>WaitingService: rollback complete
WaitingService->>Client: rethrow exception
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
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.
작업 요약
Issue Link
#365
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit
릴리스 노트
새로운 기능
버그 수정