Skip to content

#170 - 쪽지 답장 관련 예외들을 수정합니다. #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2025

Conversation

kpeel5839
Copy link
Contributor

1. 🔗 관련 이슈

closes #170

2. 📄 구현한 내용 또는 수정한 내용

3. ✅ 배포 Checklist

  • 본인을 Assign 해주세요.

@kpeel5839 kpeel5839 requested a review from Copilot May 24, 2025 08:00
@kpeel5839 kpeel5839 self-assigned this May 24, 2025
@kpeel5839 kpeel5839 added 🔨픽스🔨 버그 및 잠재적 문제 해결 🏋️매튜🏋️ 24기 김재연 labels May 24, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes reply-related edge cases by updating date filters, refining anonymity and response logic, and introducing a title endpoint for messages.

  • Change from parameter from LocalDate to LocalDateTime and adjust repository query
  • Refactor anonymity checks, null handling in profile mapping, and answerability logic
  • Add new title retrieval endpoint and tighten request nullability for anonymous messages

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
infrastructure/mysql/.../MessageV2PersistenceAdapter.kt Convert from to LocalDateTime via atStartOfDay()
infrastructure/mysql/.../MessageV2JpaRepository.kt Update findAllLastMessageOfRoomByReceiverIdAndFromDate signature
domain/.../UserProfiles.kt Add viewer parameter and filter nulls before mapping
domain/.../UserProfile.kt Allow nullable user in factory, adjust isAbleToAnswer logic
domain/.../MessageV2.kt Rename anonymity methods, simplify isAbleToAnswer
domain/.../MessageRooms.kt Rename user to viewer, make viewer() nullable
domain/.../MessageRoom.kt Rename isAnonymous helpers to clarify actor vs. receiver
core/.../GetTitleOfMessageV2Service.kt Implement new use case for title retrieval
core/.../GetMessageV2Service.kt Pass viewer to createOverview
core/.../GetAnonymousProfileService.kt Rename login variable, pass viewer, update of call
core/.../CreatedMessageV2Service.kt Force non-null on anonymous fields
core/.../GetTitleOfMessageV2UseCase.kt Define interface for title use case
core/.../TitleOfMessageV2Response.kt Create response model with user-specific message title
core/.../MessageV2OverviewResponses.kt Stubbed companion object
core/.../MessageV2OverviewResponse.kt Update isAnonymous mapping to receiver-centric check
core/.../CreatedMessageV2Request.kt Make anonymous fields nullable
app/.../GetTitleOfMessageV2Controller.kt Add controller for title endpoint
app/.../GetMessageV2Controller.kt Cleanup imports
app/.../CreateMessageV2Controller.kt Annotate request body parameter
Comments suppressed due to low confidence (5)

domain/src/main/kotlin/com/wespot/message/v2/UserProfiles.kt:42

  • [nitpick] Chaining sortedBy { ... }.reversed() can be simplified to sortedByDescending { ... } for clearer intent and fewer operations.
.reversed()

domain/src/main/kotlin/com/wespot/message/v2/UserProfile.kt:61

  • The logic in isAbleToAnswer() now returns true when messageRoom is empty, reversing previous behavior. Confirm this change reflects intended reply permissions, or revert to false for empty rooms.
return true

domain/src/main/kotlin/com/wespot/message/v2/MessageRooms.kt:47

  • Changing viewer() to return nullable allows a null viewer when there are no rooms, which may lead to unexpected NPEs downstream. Consider throwing when viewerSet is empty instead of returning null.
return viewerSet.firstOrNull()

core/src/main/kotlin/com/wespot/message/service/v2/CreatedMessageV2Service.kt:51

  • Forcing !! on anonymousProfileName (and similarly on anonymousImageUrl) can trigger runtime NPE if the client omits these fields. Add explicit validation or return a bad-request error when these are null.
name = createdMessageV2Request.anonymousProfileName!!,

core/src/main/kotlin/com/wespot/message/dto/response/TitleOfMessageV2Response.kt:12

  • [nitpick] The literal includes a leading space after the newline ("\n 쪽지..."), which may render an unintended indent. Consider removing the extra space for consistent formatting.
return TitleOfMessageV2Response("${loginUser.name}님을 설레게 한 친구에게\n 쪽지로 마음을 표현해 보세요")

@kpeel5839 kpeel5839 merged commit 040ef98 into develop May 24, 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
🏋️매튜🏋️ 24기 김재연 🔨픽스🔨 버그 및 잠재적 문제 해결
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature]: 쪽지 답장을 클라이언트와 연결하면서 발생한 문제를 수정합니다.
1 participant