# fix\(server\): migrate-dev-db checks for legacy threads in the copy's own snapshot · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/a007595b42e2237ac5b8d91b1f294d24af2446e2)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: a007595b42e2237ac5b8d91b1f294d24af2446e2

Requested commit: a007595b42e2237ac5b8d91b1f294d24af2446e2

Commit: a007595b42e2237ac5b8d91b1f294d24af2446e2

Tree: 167e2796c0bedbf2411970d7d90cf730a9d017c3

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): migrate-dev-db checks for legacy threads in the copy's own snapshot

The legacy-thread guard read the source in its own transaction before the
copy, so a V1 server could commit its first thread in between; the
unfiltered copy took it, prune dropped it, and the run exited 0. The check
now runs inside the copy transaction, against the same snapshot as the
schema reads and row copies, and the destination's first busy check
(whose WAL checkpoint rewrites it) moves after the copy so a refusal
still leaves the destination untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [44bd595e77a0622ab69bcdd0f34970b9b252bbc6](https://git.cafe/pingdotgg/t3code/commit/44bd595e77a0622ab69bcdd0f34970b9b252bbc6?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/a007595b42e2237ac5b8d91b1f294d24af2446e2?format=markdown)
