Conversation
- Add GET /api/notifications/trip-reminders endpoint that generates smart notification messages based on days until trip (7, 3, 1 day and day-of) including pack item counts and device charging alerts - Add useTripNotifications hook in Expo app to fetch trip reminders - Add TripNotificationsList component with priority-colored cards - Update notifications settings screen to display trip reminders - Add i18n translation keys for notification strings Co-authored-by: andrew-bierman <94939237+andrew-bierman@users.noreply.github.com>
|
@coderabbitai Please review this PR for code quality, best practices, and potential issues. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 749 🏁 Script executed: Length of output: 20797 🏁 Script executed: Length of output: 8511
Review: Smart Pre-Trip Notifications POC🔴 Critical Issues1.
|
| # | Severity | Location | Issue |
|---|---|---|---|
| 1 | 🔴 Critical | notifications/index.ts |
Math.ceil — morning_of branch never fires |
| 2 | 🔴 Critical | notifications/index.ts |
N+1 query for pack item counts |
| 3 | 🔴 Critical | notifications/index.ts |
No DB-level date filter |
| 4 | 🔴 Critical | i18n/types.ts |
notifications.* keys not in TranslationKey |
| 5 | 🟡 Medium | notifications.tsx |
refresh unconnected to pull-to-refresh / retry |
| 6 | 🟡 Medium | TripNotificationsList.tsx |
Nested ScrollView with scrollEnabled={false} |
| 7 | 🟡 Medium | en.json |
Several i18n keys defined but unused |
| 8 | 🟡 Medium | notifications/index.ts |
orderBy missing explicit direction |
| 9 | 🔵 Low | TripNotificationsList.tsx |
Unsafe as cast for icon name |
| 10 | 🔵 Low | useTripNotifications.ts |
cancelled flag instead of AbortController |
|
@copilot CodeRabbit has provided review feedback on this PR. Please review and address the comments. |
- Fix morning_of notification bug: use calendar-date Math.round instead
of Math.ceil to correctly detect day-of-trip (fixes same-day trips)
- Fix N+1 query: batch-fetch all pack item counts with single inArray
query instead of per-trip SELECT inside loop
- Add DB-level date filter (gte/lte) to trips query; remove JS filter
- Add explicit asc() direction to orderBy per codebase convention
- Add notifications.* keys to TranslationKey union type in i18n/types.ts
- Wire refresh() to pull-to-refresh RefreshControl on notifications screen
- Pass onRetry prop to TripNotificationsList for error state retry action
- Replace nested ScrollView scrollEnabled={false} with plain View
- Remove 7 unused i18n keys from en.json
- Type NOTIFICATION_ICON map with MaterialIconName from @roninoss/icons;
replace 4 invalid icon names (package-variant, flag-checkered,
check-all, battery-charging) with valid equivalents; fix error/empty
state icons (alert-circle-outline, bell-check-outline)
- Replace cancelled boolean flag with AbortController + axios.isCancel
Co-authored-by: andrew-bierman <94939237+andrew-bierman@users.noreply.github.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Warning Rate limit exceeded
⌛ 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
/api/notifications/trip-remindersuseTripNotificationshook in Expo appTripNotificationsListcomponentOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.