Repository navigation
fix(schedules): normalize default UTC timezone before declarative schedule diff (#5066) #5069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1588,7 +1588,7 @@ export async function syncDeclarativeSchedules( | |
| environment.projectId, | ||
| { | ||
| cron: task.schedule.cron, | ||
| timezone: task.schedule.timezone, | ||
| timezone: task.schedule.timezone ?? "UTC", | ||
| taskIdentifier: task.id, | ||
| friendlyId: existingSchedule?.friendlyId, | ||
| window: task.schedule.window, | ||
|
|
@@ -1623,15 +1623,18 @@ export async function syncDeclarativeSchedules( | |
| windowPercentage: normalizedWindow.windowPercentage, | ||
| defaultWindowDurationSeconds: existingSchedule.defaultWindowDurationSeconds, | ||
| }).window; | ||
| const taskTimezone = task.schedule.timezone ?? "UTC"; | ||
| const existingTimezone = existingSchedule.timezone ?? "UTC"; | ||
| const timezoneChanged = existingTimezone !== taskTimezone; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Schedule fix missing release note When Learn moreThe server-only change stops unchanged UTC schedules from losing their pending job on redeployment. That can affect when a user's task runs. The server change policy requires a release note for a user-facing server fix. Example: A customer redeploys an hourly task with no explicit timezone. Its pending run now remains scheduled, but the customer sees no mention of the fix in the release notes. Recommended fix: Add a Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| const timingChanged = | ||
| existingSchedule.generatorExpression !== task.schedule.cron || | ||
| existingSchedule.timezone !== task.schedule.timezone || | ||
| timezoneChanged || | ||
| !scheduleWindowsEqual(previousWindow, nextWindow) || | ||
| // Clearing the minimum changes the effective range. | ||
| existingSchedule.minimumWindowDurationSeconds !== minimumWindowDurationSeconds; | ||
| const persistedValuesChanged = | ||
| existingSchedule.generatorExpression !== task.schedule.cron || | ||
| existingSchedule.timezone !== task.schedule.timezone || | ||
| timezoneChanged || | ||
| existingSchedule.windowDurationSeconds !== normalizedWindow.windowDurationSeconds || | ||
| existingSchedule.windowPercentage !== normalizedWindow.windowPercentage || | ||
| existingSchedule.minimumWindowDurationSeconds !== minimumWindowDurationSeconds; | ||
|
|
@@ -1643,7 +1646,7 @@ export async function syncDeclarativeSchedules( | |
| data: { | ||
| generatorExpression: task.schedule.cron, | ||
| generatorDescription: cronstrue.toString(task.schedule.cron), | ||
| timezone: task.schedule.timezone, | ||
| timezone: taskTimezone, | ||
| minimumWindowDurationSeconds, | ||
| ...normalizedWindow, | ||
| }, | ||
|
|
@@ -1675,7 +1678,7 @@ export async function syncDeclarativeSchedules( | |
| taskIdentifier: task.id, | ||
| generatorExpression: task.schedule.cron, | ||
| generatorDescription: cronstrue.toString(task.schedule.cron), | ||
| timezone: task.schedule.timezone, | ||
| timezone: task.schedule.timezone ?? "UTC", | ||
| type: "DECLARATIVE", | ||
| minimumWindowDurationSeconds, | ||
| ...normalizedWindow, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Test bypasses normal SDK metadata
The test omits
timezonethrough a cast, but scheduled task registration emits"UTC"for omitted zones. Check whether deployed clients produce metadata this test represents.Was this helpful? React with 👍 or 👎 to provide feedback.