Skip to content

Conversation

@stoneTiger0912
Copy link
Member

@stoneTiger0912 stoneTiger0912 commented Oct 2, 2025

📝 변경 내용


✅ 체크리스트

  • 코드가 정상적으로 동작함
  • 테스트 코드 통과함
  • 문서(README 등)를 최신화함
  • 코드 스타일 가이드 준수

💬 기타 참고 사항

Summary by CodeRabbit

  • 신기능
    • 카드셋 실시간 협업 지원: 여러 사용자가 동시에 편집하고 변경 사항을 즉시 공유
    • 문서 상태 동기화 및 인원 참가/퇴장 알림
    • 하트비트 기반 연결 유지로 안정적인 웹소켓 세션
  • 리팩터
    • 애플리케이션에 웹소켓 어댑터를 적용하여 실시간 통신 활성화
  • 작업
    • 런타임 의존성 추가: 웹소켓/Socket.IO 및 실시간 동기화 관련 패키지

@stoneTiger0912 stoneTiger0912 requested a review from dungbik October 2, 2025 05:12
@stoneTiger0912 stoneTiger0912 self-assigned this Oct 2, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2025

Walkthrough

WebSocket 지원을 도입하고 Socket.IO 어댑터를 설정했다. 새 WebSocket 모듈과 게이트웨이를 추가했다. 앱 부트스트랩을 NestExpressApplication으로 전환하고 IoAdapter를 적용했다. 패키지 의존성을 추가했다. 일부 서비스 클래스에서 @Injectable() 데코레이터를 제거했다. 기타 사소한 포맷 변경이 포함됐다.

Changes

Cohort / File(s) Summary
Runtime dependencies
package.json
새 의존성 추가: @nestjs/platform-socket.io, @nestjs/websockets, socket.io, y-protocols.
App bootstrap & WebSocket adapter
src/app.module.ts, src/main.ts
WebSocketModule를 AppModule에 import. NestExpressApplication 타입으로 부트스트랩하고 IoAdapter를 등록해 WebSocket 어댑터 설정.
WebSocket module & gateway
src/websocket/websocket.module.ts, src/websocket/websocket.gateway.ts
WebSocketModule 추가 및 CollaborationGateway 도입. 연결/해제, 룸 조인/나가기, 텍스트 업데이트, Yjs 메시지(auth, sync, update, awareness), 하트비트 처리 로직 구현.
Service DI decorator removals
src/card/card.service.ts, src/cardset-manager/cardset-manager.service.ts, src/cardset/cardset.service.ts
각 서비스 클래스에서 @Injectable() 제거. 클래스 export는 유지.
Minor formatting
src/card/entities/card.entity.ts
파일 말미 개행 조정. 기능 변화 없음.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant GW as CollaborationGateway (Socket.IO)
  participant RM as Room (/cardsets)
  participant YJ as Yjs Doc

  Client->>GW: connect
  GW->>Client: connected ack

  Client->>GW: joinRoom {documentId, userId?}
  GW->>YJ: get/create Doc for documentId
  GW->>RM: add client to room(documentId)
  GW-->>Client: send current doc state
  GW-->>RM: broadcast new-user

  rect rgb(235, 245, 255)
    note right of Client: Yjs collaboration
    Client->>GW: yjs-message (sync/update/awareness)
    GW->>RM: forward to peers in room
    RM-->>Client: peer updates
  end

  par Heartbeat
    GW-->>Client: heartbeat (interval)
    Client->>GW: heartbeat-ack
  and Disconnect
    Client--X GW: disconnect
    GW->>GW: stopHeartbeat(clientId)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • dungbik

Poem

토끼는 귀를 쫑긋, 소켓에 접속해 폴짝!
방에 모여 Y를 싹, 문서를 맞춰 착착.
하트비트 뛰고, 업데이트 휘릭—
귓불 간질이는 신호가 삐빅✨
오늘도 협업의 당근, 실시간으로 냠냠 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 제목이 카드셋 에디터 구현이라는 변경의 일면을 실제 반영하고 있으나 PR의 핵심 변경 사항인 웹소켓 및 Yjs 기반 협업 게이트웨이 추가를 명확히 요약하지는 못합니다. 제목이 전체적으로 무관하거나 모호하지 않으므로 이 체크는 통과로 판단됩니다.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/setup-entity

📜 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 eb22d5e and 799580e.

📒 Files selected for processing (1)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b64d6f7 and b10c5b8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • package.json (1 hunks)
  • src/app.module.ts (2 hunks)
  • src/main.ts (2 hunks)
  • src/websocket/websocket.gateway.ts (1 hunks)
  • src/websocket/websocket.module.ts (1 hunks)
  • test-client.html (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/websocket/websocket.module.ts (1)
src/app.module.ts (1)
  • Module (12-34)
🪛 GitHub Actions: Node CI with NestJS
src/websocket/websocket.gateway.ts

[warning] 60-60: Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises


[warning] 110-110: Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises


[error] 167-167: Unsafe object destructuring of a property with an any value @typescript-eslint/no-unsafe-assignment

🪛 GitHub Check: build
src/websocket/websocket.gateway.ts

[warning] 267-267:
Unsafe argument of type any assigned to a parameter of type Iterable<unknown> | ArrayLike<unknown>


[failure] 262-262:
Unsafe assignment of an any value


[warning] 252-252:
Unsafe argument of type any assigned to a parameter of type Iterable<unknown> | ArrayLike<unknown>


[warning] 247-247:
Unsafe argument of type Uint8Array<any> assigned to a parameter of type Uint8Array<ArrayBufferLike>


[failure] 246-246:
Unsafe assignment of an any value


[failure] 221-221:
Unsafe assignment of an any value


[warning] 171-171:
Unsafe argument of type any assigned to a parameter of type { token: string; userId: string; documentId: string; }


[failure] 167-167:
Unsafe object destructuring of a property with an any value


[warning] 110-110:
Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator


[warning] 60-60:
Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b10c5b8 and eb22d5e.

📒 Files selected for processing (5)
  • src/card/card.service.ts (1 hunks)
  • src/card/entities/card.entity.ts (1 hunks)
  • src/cardset-manager/cardset-manager.service.ts (1 hunks)
  • src/cardset/cardset.service.ts (1 hunks)
  • src/websocket/websocket.gateway.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/websocket/websocket.gateway.ts

@stoneTiger0912 stoneTiger0912 merged commit 3665389 into develop Oct 2, 2025
1 of 2 checks passed
@stoneTiger0912 stoneTiger0912 deleted the feat/setup-entity branch October 2, 2025 05:27
@coderabbitai coderabbitai bot mentioned this pull request Dec 20, 2025
4 tasks
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.

2 participants