Standardized time, added location support and fixed various small bugs - #73
Conversation
✅ Deploy Preview for able-alliance ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile SummaryThis PR standardizes time handling to America/New_York via a new
PR checklist areas needing attention (score: 72/100):
Confidence Score: 4/5Mostly safe to merge but the chatlog filter bug should be fixed first — it silently returns all records instead of filtered ones. One clear P1 defect in ChatlogAction where wrong MongoDB field names cause filtering to return unscoped data. Remaining findings are P2 style/cleanup issues (unused imports, hardcoded colors, px unit). The core features are implemented correctly. src/server/db/actions/ChatlogAction.ts (P1 filter bug), src/utils/dateEst.ts (unused imports), src/app/rides/new/styles.module.css and src/app/rides/[id]/styles.module.css (hardcoded colors, px units) Important Files Changed
|
| if (filters.studentId) query.studentId = filters.studentId; | ||
| if (filters.driverId) query.driverId = filters.driverId; |
There was a problem hiding this comment.
Wrong field names in Chatlog filter query
The Chatlog schema stores participants as embedded documents named student and driver, not studentId and driverId. Assigning query.studentId and query.driverId sets fields that don't exist in MongoDB, so these filters silently match nothing — any caller filtering by student or driver will always get every chatlog.
| if (filters.studentId) query.studentId = filters.studentId; | |
| if (filters.driverId) query.driverId = filters.driverId; | |
| if (filters.studentId) query["student._id"] = filters.studentId; | |
| if (filters.driverId) query["driver._id"] = filters.driverId; |
| /** | ||
| * EST/EDT-aware date utilities backed by date-fns + date-fns-tz. | ||
| * All timezone math is delegated to the library — no manual offset arithmetic. | ||
| */ | ||
|
|
||
| import { | ||
| startOfDay, | ||
| endOfDay, | ||
| startOfWeek, | ||
| endOfDay as _endOfDay, | ||
| addDays, | ||
| addWeeks, | ||
| getDay, | ||
| format as dateFnsFormat, | ||
| } from "date-fns"; |
There was a problem hiding this comment.
endOfDay as _endOfDay is imported as a second alias for endOfDay (already imported above), and format as dateFnsFormat is never referenced in this file. Both should be removed to satisfy the "no unused imports" checklist requirement and avoid lint errors.
| /** | |
| * EST/EDT-aware date utilities backed by date-fns + date-fns-tz. | |
| * All timezone math is delegated to the library — no manual offset arithmetic. | |
| */ | |
| import { | |
| startOfDay, | |
| endOfDay, | |
| startOfWeek, | |
| endOfDay as _endOfDay, | |
| addDays, | |
| addWeeks, | |
| getDay, | |
| format as dateFnsFormat, | |
| } from "date-fns"; | |
| import { | |
| startOfDay, | |
| endOfDay, | |
| startOfWeek, | |
| addDays, | |
| addWeeks, | |
| getDay, | |
| } from "date-fns"; |
No description provided.