Skip to content

[Chore] Feed Processing SSE 진단 로그 추가 - #90

Open
lioba00700 wants to merge 1 commit into
devfrom
chore/feed-sse-diagnostics
Open

lioba00700 wants to merge 1 commit into
devfrom
chore/feed-sse-diagnostics

Conversation

@lioba00700

Copy link
Copy Markdown
Member

🎯 작업 내용

QA에서 피드 업로드 후 AI 처리 SSE가 반복적으로 실패하는 원인을 확인할 수 있도록 Feed Processing 전체 구간에 진단 로그를 추가했습니다.

업로드 요청부터 job 생성, 초기 status 조회, SSE 연결/응답/메시지, polling fallback, 앱 lifecycle cleanup까지 하나의 jobId 흐름으로 추적할 수 있습니다.

🔍 확인하려는 문제

현재 Feed SSE는 공통 인증 client가 아니라 expo/fetch로 직접 연결하며, 연결 시점의 access token을 직접 읽습니다. 따라서 실패 원인이 인증 만료, HTTP 응답 거절, content-type/stream body 문제, terminal event 누락, 앱 background 전환 중 abort 중 어디에 있는지 기존 로그만으로 구분하기 어려웠습니다.

이번 변경은 동작을 수정하지 않고 실패 지점을 관찰할 수 있는 로그만 추가합니다.

✅ 주요 변경 사항

업로드 및 Job 생성

  • 업로드 시작과 생성된 jobId, feedId, 초기 status 기록
  • 업로드 실패 시 오류 name/message/code/status 요약

SSE 연결

  • access token 존재 여부와 만료 여부 기록
  • 응답 status, content-type, 연결 소요 시간 기록
  • non-2xx 응답 body를 최대 300자로 제한해 미리보기 기록
  • stream chunk/message 수와 수신 byte, 종료/abort 지점 기록
  • 파싱된 event type과 terminal event 수신 여부 기록

Monitoring 및 Lifecycle

  • 초기 status와 polling status 기록
  • SSE 실패 후 polling fallback 원인 기록
  • 앱 foreground/background 전환과 monitor cleanup 기록
  • coordinator promise rejection을 누락하지 않고 기록

민감정보 보호

  • access token 원문과 Authorization header는 기록하지 않음
  • 오류 객체 전체 대신 name/message/code/status만 기록
  • SSE data preview는 공백을 정리하고 300자로 제한

🧪 확인 사항

  • Feed Processing 테스트 25개 통과
  • 민감한 Authorization header가 오류 요약에 포함되지 않는 테스트 추가
  • SSE payload 미리보기 길이 제한 테스트 추가
  • TypeScript 검사 통과
  • ESLint 검사 통과
  • Steiger FSD 검사 통과

📌 QA 확인 방법

콘솔에서 [FeedProcessingDebug]로 필터링한 뒤 피드 업로드를 한 번 재현해주세요.

특히 다음 로그를 함께 확인하면 원인을 빠르게 좁힐 수 있습니다.

  • [SSE] response-received: HTTP status와 content-type
  • [SSE] response-rejected: 401/403/5xx 및 response preview
  • [SSE] stream-read-failed: stream 중단 시점
  • [Monitor] stream-fallback-to-polling: fallback 원인
  • [Coordinator] app-state-changed: background 전환 영향

원인이 확정되면 진단 로그 유지 범위와 실제 수정은 별도 변경으로 정리합니다.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3c26c4be-9779-41f0-acef-5f16029e541d
📥 Commits

Reviewing files that changed from the base of the PR and between c21301f and 0e2d5d1.

📒 Files selected for processing (6)
  • src/features/feed/save-feed/__tests__/feed-processing.test.cjs
  • src/features/feed/save-feed/api/feed-ai-job-client.ts
  • src/features/feed/save-feed/lib/feed-processing-debug.ts
  • src/features/feed/save-feed/model/processing/feed-ai-job-monitor.ts
  • src/features/feed/save-feed/model/processing/feed-processing-coordinator.tsx
  • src/features/feed/save-feed/model/publishing/feed-publishing-coordinator.tsx
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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