Skip to content

Conversation

@hyerinhwang-sailin
Copy link
Collaborator

@hyerinhwang-sailin hyerinhwang-sailin commented Apr 3, 2025

Related issue 🛠

Work Description ✏️

홈화면 최신 일정 불일치 이슈

  • 최신 일정을 산정하는 기준이 CurrentDate.now였는데, 현재 날짜를 계산하는 CurrentDate class에서 now가 static final 필드여서 서버 시작 시점에 날짜가 고정돼있던 이슈를 발견했습니다. 그래서 동적으로 최신 날짜를 계산하도록 메소드화 시켰습니다.
    0214dba

  • 또한 전체 일정을 불러올 때는 시작일자 기준으로 정렬 후 시작일자가 동일한 일정은 종료일자를 기준으로 한번 더 정렬하게 되는데 최신 일정은 시작일자로만 정렬하고 있었기에 정렬 기준을 통일시켰습니다.
    53779b5

  • 하지만 이슈 리포트에서 날짜가 각각 4/3, 4/5로 다르게 불러와진 1차 세미나의 경우 디버깅했을 때 코드 상 이상이 없었고, 로컬에서 동일한 데이터셋으로 테스트했을 때에도 정상적으로 작동해서 redis cache 문제인 것으로 추정돼 prod, dev 서버에서 캘린더 캐시를 한번 정리했습니다.

  • 현재 제 계정 기준으로는 정상적으로 날짜도 동일하게 조회되고 최신 일정도 1차 세미나로 불러와집니다. 유저별로 다른 최신 일정이 조회된 것은 CurrentDate 이슈, 날짜가 다르게 불러와진 것은 기존의 캐시에 4/3으로 기재된 이슈인 것으로 추정되나 우선 더 qa가 필요할 것 같습니다.

이외에 이전 pr의 리팩토링으로 더이상 사용하지 않게 된 메소드들을 삭제했습니다.
a6f7ae9
c9ccffd

Trouble Shooting ⚽️

Related ScreenShot 📷

image

Uncompleted Tasks 😅

To Reviewers 📢

@hyerinhwang-sailin hyerinhwang-sailin added the 🛠️ BugFix 버그 해결 label Apr 3, 2025
@hyerinhwang-sailin hyerinhwang-sailin self-assigned this Apr 3, 2025
@hyerinhwang-sailin hyerinhwang-sailin linked an issue Apr 3, 2025 that may be closed by this pull request
2 tasks
@height
Copy link

height bot commented Apr 3, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link
Contributor

@geniusYoo geniusYoo left a comment

Choose a reason for hiding this comment

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

dev에서 테스트해보고 다시 이야기 나눠보면 좋을 것 같네요.

리뷰 확인해주세요 고생하셨습니다 :) !!

Comment on lines 66 to 73
List<Calendar> sorted = calendars.stream()
.sorted(Comparator.comparing(Calendar::getStartDate)
.thenComparing(Calendar::getEndDate))
.toList();

return sorted.stream()
.filter(calendar -> !calendar.getStartDate().isBefore(CurrentDate.now()))
.findFirst();
Copy link
Contributor

Choose a reason for hiding this comment

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

특별히 스트림을 분리한 이유가 있으실까요?
없으시다면 가독성이나 성능 측면에서 하나의 스트림으로 처리하는 것이 좋다고 보여지는데, 의견이 궁금합니다!

Suggested change
List<Calendar> sorted = calendars.stream()
.sorted(Comparator.comparing(Calendar::getStartDate)
.thenComparing(Calendar::getEndDate))
.toList();
return sorted.stream()
.filter(calendar -> !calendar.getStartDate().isBefore(CurrentDate.now()))
.findFirst();
return calendars.stream()
.sorted(Comparator.comparing(Calendar::getStartDate)
.thenComparing(Calendar::getEndDate))
.filter(calendar -> !calendar.getStartDate().isBefore(CurrentDate.now()))
.findFirst();

Copy link
Collaborator Author

@hyerinhwang-sailin hyerinhwang-sailin Apr 4, 2025

Choose a reason for hiding this comment

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

기존에 로컬에서 로그 찍어보려고 분리했던걸 다시 안 합쳐뒀네요 체크 감사합니다 합쳐두겠습니다!

Comment on lines +8 to +10
public static LocalDate now() {
return ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDate();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

와우 static final이어서 한번 지정된 날짜가 변경되지 않았겠군요 ... 찾느라 고생하셨습니다 ! ㅠㅠ

@hyerinhwang-sailin hyerinhwang-sailin merged commit 672b9e7 into dev Apr 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 홈화면 최신 행사 불일치 이슈

2 participants