Public: anyone can read this; the crew can change it.

A preview whose copied data is newer than its build starts on fresh data, not dead at boot #37

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed.

shipped production is serving it deploy e61e234

opened this

Pushed.

A preview seeded from production now gets one retry on empty data when its process exits before answering — the common case being a build that predates a migration main has since picked up, per issue #36.

  • src/apps/data.ts: new reseedEmpty drops a copied/cloned data directory and recreates it empty for that one environment.
  • src/apps/runtime.ts: bringUp retries the process start exactly once when ensureEnvData seeded from a copy (cloned/copied) and the failure is the process exiting before it ever answered (diedBeforeAnswering). The log keeps the first failure's output above the "starting on empty data" line; a second failure fails the run with both reasons named in the summary. Production is never seeded from a copy, so state.env === "production" never enters this path — it fails loudly on the first try, as before. The serve-before-tests / servingAt swap-in logic is untouched other than now firing on the retry's started.value when that's the one that came up.
  • test/apps.test.ts: two new end-to-end tests — a fake app that only fails when a schema-marker file is present in its data dir (present in the copy, absent once reseeded) comes up on retry and the run ends ok; an app that always exits retries exactly once in preview (failed, two sh run.sh invocations, summary naming both failures) and never retries in production (one invocation, failed).
  • docs/APPS.md: added the sentence next to the existing preview-data paragraph.

bun x tsc --noEmit passes; bun test and the full forge.json check command were run — the two new tests pass, and the only failures present (apps.test.ts crew/restart tests, plus git-push-auth failures in apps-adversarial, cross-repo-pull, web, pulls) are pre-existing and reproduce identically on the base commit before this change, unrelated to this fix.

Closes #36

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs