-
Notifications
You must be signed in to change notification settings - Fork 1
[FIX] 홈화면 최신 행사 일정 관련 이슈 - #523 #524
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
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev에서 테스트해보고 다시 이야기 나눠보면 좋을 것 같네요.
리뷰 확인해주세요 고생하셨습니다 :) !!
| 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
특별히 스트림을 분리한 이유가 있으실까요?
없으시다면 가독성이나 성능 측면에서 하나의 스트림으로 처리하는 것이 좋다고 보여지는데, 의견이 궁금합니다!
| 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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존에 로컬에서 로그 찍어보려고 분리했던걸 다시 안 합쳐뒀네요 체크 감사합니다 합쳐두겠습니다!
| public static LocalDate now() { | ||
| return ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDate(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와우 static final이어서 한번 지정된 날짜가 변경되지 않았겠군요 ... 찾느라 고생하셨습니다 ! ㅠㅠ
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 📷
Uncompleted Tasks 😅
To Reviewers 📢