Skip to content

Conversation

@ggamnunq
Copy link
Contributor

@ggamnunq ggamnunq commented Aug 30, 2025

cursor-id에 "null" 혹은 빈칸이 들어가도 조회되도록 수정

Summary by CodeRabbit

  • 버그 수정
    • 채팅 기록 초기 로드 시 cursorId가 비어 있거나 "null"인 경우에도 최신 메시지가 안정적으로 표시됩니다.
    • 이후 페이지 로딩에서는 커서 이전 메시지만 정확히 불러와 스크롤/페이지네이션이 매끄럽습니다.
    • 메시지 정렬과 시간순 표시의 일관성이 개선되었습니다.
    • 과도한 페이지 크기 요청에 대한 제한 동작은 기존과 동일하게 유지됩니다.

@ggamnunq ggamnunq self-assigned this Aug 30, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

채팅 히스토리 조회 로직에서 cursorId 판단 기준을 공백/문자열 "null" 포함으로 확장하고, 초기 조회 시 최신 메시지, 유효한 커서가 있을 때 커서 미만 ID 기준 조회로 분기합니다. 페이지 사이즈 유효성 검사는 동일하며, 이후 사용자 매핑과 DTO 구성 흐름은 그대로 유지됩니다.

Changes

Cohort / File(s) Change Summary
Chat history retrieval logic
src/main/kotlin/busanVibe/busan/domain/chat/service/ChatMongoService.kt
- cursorId 분기 조건을 `cursorId.isNullOrBlank()

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant ChatMongoService
  participant ChatRepository
  participant UserRepository

  Client->>ChatMongoService: getChatHistory(cursorId, pageSize)
  ChatMongoService->>ChatMongoService: validate pageSize
  alt 초기 조회 (cursorId가 null/blank/"null")
    ChatMongoService->>ChatRepository: findAllByTypeOrderByTimeDesc(CHAT, Pageable(pageSize))
  else 커서 기반 조회
    ChatMongoService->>ChatRepository: findByIdLessThanAndTypeOrderByTimeDesc(cursorId, CHAT, Pageable(pageSize))
  end
  ChatRepository-->>ChatMongoService: messages
  ChatMongoService->>UserRepository: findAllById(userIds from messages)
  UserRepository-->>ChatMongoService: users
  ChatMongoService-->>Client: ChatMessageResponseDTO.ListDto
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

토깽이, 수풀 속 채팅줄 따라가네
"null"도 공백도, 이제 길잡이네
처음엔 최신, 커서 땐 그전 이야기
살금살금 페이지를 톡톡 넘기니
대화의 발자국이 밤하늘처럼 반짝 🌙🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d5cf613 and 04b437f.

📒 Files selected for processing (1)
  • src/main/kotlin/busanVibe/busan/domain/chat/service/ChatMongoService.kt (2 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ggamnunq ggamnunq merged commit 396ccdb into main Aug 30, 2025
1 of 2 checks passed
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