-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/153 예약 및 프로필 데이터 실시간 업데이트 #154
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
Walkthrough
Changes
Sequence Diagram(s)(생략: 단순 옵션 추가로 인한 컨트롤 플로우 변화 없음) Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 이슈의 목적과 무관한 변경사항 없음) Suggested labels
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
BokyungCodes
left a comment
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.
까도 까도 계속 나오는 양파같은 이슈들이네요..
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
src/hooks/useDashboardQueries.ts(4 hunks)src/hooks/useMyPageQueries.ts(1 hunks)src/hooks/useReservationQueries.ts(1 hunks)
🔇 Additional comments (2)
src/hooks/useMyPageQueries.ts (1)
27-28: 프로필 데이터 refetch 최적화 고려 필요
refetchOnWindowFocus: true와 5분staleTime조합으로 인해 윈도우 포커스 시마다 데이터가 refetch될 수 있습니다. 프로필 데이터는 자주 변경되지 않으므로 성능 최적화를 위해 다음을 고려해보세요:const query = useQuery({ queryKey: QUERY_KEYS.PROFILE, queryFn: getMyProfile, staleTime: 1000 * 60 * 5, - refetchOnWindowFocus: true, + refetchOnWindowFocus: 'always', refetchOnMount: true, });또는 staleTime 내에서는 refetch하지 않도록 기본값을 사용하는 것을 검토해보세요.
Likely an incorrect or invalid review comment.
src/hooks/useDashboardQueries.ts (1)
32-33: 대시보드 실시간 업데이트 구현 우수함예약 관련 대시보드 데이터에 대한 실시간 업데이트 구현이 적절합니다:
- 예약 현황은 자주 변경되므로
refetchOnWindowFocus가 유용함- 예약/스케줄 관련 쿼리의 짧은
staleTime(2분)이 적절함- 모든 대시보드 훅에 일관성 있게 적용됨
이는 이슈 #153의 예약 승인 후 실시간 업데이트 문제를 효과적으로 해결합니다.
Also applies to: 53-54, 65-66, 98-99
| refetchOnWindowFocus: true, | ||
| refetchOnMount: true, |
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.
🧹 Nitpick (assertive)
예약 데이터 실시간 업데이트 구현 확인, staleTime 일관성 검토 필요
이슈 #153의 핵심 문제인 예약 내역 실시간 업데이트가 구현되었습니다. 하지만 staleTime 일관성을 검토해보세요:
return useInfiniteQuery({
queryKey: [...RESERVATION_QUERY_KEYS.RESERVATIONS, status],
queryFn: ({ pageParam = 0 }) =>
getMyReservations({
cursorId: pageParam,
size: 10,
status,
}),
getNextPageParam: (lastPage) => {
return lastPage.reservations.length === 10
? lastPage.cursorId
: undefined;
},
initialPageParam: 0,
- staleTime: 1000 * 60 * 5,
+ staleTime: 1000 * 60 * 2, // 대시보드 쿼리와 일관성 유지
refetchOnWindowFocus: true,
refetchOnMount: true,
});예약 데이터는 대시보드와 동일한 빈도로 업데이트되어야 하므로 2분 staleTime이 더 적절할 수 있습니다.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| refetchOnWindowFocus: true, | |
| refetchOnMount: true, | |
| return useInfiniteQuery({ | |
| queryKey: [...RESERVATION_QUERY_KEYS.RESERVATIONS, status], | |
| queryFn: ({ pageParam = 0 }) => | |
| getMyReservations({ | |
| cursorId: pageParam, | |
| size: 10, | |
| status, | |
| }), | |
| getNextPageParam: (lastPage) => { | |
| return lastPage.reservations.length === 10 | |
| ? lastPage.cursorId | |
| : undefined; | |
| }, | |
| initialPageParam: 0, | |
| staleTime: 1000 * 60 * 2, // 대시보드 쿼리와 일관성 유지 | |
| refetchOnWindowFocus: true, | |
| refetchOnMount: true, | |
| }); |
🤖 Prompt for AI Agents
In src/hooks/useReservationQueries.ts around lines 41 to 42, the current
staleTime setting does not match the desired update frequency for reservation
data. To ensure reservation data updates in real-time and aligns with the
dashboard's update interval, change the staleTime value to 2 minutes (120000
milliseconds). This adjustment will maintain consistency in data freshness
across components.
📌 변경 사항 개요
예약 및 프로필 데이터 실시간 업데이트
📝 상세 내용
🔗 관련 이슈
🖼️ 스크린샷(선택사항)
💡 참고 사항
Summary by CodeRabbit