Only write sentinel if migration succeeded

This commit is contained in:
shey
2026-03-16 13:55:18 -07:00
parent 743c41feb7
commit 37875df8e7
+4 -3
View File
@@ -224,12 +224,13 @@ export async function exportVSCodeStorageToSharedFiles(
Logger.info("[McpMigration] Shared MCP settings already has servers configured, skipping.")
}
}
// Only write sentinel if migration succeeded
storage.globalState.update(MCP_SETTINGS_MIGRATION_VERSION_KEY, CURRENT_MCP_SETTINGS_MIGRATION_VERSION)
} catch (error) {
// Non-fatal — MCP settings will start fresh if migration fails.
// Non-fatal — will retry on next startup
Logger.error("[McpMigration] Failed to migrate MCP settings file:", error)
}
storage.globalState.update(MCP_SETTINGS_MIGRATION_VERSION_KEY, CURRENT_MCP_SETTINGS_MIGRATION_VERSION)
}
result.migrated = true