Files
t3code/scripts
Theo BrowneandClaude Opus 5 da233f0a96 Break the state-dir tie on mtime, not a fixed preference
Preferring `userdata` whenever both directories exist was wrong for the
case that motivated resolving at all: an implicit `bun run dev` stores
state in `dev`, so a base directory that had also been used with an
explicit `--home-dir` would seed the database the running server does
not open — looking like the seed did nothing.

Neither directory is categorically right, so the tie now goes to
whichever was written most recently: the one the last server actually
used. `userdata` still wins an equal or unavailable mtime. The chosen
path is already printed, so a wrong guess is visible rather than silent.

Verified both directions against a target holding both databases.

Caught by Cursor Bugbot.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 20:38:49 -07:00
..