feat(pdf): PDF 내보내기 실패 FCM 알림 - #220
Merged
Merged
Conversation
failAndRefund void→boolean(실제 환불한 호출만 true) · 렌더 리스너·복구 스케줄러가 true일 때만 PdfExportFailedEvent 발행 · NotificationType.PDF_EXPORT_FAILED(REPORT)+핸들러 추가 · FCM 딥링크(type=PDF_EXPORT_FAILED, targetId=jobId) 처리 · getStatus에 type·startDate·endDate 추가 · Swagger 갱신 · 테스트 추가
confirm void→boolean(실제 확정한 호출만 true) · 리스너가 true일 때만 완료 이벤트 발행 · 복구 스윕이 먼저 실패·환불한 뒤 늦은 confirm이 "완성" 푸시를 보내던 버그 차단 · 테스트 추가
Collaborator
|
머지하시면 됩니다! |
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.
📝 요약(Summary)
기획 추가에 따라 PDF 내보내기 실패 시 FCM 알림을 추가하고, 그 과정에서 발견한 confirm 버그를 함께 고쳤습니다.
실패 알림 추가: 생성 화면을 벗어난 뒤 실패한 작업은 지금까지 어떤 API로도 관측할 수 없었습니다(아카이브는 COMPLETED만, /current는 진행 중만, 폴링은 jobId 필요). 특히 복구 스윕(stuck 60분)은 정의상 항상 이탈 후에 터져 100% 무통보였습니다. → 실패 확정·환불 뒤 PdfExportFailedEvent를 발행해 FCM으로 통보합니다.
failAndRefund void → boolean: 실제로 환불한 호출만 true를 돌려주고, 렌더 리스너·복구 스케줄러 두 경로가 true일 때만 발행합니다. CAS 경합에서 진 호출(이미 완료·환불된 job)의 오발송·이중발송을 막습니다.
confirm 대칭 버그 수정: confirm도 boolean 반환으로 바꿔 if (confirm(...)) notifyCompleted(...)로 가드했습니다. 기존엔 스윕이 먼저 실패·환불 처리한 뒤 렌더가 늦게 성공하면 "완성됐어요" 푸시가 잘못 나갔습니다.
getStatus에 type·startDate·endDate 추가: 실패 알림 딥링크로 진입 시 FAILED를 조회할 유일 방법입니다.
딥링크: FCM data type=PDF_EXPORT_FAILED, targetId=jobId → 실패 화면.
🔗 Related Issue
💬 공유사항
실패 화면 "포함 내용" 개수: 폴링 엔드포인트에 정적 카운트를 매번 싣지 않으려고, FE가 getStatus의 기간으로 preview를 한 번 더 호출하는 방식으로 정했습니다. FE에 공유할 문서는 이 PR 머지 후 업데이트 예정입니다.
notification-template.yml 업데이트 했으니 확인 부탁드립니다~
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.