[feat] Scheduler: expose canonical schedule display and timestamps

Abierto
#2,247 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start by tracing the schedule.list and schedule.history handlers and their schedule row types; the issue names those API entry points but no source files or tests. Check how schedule records store creation and modification times, then inspect the existing schedule schema tests and docs. Done means the API exposes stable timestamps and a canonical display with an explicit editability rule, while older clients remain compatible and non-RRULE schedules cannot be overwritten by placeholders.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

core design enhancement needs-split P1

Problem / Context

schedule.list exposes enabled_at, revision, last_run and the structured schedule (every_minutes / cron / at). It does not expose a stable creation/update timestamp or a canonical display string for schedules the client cannot round-trip.

The Electron Desktop currently fabricates both:

  • createdAt = enabled_at, updatedAt = last_run ?? enabled_at in packages/desktop/packages/electron-main/src/app-server/scheduler.ts; pausing/resuming changes the apparent creation time;
  • for a cron/at schedule it cannot represent as an RRULE it stores RRULE:FREQ=DAILY;BYHOUR=0;BYMINUTE=0 plus a read-only scheduleText. If the edit form ever submits that placeholder, it can overwrite the real cron/at schedule with a daily schedule.

This is a correctness problem, not only a display preference. A client must not invent a schedule value it may later write back.

Proposal

Minimum:

  • add stable created_at and updated_at (or modified_at) to schedule.list / schedule.history rows;
  • add a canonical schedule_text / display that clients render read-only;
  • expose whether the schedule is form-editable, or make RRULE-only the explicit contract and return editable: false for cron/at.

Preferred:

  • keep the structured schedule as the only write shape; clients that cannot represent it must not prefill a placeholder;
  • make created_at/updated_at independent of enabled_at and last_run.

Why this belongs in App Server

The schedule is owner data. A client-side RRULE conversion is lossy; once a client writes the placeholder back, the owner loses the original cron/at schedule. Creation and modification times are also owner facts that clients cannot derive from enabled_at/last_run.

If upstream declines

If these fields are considered unnecessary, Desktop will remove createdAt/updatedAt from the job view and will show non-RRULE schedules read-only without prefill. It will not write a fabricated RRULE.

Acceptance

  • schedule.list gives stable creation/update timestamps (or explicitly says they are not exposed).
  • A cron/at schedule has a canonical display string and an explicit editability rule.
  • Editing a non-RRULE schedule cannot overwrite it with a placeholder.
  • Pausing/resuming does not change the creation timestamp.
  • Older clients remain compatible.

Boundaries

  • No new scheduler state in clients.
  • No automatic conversion of arbitrary cron to RRULE.
  • No change to schedule execution semantics.

Related

  • Desktop tracking issue will be linked in a comment.
  • #1287 (schedule schema docs)
  • #1225 (schedule notices)
Lenguaje dominante
Rust
Estrellas
584
Forks
42
Merge medio
9 h 41 min
PR fusionados (30 d)
929

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de arcships/dim

Todos los issues de arcships/dim

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.