feat(cron): set default enabled state for cron jobs

- Added logic to default the `enabled` property to `true` if not explicitly set as a boolean in the cron job input.
- Updated job creation and store functions to ensure consistent handling of the `enabled` state across the application.
- Enhanced input normalization to improve job configuration reliability.

This update ensures that cron jobs are enabled by default, enhancing user experience and reducing potential misconfigurations.
This commit is contained in:
Tyler Yust
2026-02-03 16:55:27 -08:00
committed by Peter Steinberger
parent 3f82daefd8
commit 1409943863
3 changed files with 10 additions and 1 deletions

View File

@@ -101,6 +101,11 @@ export async function ensureLoaded(state: CronServiceState) {
mutated = true;
}
if (typeof raw.enabled !== "boolean") {
raw.enabled = true;
mutated = true;
}
const payload = raw.payload;
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
if (migrateLegacyCronPayload(payload as Record<string, unknown>)) {