Skip to content

[FIX] : 채팅 요청 응답시, 요청 메세지 status가 REQUEST로 변경되도록 수정#262

Merged
yooooonshine merged 1 commit intodevelopfrom
feature/261-fix-ai-chat
Nov 16, 2025
Merged

[FIX] : 채팅 요청 응답시, 요청 메세지 status가 REQUEST로 변경되도록 수정#262
yooooonshine merged 1 commit intodevelopfrom
feature/261-fix-ai-chat

Conversation

@yooooonshine
Copy link
Contributor

@yooooonshine yooooonshine commented Nov 16, 2025

개요

작업사항

  • 채팅 요청 응답시, 요청 메세지 status가 REQUEST로 변경되도록 수정

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • AI 이미지 생성 요청의 상태 추적 및 저장 안정성을 개선했습니다.
    • 요청 메시지 상태 업데이트가 즉시 저장되도록 변경하여 데이터 일관성을 강화했습니다.

@coderabbitai
Copy link

coderabbitai bot commented Nov 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

요청 메시지의 상태를 REQUEST_PENDING에서 REQUEST로 변경하고 저장소에 즉시 반영하도록 AI 채팅 요청 처리 흐름을 개선했습니다. 세 개의 리스너 및 서비스 파일에서 상태 업데이트 후 저장 로직을 추가했습니다.

Changes

코호트 / 파일 변경 요약
문서화 개선
src/main/java/hanium/modic/backend/domain/ai/aiServer/listener/AiImageCreatedDlqListener.java
상태 업데이트 주석을 명확히 하여 요청 메시지의 상태가 RESPONSE_FAILED로 업데이트됨을 지정했습니다.
상태 저장소 반영
src/main/java/hanium/modic/backend/domain/ai/aiServer/listener/AiImageCreatedListener.java, src/main/java/hanium/modic/backend/domain/ai/aiServer/service/AiServerService.java
요청 메시지 상태를 REQUEST로 업데이트한 후 aiChatMessageRepository.save()를 호출하여 변경사항을 즉시 저장소에 반영하도록 추가했습니다. 이미지 생성 핸들러(성공/실패)와 요청 생성 로직 모두에서 이를 적용했습니다.

Sequence Diagram

sequenceDiagram
    participant Client
    participant AiServerService
    participant Repository
    participant AiImageCreatedListener
    participant SSE

    Client->>AiServerService: requestChatCreation()
    AiServerService->>AiServerService: Update status to REQUEST
    AiServerService->>Repository: save(requestChatMessage)
    Note over Repository: Status REQUEST_PENDING → REQUEST
    AiServerService->>AiServerService: Update chat room summary
    AiServerService->>AiServerService: Retrieve image
    AiServerService->>SSE: Send response

    rect rgb(220, 240, 255)
    Note over AiImageCreatedListener: On image creation success/failure
    AiImageCreatedListener->>Repository: save(requestChatMessage)<br/>with updated status
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 상태 업데이트와 저장 로직이 일관된 패턴으로 반복적으로 적용됨
  • 요청 메시지 상태 전이(REQUEST_PENDING → REQUEST) 흐름 이해 필요
  • 저장소 호출 타이밍이 각 파일에서 올바르게 배치되었는지 확인 권장

Possibly related PRs

Poem

🐰 요청의 상태, 미아(迷子)였던 REQUEST,
이제 REQUEST_PENDING에서 벗어나
저장소 속 안전한 곳으로 호핑♪
채팅의 응답은 이제 명확하고
상태는 언제나 동기화되네! 🌟

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/261-fix-ai-chat

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1683eb8 and fa30bd8.

📒 Files selected for processing (3)
  • src/main/java/hanium/modic/backend/domain/ai/aiServer/listener/AiImageCreatedDlqListener.java (1 hunks)
  • src/main/java/hanium/modic/backend/domain/ai/aiServer/listener/AiImageCreatedListener.java (2 hunks)
  • src/main/java/hanium/modic/backend/domain/ai/aiServer/service/AiServerService.java (1 hunks)

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.

❤️ Share

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

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.

[FIX] AiChat에서 채팅응답일 때, 요청 메세즈의 Status가 REQUEST_PENDING에서 REQUEST로 안변하는 에러 수정

1 participant