Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: validate interval against allowed enum values

Adam Eivye052af0dab9c
diff --git a/server/routes/apps.js b/server/routes/apps.js
index 132ce181d3..c72a3cc603 100644
--- a/server/routes/apps.js
+++ b/server/routes/apps.js
@@ -169,6 +169,14 @@ router.put('/:id/task-types/:taskType', asyncHandler(async (req, res) => {
throw new ServerError('enabled (boolean) or interval (string|null) required', { status: 400, code: 'VALIDATION_ERROR' });
}
+ // Validate interval against allowed values
+ if (interval !== undefined) {
+ const allowedIntervals = ['rotation', 'daily', 'weekly', 'once', 'on-demand'];
+ if (interval !== null && (typeof interval !== 'string' || !allowedIntervals.includes(interval))) {
+ throw new ServerError('interval must be one of rotation|daily|weekly|once|on-demand or null', { status: 400, code: 'VALIDATION_ERROR' });
+ }
+ }
+
const result = await appsService.updateAppTaskTypeOverride(req.params.id, req.params.taskType, { enabled, interval });
if (!result) {
throw new ServerError('App not found', { status: 404, code: 'NOT_FOUND' });