Publish: lock concurrent publishes and catch edits after staging

Abierto
#7 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
Medio día
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
sqlite, typescript

Línea de trabajo

Start with the publish path behind POST /api/publish and the staging code that records a post's state in SQLite, then read src/lib/server/db.check.ts to see how the existing checks are written. Add an in-process lock plus a lock file in the blog checkout, returning 409 with a reason on a second publish, and record the staged revision hash so edits after staging are flagged. Done when two simultaneous publish calls yield one success and one 409, a stale lock file is cleared, and the edited-after-staging check passes in db.check.ts.

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

Descripción

Context

Two concurrent publishes race on the blog checkout: both render .svx files, build, commit and push. Separately, staging is per post rather than per revision, so an edit made after staging ships on the next publish without being restaged.

Scope

  • An in-process publish lock (plus a lock file in the blog checkout so a second server process also respects it). A second publish returns 409 with the reason.
  • Record the staged revision hash when a post is staged; at publish time, a post whose head moved since staging is listed as "edited after staging" and is not published until restaged.

Acceptance criteria

  • Two simultaneous POST /api/publish calls: one succeeds, one gets 409; the checkout is not corrupted.
  • A stale lock file from a crashed process is detected and cleared.
  • A check covers the edited-after-staging case in src/lib/server/db.check.ts.

Estimate: about 4 hours.

Lenguaje dominante
HTML
Estrellas
0
Forks
0
Merge medio
1 min
PR fusionados (30 d)
2

Preparar el entorno

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 mrgnw/cfcms

Todos los issues de mrgnw/cfcms

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.