Repository navigation
fix: 채팅 거래 요청이 실시간으로 전달되지 않던 문제 - #106
Merged
Merged
Conversation
fix: update Dockerfile COPY paths for repo-root build context
feat: 요청 게시글 상세 조회 시 연관 데이터 조회 개선
chore: 프론트엔드 런타임 API 주소 설정 추가
ci: 커밋 기준 자동 배포 트리거 설정 추가
fix: Render 백엔드 Dockerfile 경로 수정
- 하트비트가 없으면 유휴 WebSocket이 프록시(Render 등)에 의해 조용히 끊기고, 끊긴 사이 브로드캐스트된 메시지(거래 요청 카드 등)가 유실됨 - 서버: enableSimpleBroker에 setHeartbeatValue(10s/10s) + 전용 TaskScheduler - 클라이언트: heartbeatIncoming/Outgoing 10s 명시, reconnectDelay 3s Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- 심플 브로커는 미접속 클라이언트 메시지를 큐잉하지 않으므로, 재연결 직후 서버 상태 기준으로 히스토리와 거래 플로우를 다시 맞춤 - connectChatRoom onConnect에서 첫 연결은 건너뛰고 재연결부터 catchUpAfterReconnect() 실행 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- 저장은 호출자 트랜잭션 안에서, convertAndSend는 afterCommit 동기화로 이동 - 커밋 전 발행 시 롤백되면 유령 메시지가 생기고, 구독자가 아직 DB에 없는 행을 참조할 수 있었음 - 트랜잭션이 없는 호출 경로는 즉시 발행(기존 동작 유지) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
📌 작업 내용
🔍 주요 변경 사항
원인
enableSimpleBroker("/topic")에 하트비트 설정이 없어 유휴 WebSocket이 프록시(Render 등)에 의해 조용히 끊김. 심플 브로커는 미접속 클라 메시지를 큐잉하지 않고, 재연결 시 놓친 메시지를 복구하지도 않음.→ 거래 요청은 "요청자가 상대의 금액 책정을 기다리는" 이 플로우의 가장 긴 유휴 구간 직후에 도착 → 죽은 소켓에 떨어져 유실.
→ 거래 완료는 항상 방금 활동한 사람이 받는 구조라 소켓이 살아있음.
WebSocketConfig
setHeartbeatValue(10s/10s)+ 전용TaskScheduler빈 추가chatSocket.js
heartbeatIncoming/Outgoing: 10000,reconnectDelay: 3000명시ChatPage.js
connectChatRoomonConnect에서 첫 연결은 건너뛰고, 재연결부터catchUpAfterReconnect()로 히스토리·거래 플로우 상태를 서버 기준으로 재조회ChatMessagePublisher
convertAndSend를TransactionSynchronization.afterCommit으로 이동 (저장은 호출자 트랜잭션 안 유지)🧪 테스트
./gradlew compileJava성공ChatServiceTest+TradeServiceTest8건 통과 (두 테스트 모두ChatMessagePublishermock → afterCommit 변경 영향 없음 확인)node --check통과📸 결과