Skip to content

[BUG] ALL,HOT,HOME, FESTIVAL 에서 축제 기간을 고려하여 조회#356

Merged
yaaan7 merged 3 commits into
developfrom
bug/355-community-date
Jun 16, 2026
Merged

[BUG] ALL,HOT,HOME, FESTIVAL 에서 축제 기간을 고려하여 조회#356
yaaan7 merged 3 commits into
developfrom
bug/355-community-date

Conversation

@yaaan7

@yaaan7 yaaan7 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

🔗 Related Issue

✨ 작업 개요

작업 내용을 간략하게 작성해주세요.
커뮤니티 ALL,HOT,HOME,FESTIVAL, STORE 조회 시 이벤트 기간 내에 있는 것들만

체크리스트

  • Reviewers, Assignees, Labels를 모두 등록했나요?
  • .gitignore 설정을 하였나요?
  • PR 머지 전 반드시 CI가 정상적으로 작동하는지 확인해주세요!

📷 이미지 첨부 (선택)

  • 작업 결과를 확인할 수 있는 이미지나 GIF를 첨부해주세요.
  • UI 변경, API 응답 샘플, 테스트 결과 등이 포함되면 좋아요!

🧐 집중 리뷰 요청

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.

@yaaan7 yaaan7 self-assigned this Jun 16, 2026
@yaaan7 yaaan7 added the 🐞 bug 버그 수정 label Jun 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several JPQL queries in CommunityRepository.java to filter out STORE and FESTIVAL community types unless they have an active event associated with their pin. The reviewer suggests replacing the direct use of CURRENT_TIMESTAMP in these queries with a :now parameter passed from the application. This change would prevent potential timezone mismatch issues between the application and database servers and improve the testability of the queries.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

select 1
from EventPin ep
where ep.pin = p
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

CURRENT_TIMESTAMP를 JPQL에서 직접 사용하면 다음과 같은 문제가 발생할 수 있습니다:

  1. 시간대(Timezone) 불일치: 애플리케이션 서버(예: KST)와 데이터베이스 서버(예: UTC)의 시간 설정이 다를 경우, 의도치 않은 시간 차이로 인해 조회 결과가 달라질 수 있습니다.
  2. 테스트 용이성 저하: 특정 시점의 데이터를 조회하는 단위 테스트나 통합 테스트를 작성할 때, 현재 시간을 제어하기 어려워 테스트가 불안정해집니다.

따라서 애플리케이션에서 LocalDateTime.now()를 파라미터(예: :now)로 전달받아 비교하는 방식을 권장합니다.

주의: 이 제안을 적용하려면 해당 메서드(findFeedByTypeAndRegion)의 시그니처에 @Param("now") LocalDateTime now 파라미터를 추가해야 합니다.

Suggested change
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime
and :now between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

select 1
from EventPin ep
where ep.pin = p
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

CURRENT_TIMESTAMP 대신 애플리케이션에서 전달한 시간 파라미터 :now를 사용하여 시간대 불일치 문제를 방지하고 테스트 용이성을 높이는 것을 권장합니다.

주의: 이 제안을 적용하려면 해당 메서드(findFeedByTypesAndRegion)의 시그니처에 @Param("now") LocalDateTime now 파라미터를 추가해야 합니다.

Suggested change
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime
and :now between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

select 1
from EventPin ep
where ep.pin = p
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

CURRENT_TIMESTAMP 대신 애플리케이션에서 전달한 시간 파라미터 :now를 사용하여 시간대 불일치 문제를 방지하고 테스트 용이성을 높이는 것을 권장합니다.

주의: 이 제안을 적용하려면 해당 메서드(findFeedByRegionOrGlobalTypes)의 시그니처에 @Param("now") LocalDateTime now 파라미터를 추가해야 합니다.

Suggested change
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime
and :now between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

select 1
from EventPin ep
where ep.pin = p
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

CURRENT_TIMESTAMP 대신 애플리케이션에서 전달한 시간 파라미터 :now를 사용하여 시간대 불일치 문제를 방지하고 테스트 용이성을 높이는 것을 권장합니다.

주의: 이 제안을 적용하려면 해당 메서드(findHotFeedByRegionOrGlobalTypes)의 시그니처에 @Param("now") LocalDateTime now 파라미터를 추가해야 합니다.

Suggested change
and CURRENT_TIMESTAMP between ep.eventStartTime and ep.eventEndTime
and :now between ep.eventStartTime and ep.eventEndTime

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@yaaan7 yaaan7 merged commit 7effa5d into develop Jun 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 커뮤니티 축제 기간

1 participant