Seed dev sample decisions once per document #379
- MA
## Why With `DEV_QUESTIONS=1` / `DEV_COMMENTS=1`, the sample decisions and comment were re-seeded every time a room reopened (idle close, rename, another browser). Counts grew 2 → 4 → 8 → 24, which misled local and preview testing.
## What changed - `questions/inject.ts` and `comments/inject.ts`: `enabled(plan)` now also requires the document to hold no durable question records (or comment threads). Records persist, so the seed runs once per document. - Never seeds when `NODE_ENV=production`. - `main.ts` passes the opened plan. - New `questions/inject.test.ts` covers first open, reopen/rename/second client (records already present), missing flag and production.
Before: every open with nothing pending added another sample set. After: one set per document.
## Seed flow

## Testing - `bun test apps/server/src/questions/inject.test.ts`: 2 pass - `bun run ci`, `bun run types`: pass - Focused local Chromium `responsive-decisions.e2e.ts`: both 320 × 568 and 390 × 844 cases pass against the matching build (2/2). The assertion counts persisted sample records after seed-once.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
MaggieAppletonhead-ref-force-pushed d3397de42dc4last month on GitHub
MaggieAppletonmerged e8d9e3a27b2dlast month on GitHub
MaggieAppletonhead-ref-deletedlast month on GitHub
MaggieAppletonreferenced this in Wait out connection blips and recover as soon as the network returns #385last month on GitHub