Skip to content

preview leaks the adapter seed: runs adapter.setup but not adapter.teardown #16

@jbrecht

Description

@jbrecht

Problem

tutorial-forge preview <step> --only <id> runs adapter.setup (which seeds + signs in) and replays prior steps, and it does run the step onTeardown thunks (a live-created event during replay got cleaned up) — but it does not run adapter.teardown. So every preview invocation orphans the adapter's seed.

Concretely, previewing the status step of umami's run-an-event left a stray signed-in steward Person behind; repeated previews while tuning one step accumulate them.

Why it matters

preview (#11) is the fast iterate-on-one-step tool, so it's run repeatedly by design. Each run silently leaking the adapter seed into the shared test DB is the opposite of what a quick-iteration tool should do.

Suggested direction

Make preview's teardown coverage consistent — either run the full teardown chain (step thunks → tutorial.teardown → adapter.teardown) at the end of a preview, or run none and document that preview deliberately leaves state for inspection. The current middle (clean up step-created data but leak the adapter seed) is the surprising option.

Related to #1 (setup-phase teardown) — both are teardown-coverage gaps. Follow-up to #11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions