MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readMigrationJournal

Function readMigrationJournal

apps/local/src/db/v1-v2-migration.ts:1209–1226  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1207};
1208
1209const readMigrationJournal = (path: string): MigrationJournalReadResult => {
1210 if (!fs.existsSync(path)) return { kind: "missing" };
1211 try {
1212 const parsed = JSON.parse(fs.readFileSync(path, "utf-8"));
1213 if (!isMigrationJournal(parsed)) {
1214 return {
1215 kind: "unreadable",
1216 cause: new LocalV1V2MigrationError({
1217 message: `Migration journal has an unrecognized shape: ${path}`,
1218 cause: parsed,
1219 }),
1220 };
1221 }
1222 return { kind: "valid", journal: parsed };
1223 } catch (cause) {
1224 return { kind: "unreadable", cause };
1225 }
1226};
1227
1228const authBackupInfoForMigration = (
1229 nonce: string,

Callers 1

recoverV1V2MigrationFunction · 0.85

Calls 1

isMigrationJournalFunction · 0.85

Tested by

no test coverage detected