xataio / xataio/learn-postgres
Templates: failed seed left marked up-to-date forever
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 7
- Forks
- 1
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 36
Description
Symptom
scripts/prepare-templates.ts creates a tpl-* branch, then seeds it. If create succeeds and a later step fails (awaitConnectionString, resolveBranchDsn, or seedTemplate), the next deploy/run sees the branch name in listBranches() and logs it as up-to-date, skipping recreate/re-seed.
Learners who fork that template get an empty or broken sandbox for that lesson.
Red loop (logic already exercised)
- Create template name not in
existing→ createBranch succeeds → add name to Xata. - Seed (or DSN) throws → script exits non-zero.
- Re-run:
existing.has(name)→ skip with(up-to-date).
Where
scripts/prepare-templates.ts(~lines 219–237) — existence check only; no “seeded successfully” marker / delete-on-failure
Suggested direction
On failure after create: delete the branch (or mark incomplete). On success-only: treat as up-to-date. Alternatively re-seed / verify seed before skipping.
Notes
Diagnosed with /diagnosing-bugs. Deploy impact if template prep fails mid-lesson after the branch already exists.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read scripts/prepare-templates.ts around lines 219–237 and trace the create, DSN, and seed steps. Verify the failure path after branch creation, then ensure a failed preparation is not treated as up-to-date on the next run. Done means a failed seed can be retried and a successfully prepared template remains safely skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100