Fix Invalid Date error in auth middleware
All checks were successful
Deploy / deploy (push) Successful in 2m28s
All checks were successful
Deploy / deploy (push) Successful in 2m28s
Add parseDate helper that safely returns null for empty/invalid date strings from PocketBase. This prevents RangeError when pino logger tries to serialize Invalid Date objects via toISOString(). - Make garminTokenExpiresAt and lastPeriodDate nullable in User type - Filter garmin-sync cron to skip users without required dates - Add test assertions for null date handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,8 @@ vi.mock("@/lib/pocketbase", () => ({
|
||||
id: user.id,
|
||||
email: user.email,
|
||||
calendarToken: user.calendarToken,
|
||||
lastPeriodDate: user.lastPeriodDate.toISOString(),
|
||||
// biome-ignore lint/style/noNonNullAssertion: mock user has valid date
|
||||
lastPeriodDate: user.lastPeriodDate!.toISOString(),
|
||||
cycleLength: user.cycleLength,
|
||||
garminConnected: user.garminConnected,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user