Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): keep the old database when project or thread records are missing #38325

MergedAri-03(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/38325/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 41 additions and 2 deletions (loading 2).

x
0 of 5 viewed, 5 left
2 additions and 0 deletionsapps/server/src/cli/doctor.test.tsModified
View file
@@ -68,6 +68,7 @@
reclaimableBytes: 1000,
incrementalVacuumEnabled: false,
legacyDatabaseBytes: 4000,
+ legacyOnlyRecords: { projects: 0, threads: 0 },
}),
compact: () =>
startServer.pipe(
@@ -151,6 +152,7 @@
reclaimableBytes: 0,
incrementalVacuumEnabled: false,
legacyDatabaseBytes: null,
+ legacyOnlyRecords: null,
}),
compact: (_databasePath, onStep) =>
Effect.gen(function* () {
15 additions and 2 deletionsapps/server/src/cli/doctor.tsModified
View file
@@ -68,10 +68,20 @@
yield* Console.log(
`Database: ${formatBytes(status.databaseBytes)}, ${formatBytes(status.reclaimableBytes)} reclaimable.`,
);
+ const legacyRecords = status.legacyOnlyRecords;
if (status.legacyDatabaseBytes !== null) {
yield* Console.log(
`Database from before 0.1.0: ${formatBytes(status.legacyDatabaseBytes)}, kept for rolling back.`,
);