Skip to content

[ai-assisted] fix(mail): SSE stream 노출 조건 보강#377

Merged
donghyuck merged 1 commit into2.xfrom
codex/issue-375-mail-sse
Apr 29, 2026
Merged

[ai-assisted] fix(mail): SSE stream 노출 조건 보강#377
donghyuck merged 1 commit into2.xfrom
codex/issue-375-mail-sse

Conversation

@donghyuck
Copy link
Copy Markdown
Owner

@donghyuck donghyuck commented Apr 29, 2026

Why

  • 메일 동기화 화면에서 /api/mgmt/mail/sync/stream SSE 연결이 500으로 실패하는 이슈를 수정합니다.
  • 원인은 studio.features.mail.web.notify=stomp 설정에서 SSE 컨트롤러가 등록되지 않고, 해당 요청이 static resource fallback으로 흘러 NoResourceFoundException이 500 응답으로 포장되는 구조였습니다.

What

  • studio.features.mail.web.notify를 작업 완료 알림 전송 채널로 유지하고, SSE endpoint 노출은 studio.features.mail.web.sse로 분리했습니다.
  • notify=stomp이어도 sse=false를 명시하지 않으면 /sync/stream이 계속 노출되도록 자동 구성 조건을 보강했습니다.
  • SSE 연결 직후 connected 이벤트를 전송해 text/event-stream 200 응답이 안정적으로 열리도록 했습니다.
  • SSE/STOMP notifier가 동시에 있을 때 한 notifier 실패가 다른 notifier 전송을 막지 않도록 CompositeMailSyncNotifier를 추가했습니다.
  • mail starter/module README에 notifysse 설정 책임을 문서화했습니다.

Related Issues

Validation

  • Command: ./gradlew :starter:studio-application-starter-mail:test :studio-application-modules:mail-service:test
  • Result: 성공
  • Command: git diff --cached --check
  • Result: 성공
  • Command: curl -i -H 'Accept: text/event-stream' -H 'Authorization: Bearer <token>' http://localhost:8080/api/mgmt/mail/sync/stream
  • Result: HTTP/1.1 200, Content-Type: text/event-stream, event:connected 수신

Risk / Rollback

  • Risk: notify=stomp 구성에서도 SSE endpoint가 기본 노출되므로 기존보다 노출 surface가 넓어질 수 있습니다. 다만 기존 클라이언트 호환성과 이슈 #375의 실패 조건을 해결하기 위한 의도된 동작이며, studio.features.mail.web.sse=false로 명시 비활성화할 수 있습니다.
  • Rollback: 해당 커밋을 revert하면 기존처럼 notify 값에 따라 SSE endpoint 등록 여부가 결정됩니다.

AI / Subagent Usage

  • AI-assisted: Yes
  • Subagent used: No
  • Delegated scope: 없음
  • Main author validation: 이슈 재현 로그 확인, 코드 리뷰, targeted test, SSE curl smoke test 수행

Checklist

  • commit message follows policy
  • issue template used or exception recorded
  • AI-Assisted value is correct
  • validation recorded
  • subagent usage recorded when used
  • CI / repository verification passed
  • human review completed before merge
  • no unrelated changes included

Issue:
- #375

Why:
- mail web notify transport가 stomp로 설정되면 SSE stream endpoint가 등록되지 않아 /api/mgmt/mail/sync/stream 요청이 static resource fallback으로 처리되고 500 응답으로 포장됐다.

What:
- mail web notify 전송 채널과 SSE endpoint 노출 조건을 분리했다.
- SSE 연결 직후 connected 이벤트를 전송해 text/event-stream 응답이 안정적으로 열린다.
- SSE/STOMP notifier가 함께 있을 때 notifier별 예외를 격리하는 CompositeMailSyncNotifier를 추가했다.
- mail starter/module README에 notify와 sse 설정 책임을 문서화했다.

Validation:
- ./gradlew :starter:studio-application-starter-mail:test :studio-application-modules:mail-service:test: 성공
- git diff --cached --check: 성공
- curl GET /api/mgmt/mail/sync/stream: HTTP 200 text/event-stream 및 connected 이벤트 확인
Copy link
Copy Markdown
Owner Author

@donghyuck donghyuck left a comment

Choose a reason for hiding this comment

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

Self-review completed.

확인 결과:

  • PR diff는 이슈 #375 범위의 mail SSE/STOMP auto-configuration, notifier, 테스트, README 변경만 포함합니다.
  • notify=stomp 구성에서도 sse=false를 명시하지 않으면 SSE endpoint가 등록되어 기존 클라이언트 연결 실패를 방지합니다.
  • CompositeMailSyncNotifier로 notifier별 예외가 격리되어 STOMP/SSE 동시 구성에서 한 전송 실패가 다른 전송을 막지 않습니다.
  • targeted tests와 SSE smoke test, gitleaks check가 통과했습니다.

추가 수정 필요 사항은 발견하지 못했습니다. 브라우저 alert 제거는 병합 후 프론트 dev 환경에서 최종 확인하면 됩니다.

@donghyuck donghyuck merged commit 6880f16 into 2.x Apr 29, 2026
2 checks passed
@donghyuck donghyuck deleted the codex/issue-375-mail-sse branch April 29, 2026 12:41
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