Publish: lock concurrent publishes and catch edits after staging

オープン
#7 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
半日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
sqlite, typescript
領域
backend, databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
HTML
スター
0
フォーク
0
平均マージ
1分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mrgnw/cfcms のほかの issue

mrgnw/cfcms の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。