✨ [Feature] 캘린더 화면 api 연동 (#35)#36
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough캘린더 API 클라이언트 모듈( Changes캘린더 API 및 UI 통합
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/`(tabs)/calendar.tsx:
- Around line 86-113: The three useEffect hooks (week: fetchWeeklyEvents →
setWeeklyData, month: fetchMonthlyMarkers → setMonthlyMarkers, day:
fetchDailyEvents → setDayEvents) can suffer from out-of-order responses
overwriting newer state; protect each async call with a per-effect
cancellation/version guard (e.g., an incrementing requestId or AbortController)
captured when the effect starts, check the guard before calling
setWeeklyData/setMonthlyMarkers/setDayEvents and only apply results when the id
matches (or cancel the fetch via AbortController.signal), and clean up in the
effect return to invalidate/cancel previous requests; also ensure the .finally
handlers only clear the loading flag when the response belongs to the current
request.
In `@src/api/calendar.ts`:
- Around line 92-97: The code directly accesses response.data.result.markedDates
which can throw if result is missing; change all such accesses (e.g., the
response variable in the apiClient.get call in src/api/calendar.ts and the other
occurrences around lines referenced) to guard with optional chaining and a safe
default — use response.data?.result?.markedDates ?? [] (and similarly for any
other result properties you read in the other blocks at the noted locations) so
the function returns an empty array instead of throwing when result is
undefined.
- Around line 25-28: The getAuthHeader helper currently builds Authorization:
`Bearer ${token}` even when token is null; update getAuthHeader to check the
result of SecureStore.getItemAsync('accessToken') and if the token is falsy
either (preferred) throw a clear Error('Missing access token') so callers can
handle auth flow, or return null/undefined (or an empty object) so the
Authorization header is omitted; adjust callers of getAuthHeader (where used) to
handle the thrown error or null return accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: de508a21-42a4-43a8-beff-4133ae2fc67f
📒 Files selected for processing (7)
app/(tabs)/calendar.tsxsrc/api/auth.tssrc/api/calendar.tssrc/components/calendar/EventCard.tsxsrc/components/calendar/MonthCalendar.tsxsrc/components/calendar/WeekCalendar.tsxsrc/styles/calendar/calendar.ts
📜 Review details
🔇 Additional comments (5)
src/api/auth.ts (1)
23-27: LGTM!src/components/calendar/EventCard.tsx (1)
15-93: LGTM!src/components/calendar/MonthCalendar.tsx (1)
22-139: LGTM!src/components/calendar/WeekCalendar.tsx (1)
21-69: LGTM!src/styles/calendar/calendar.ts (1)
6-218: LGTM!
📌 작업 내용
📷 스크린 샷
🔗 관련 이슈
Closes #35
Summary by CodeRabbit