Repository navigation
fix(schedules): normalize default UTC timezone before declarative schedule diff (#5066) - #5068
Conversation
|
|
Hi @MilindChatrabhuji, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
Overview
Fixes #5066
Problem
When syncing declarative task schedules where the task schedule definition omits an explicit timezone (e.g.
schedules.task({ cron: "0 * * * *" })),task.schedule.timezoneisundefined. Because the database modelTaskScheduledefaults to"UTC", comparingexistingSchedule.timezone("UTC") againsttask.schedule.timezone(undefined) evaluated totrueon every single deployment:This falsely marked declarative schedules as modified on each deployment, triggering unnecessary database updates and unneeded schedule re-registrations.
Solution
"UTC"fallback before evaluatingtimingChangedandpersistedValuesChanged:"UTC"default normalization during schedule creation (task.schedule.timezone ?? "UTC") and quota checks (checkSchedule.call).createBackgroundWorker.server.test.tsverifying that existing schedules and Redis jobs are preserved when a deployment schedule omits an explicit UTC timezone.@algora-pbc /claim #5066