Skip to content

fix(server): Klin starts on databases a v0.1.2 preview build migrated - #6

Merged
ashx-j merged 2 commits into
mainfrom
klin/peer-links-preview-migration
Nov 14, 2026
Merged

ashx-j merged 2 commits into
mainfrom
klin/peer-links-preview-migration

Conversation

@ashx-j

@ashx-j ashx-j commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Brings pingdotgg/t3code#25494 into Klin. A database that a v0.1.1 or v0.1.2 preview build (20261020.3444, 20261022.3511 or .3516) opened once won't start on Klin. Those previews recorded the peer link migrations as 68 to 70, and main later used 68 and 69 for ShellStopRequestIndex and ThreadMessageSearch, so startup refuses the migration history.

Upstream closed the original PR without a fix, and upstream main still has the bug. The original dropped the preview's peer link table and refused to start if it held links, because main had no peer links code back then. Klin now ships the same 3 peer link migrations as 70 to 72 with the same schema. So startup now runs 68 and 69 and moves the preview's 3 rows up to 70 to 72, and any stored peer links keep working. It only matches that exact preview history and doesn't run when migrating to an id below 72.

The new code lives in its own file, next to upstream's rewritten reconcileV2PreviewMigration.ts. t3 service runs a preflight check that predicts what startup will do to the migration history, and it would have blocked these databases. It now applies the same peer links reconciliation, and its test covers this preview history.


pr filed by Claude Opus 5.5 in Claude Code through T3 Code.

@ashx-j
ashx-j force-pushed the klin/peer-links-preview-migration branch from be9825b to 047299b Compare November 13, 2026 13:55
Ports the intent of pingdotgg/t3code#25494. v0.1.2 previews recorded the
peer link migrations as 68-70; Klin ships them as 70-72 after
ShellStopRequestIndex and ThreadMessageSearch. Startup now runs 68/69 and
moves the preview rows up, keeping stored peer links.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ashx-j
ashx-j force-pushed the klin/peer-links-preview-migration branch from 047299b to b40382d Compare November 13, 2026 17:36
@ashx-j
ashx-j changed the base branch from main to klin/upstream-nightly-catchup November 13, 2026 17:36
@ashx-j
ashx-j changed the base branch from klin/upstream-nightly-catchup to main November 13, 2026 22:46
@ashx-j
ashx-j merged commit df445be into main Nov 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant